﻿// JScript 文件
function countryRecord(countryName, states)
{
	this._CountryName = countryName
	this._States = states
}
//
var country = new Array();
country[0] = new countryRecord("Please select",0);
country[1] = new countryRecord("China", 1);
country[2] = new countryRecord("Australia", 2);
country[3] = new countryRecord("Bangladesh", 3);
country[4] = new countryRecord("Canada", 4);
country[5] = new countryRecord("Denmark", 5);
country[6] = new countryRecord("Egypt", 6);
country[7] = new countryRecord("Finland", 7);
country[8] = new countryRecord("France", 8);
country[9] = new countryRecord("Germany", 9);
country[10] = new countryRecord("Greece", 10);
country[11] = new countryRecord("India", 11);
country[12] = new countryRecord("Indonesia", 12);
country[13] = new countryRecord("Italy", 13);
country[14] = new countryRecord("Japan", 14);
country[15] = new countryRecord("Mexico", 15);
country[16] = new countryRecord("Netherlands", 16);
country[17] = new countryRecord("New Zealand", 17);
country[18] = new countryRecord("Nigeria", 18);
country[19] = new countryRecord("Norway", 19);
country[20] = new countryRecord("Pakistan", 20);
country[21] = new countryRecord("Philippines", 21);
country[22] = new countryRecord("Poland", 22);
country[23] = new countryRecord("Portugal", 23);
country[24] = new countryRecord("Russian Federation", 24);
country[25] = new countryRecord("Singapore", 25);
country[26] = new countryRecord("South Africa", 26);
country[27] = new countryRecord("South Korea", 27);
country[28] = new countryRecord("Spain", 28);
country[29] = new countryRecord("Sweden", 29);
country[30] = new countryRecord("Switzerland", 30);
country[31] = new countryRecord("Thailand", 31);
country[32] = new countryRecord("Turkey", 32);
country[33] = new countryRecord("United Kingdom", 33);
country[34] = new countryRecord("United States", 34);
country[35] = new countryRecord("Viet NAM", 35);
country[36] = new countryRecord("Other Country", 36);


//  初始化国家下拉菜单
function showCountry(theCountry)
{
	theCountry.options.length = 0;
	for(var i = 0;i < country.length;i++)
	{
		theCountry.options[i] = new Option(country[i]._CountryName, i);
	}
	//theCountry.options[0].selected = true;
}




//  根据"名称文本"设置下拉选择项
function setSelectedVaule(obj, nameText)
{
    if(nameText.length > 0)
    {
        for(var i = 0;i < obj.length;i++)
        {
            if(nameText == obj.options[i].text)
            {
                obj.options[i].selected = true;
                break;
            }
        }
    }
}