/*
*本页面的Js文件,是操作 HTML控件对象时所用的!-------
*/

/*
*得到对象 select 现在的值----------
*/
function getSelectIndex(sel,type){
	var type=""+type,return_ve="";
    if(sel.selectedIndex == -1){
		return "";
	}
		switch(type){
		   case "index":
		   return_ve=sel.selectedIndex  
		   break;

		   case "value":
		   return_ve=sel.options[sel.selectedIndex].value
		   break;

		   case "text":
		   return_ve=sel.options[sel.selectedIndex].text
		   break;

		   default:
            return_ve=sel.options[sel.selectedIndex].value
           break;
		}
 return return_ve
}

/*
*将select 对象至为空!
*/
function setSelectNull(Obj){
	Obj.length=1
		Obj.options[0]=new Option("请选择","-1")
}

/*
*建立国家,省份,地级市对象---
*/
function Country(id,name,DataSource){
	this.id=id
	this.name=name
	this.Data=DataSource
}
function Province(id,ParentID,name){
	this.id=id
	this.ParentID=ParentID
	this.name=name
	this.citys=new Array();
	this.AddCity=AddCity;
}
function City(id,name,code){
	this.id=id
	this.name=name
	this.code=code
	this.child=new Array();
	this.AddChildCity=AddChildCity;
}
function node(id,name){
	this.id=id
	this.name=name
}

/*
*建立增加城市的子城市的对象
*/
function AddCity(city){
	var b=this.citys
		b.push(city)
	this.citys=b
}
function AddChildCity(id,name){
	var b=this.child
		b.push(new node(id,name))
	this.child=b
}


