﻿function country(name)
{
	this.name=name;
	this.list=new Array();
	this.addProvince=addProvince;
	//this.getOptions=getOptins;
}

function addProvince(province)
{
	this.list=this.list.concat(province);
}

function province(name)
{
	this.name=name;
}

function onCountryChange()
{
	var curCol=document.getElementById('Country');
	var proCol=document.getElementById('Province');
	var proCol2=document.getElementById('Province2');
	var len=countries[curCol.selectedIndex].list.length;
	if(len>0)
	{
		for(i=0;i<len;i++)
		{
			proCol.options[i]=new Option(countries[curCol.selectedIndex].list[i].name,countries[curCol.selectedIndex].list[i].name)
		}
		proCol2.style.display='none';
		proCol2.disabled='disabled';
		proCol.style.display='';
		proCol.disabled='';
	}
	else
	{
		proCol.style.display='none';
		proCol.disabled='disabled';
		proCol2.style.display='';
		proCol2.disabled='';
	}
}

function onLoadBind(a)
{
	var curCol=document.getElementById('Country');
	//var proCol=document.getElementById('Province');
	//var proCol2=document.getElementById('Province2');
	for(i=0;i<countries.length;i++)
	{
		curCol.options[i]=new Option(countries[i].name,countries[i].name);
	}
	var defaultSelectIndex=a;
	//alert(defaultSelectIndex);
	var len=countries[defaultSelectIndex].list.length;
	curCol.selectedIndex=defaultSelectIndex;
	//if(len>0)
	//{
		//for(i=0;i<len;i++)
		//{
			//proCol.options[i]=new Option(countries[curCol.selectedIndex].list[i].name,countries[curCol.selectedIndex].list[i].name)
		//}
		//proCol2.style.display='none';
		//proCol2.disabled='disabled';
		//proCol.style.display='';
		//proCol.disabled='';
	//}
	//else
	//{
		//proCol.style.display='none';
		//proCol.disabled='disabled';
		//proCol2.style.display='';
		//proCol2.disabled='';
	//}
}

//绑定国家与省份数据
var countries=new Array();
var cur;
cur=new country('Albania');countries=countries.concat(cur);
cur=new country('Algeria');countries=countries.concat(cur);
cur=new country('Arabia');countries=countries.concat(cur);
cur=new country('Argentina');countries=countries.concat(cur);
cur=new country('Australia');countries=countries.concat(cur);
cur=new country('Austria');countries=countries.concat(cur);
cur=new country('Azerbaijan');countries=countries.concat(cur);
cur=new country('Bahamas');countries=countries.concat(cur);
cur=new country('Bahrain');countries=countries.concat(cur);
cur=new country('Bangladesh');countries=countries.concat(cur);
cur=new country('Belarus');countries=countries.concat(cur);
cur=new country('Belgium');countries=countries.concat(cur);
cur=new country('Benin');countries=countries.concat(cur);
cur=new country('Bolivia');countries=countries.concat(cur);
cur=new country('Bosnia and Herzegovina');countries=countries.concat(cur);
cur=new country('Brazil');countries=countries.concat(cur);
cur=new country('Bulgaria');countries=countries.concat(cur);
cur=new country('Cameroon');countries=countries.concat(cur);
cur=new country('Canada');countries=countries.concat(cur);
cur=new country('Central african');countries=countries.concat(cur);
cur=new country('Chile');countries=countries.concat(cur);
cur=new country('China');countries=countries.concat(cur);

//cur=new country('中国');countries=countries.concat(cur);
cur.addProvince(new province('北京'));
cur.addProvince(new province('上海'));
cur.addProvince(new province('广东'));
cur.addProvince(new province('安徽'));
cur.addProvince(new province('重庆'));
cur.addProvince(new province('福建'));
cur.addProvince(new province('浙江'));
cur.addProvince(new province('新疆'));
cur.addProvince(new province('西藏'));
cur.addProvince(new province('天津'));
cur.addProvince(new province('四川'));
cur.addProvince(new province('陕西'));
cur.addProvince(new province('山东'));
cur.addProvince(new province('山西'));
cur.addProvince(new province('青海'));
cur.addProvince(new province('宁夏'));
cur.addProvince(new province('内蒙古'));
cur.addProvince(new province('辽宁'));
cur.addProvince(new province('江西'));
cur.addProvince(new province('江苏'));
cur.addProvince(new province('湖南'));
cur.addProvince(new province('湖北'));
cur.addProvince(new province('黑龙江'));
cur.addProvince(new province('河南'));
cur.addProvince(new province('海南'));
cur.addProvince(new province('贵州'));
cur.addProvince(new province('广西'));
cur.addProvince(new province('甘肃'));
cur.addProvince(new province('云南'));

cur=new country('Colombia');countries=countries.concat(cur);
cur=new country('Costa Rica');countries=countries.concat(cur);
cur=new country('Cote d\'Ivoire (Ivory Coast)');countries=countries.concat(cur);
cur=new country('Croatia (Hrvatska)');countries=countries.concat(cur);
cur=new country('Cyprus');countries=countries.concat(cur);
cur=new country('Czech Republic');countries=countries.concat(cur);
cur=new country('Denmark');countries=countries.concat(cur);
cur=new country('Dominican Republic');countries=countries.concat(cur);
cur=new country('Ecuador');countries=countries.concat(cur);
cur=new country('Egypt');countries=countries.concat(cur);
cur=new country('El Salvador');countries=countries.concat(cur);
cur=new country('Estonia');countries=countries.concat(cur);
cur=new country('Ethiopia');countries=countries.concat(cur);
cur=new country('Finland');countries=countries.concat(cur);
cur=new country('France');countries=countries.concat(cur);
cur=new country('Georgia');countries=countries.concat(cur);
cur=new country('Germany');countries=countries.concat(cur);
cur=new country('Ghana');countries=countries.concat(cur);
cur=new country('Greece');countries=countries.concat(cur);
cur=new country('Guatemala');countries=countries.concat(cur);
cur=new country('Honduras');countries=countries.concat(cur);
cur=new country('Hongkong');countries=countries.concat(cur);
cur=new country('Hungary');countries=countries.concat(cur);
cur=new country('Iceland');countries=countries.concat(cur);
cur=new country('India');countries=countries.concat(cur);
cur=new country('Indonesia');countries=countries.concat(cur);
cur=new country('Iran');countries=countries.concat(cur);
cur=new country('Iraq');countries=countries.concat(cur);
cur=new country('Ireland');countries=countries.concat(cur);
cur=new country('Ireland rep');countries=countries.concat(cur);
cur=new country('Israel');countries=countries.concat(cur);
cur=new country('Italy');countries=countries.concat(cur);
cur=new country('Jamaica');countries=countries.concat(cur);
cur=new country('Japan');countries=countries.concat(cur);
cur=new country('Jordan');countries=countries.concat(cur);
cur=new country('Kazakhstan');countries=countries.concat(cur);
cur=new country('Kenya');countries=countries.concat(cur);
cur=new country('Kuwait');countries=countries.concat(cur);
cur=new country('Latvia');countries=countries.concat(cur);
cur=new country('Lebanon');countries=countries.concat(cur);
cur=new country('Libya');countries=countries.concat(cur);
cur=new country('Lithuania');countries=countries.concat(cur);
cur=new country('Lituuanla');countries=countries.concat(cur);
cur=new country('Macao');countries=countries.concat(cur);
cur=new country('Macedonia');countries=countries.concat(cur);
cur=new country('Malaysia');countries=countries.concat(cur);
cur=new country('Malta');countries=countries.concat(cur);
cur=new country('Mauritius');countries=countries.concat(cur);
cur=new country('Mexico');countries=countries.concat(cur);
cur=new country('Moldova');countries=countries.concat(cur);
cur=new country('Mongolia');countries=countries.concat(cur);
cur=new country('Morocco');countries=countries.concat(cur);
cur=new country('Myanmar');countries=countries.concat(cur);
cur=new country('Myanmark(burma)');countries=countries.concat(cur);
cur=new country('Nepal');countries=countries.concat(cur);
cur=new country('Netherland');countries=countries.concat(cur);
cur=new country('Netherlands');countries=countries.concat(cur);
cur=new country('New Zealand');countries=countries.concat(cur);
cur=new country('Nigeria');countries=countries.concat(cur);
cur=new country('North korea');countries=countries.concat(cur);
cur=new country('Norway');countries=countries.concat(cur);
cur=new country('Oman');countries=countries.concat(cur);
cur=new country('Pakistan');countries=countries.concat(cur);
cur=new country('Palestine');countries=countries.concat(cur);
cur=new country('Panama');countries=countries.concat(cur);
cur=new country('Paraguay');countries=countries.concat(cur);
cur=new country('Peru');countries=countries.concat(cur);
cur=new country('Philippines');countries=countries.concat(cur);
cur=new country('Poland');countries=countries.concat(cur);
cur=new country('Portugal');countries=countries.concat(cur);
cur=new country('Puerto');countries=countries.concat(cur);
cur=new country('Qatar');countries=countries.concat(cur);
cur=new country('Rico');countries=countries.concat(cur);
cur=new country('Romania');countries=countries.concat(cur);
cur=new country('Russia');countries=countries.concat(cur);
cur=new country('Russian fedrration');countries=countries.concat(cur);
cur=new country('Saudi');countries=countries.concat(cur);
cur=new country('Saudi arabia');countries=countries.concat(cur);
cur=new country('Singapore');countries=countries.concat(cur);
cur=new country('Slovakia');countries=countries.concat(cur);
cur=new country('Slovenia');countries=countries.concat(cur);
cur=new country('South Africa');countries=countries.concat(cur);
cur=new country('South Korea');countries=countries.concat(cur);
cur=new country('Spain');countries=countries.concat(cur);
cur=new country('Sri Lanka');countries=countries.concat(cur);
cur=new country('Sudan');countries=countries.concat(cur);
cur=new country('Sweden');countries=countries.concat(cur);
cur=new country('Switzerland');countries=countries.concat(cur);
cur=new country('Syria');countries=countries.concat(cur);
cur=new country('Taiwan');countries=countries.concat(cur);
cur=new country('Tanzania');countries=countries.concat(cur);
cur=new country('Thailand');countries=countries.concat(cur);
cur=new country('Togo');countries=countries.concat(cur);
cur=new country('Trinidad and Tobago');countries=countries.concat(cur);
cur=new country('Tunisia');countries=countries.concat(cur);
cur=new country('Turkey');countries=countries.concat(cur);
cur=new country('U.K');countries=countries.concat(cur);
cur=new country('U.S.A');countries=countries.concat(cur);
cur=new country('Uganda');countries=countries.concat(cur);
cur=new country('Ukraine');countries=countries.concat(cur);
cur=new country('United Arab Emirates');countries=countries.concat(cur);
cur=new country('United Kingdom');countries=countries.concat(cur);
cur=new country('United States');countries=countries.concat(cur);
cur=new country('Uruguay');countries=countries.concat(cur);
cur=new country('Uzbekistan');countries=countries.concat(cur);
cur=new country('Venezuela');countries=countries.concat(cur);
cur=new country('Vietnam');countries=countries.concat(cur);
cur=new country('Yemen');countries=countries.concat(cur);
cur=new country('Yugoslavia');countries=countries.concat(cur);
cur=new country('Zambia');countries=countries.concat(cur);
cur=new country('Zimbabwe');countries=countries.concat(cur);


//cur=new country('HONGKONG');countries=countries.concat(cur);
//cur=new country('TAIWAN');countries=countries.concat(cur);
//cur=new country('MACAO');countries=countries.concat(cur);
cur=new country('Other Area');countries=countries.concat(cur);
//cur=new country('中国香港');countries=countries.concat(cur);
//cur=new country('中国台湾');countries=countries.concat(cur);
//cur=new country('中国澳门');countries=countries.concat(cur);
//cur=new country('Other Area');countries=countries.concat(cur);