var g_selProvince;
var g_selCity;
var Provinces=new Array(

new Array("130000","Dundee 大学"),
new Array("140000","Abertay Dundee 大学"),
new Array("150000","语言学校"),
new Array("160000","其它")


);

var Citys=new Array(

new Array("130101","Accounting & Finance (School of),邓迪大学"),
new Array("130201","Architecture (School of),邓迪大学"),
new Array("130301","Computing (School of),邓迪大学"),
new Array("131401","Dentistry (School of),邓迪大学"),
new Array("130501","Duncan of Jordanstone College of Art & Design,邓迪大学"),
new Array("130601","Engineering & Physical Sciences (School of),邓迪大学"),
new Array("130701","Education, Social Work and Community Education(School of),邓迪大学"),
new Array("130801","Humanities (School of),邓迪大学"),
new Array("130901","Law (School of),邓迪大学"),
new Array("131001","Life Sciences Research (School of),邓迪大学"),
new Array("131101","Life Sciences Learning & Teaching (School of),邓迪大学"),
new Array("131201","Medicine (School of),邓迪大学"),
new Array("131301","Nursing & Midwifery (School of),邓迪大学"),
new Array("131401","Postgraduate School of Management and Policy,邓迪大学"),
new Array("131501","Psychology (School of),邓迪大学"),
new Array("131601","Social Sciences (School of),邓迪大学"),
new Array("131701","Other department or School,邓迪大学"),
new Array("140101","Computing and Creative Technologies (CCT) (school of),阿伯泰邓迪大学"),
new Array("140102","Contemporary Sciences (SCS) (school of),阿伯泰邓迪大学"),
new Array("140103","Dundee Business School (DBS) (school of),阿伯泰邓迪大学"),
new Array("140104","Social & Health Sciences (SHS) (School of),阿伯泰邓迪大学"),
new Array("140105","Embreonix,阿伯泰邓迪大学"),
new Array("140106","SIMBIOS,阿伯泰邓迪大学"),
new Array("140107","Scottish Economic Research (SER),阿伯泰邓迪大学"),
new Array("140108","The Scottish Institute of Wood Technology,阿伯泰邓迪大学"),
new Array("140109","Urban Water Technology Centre,阿伯泰邓迪大学"),
new Array("140110","Abertay Centre for the Environment,阿伯泰邓迪大学"),
new Array("140111","Other Schools,阿伯泰邓迪大学"),

new Array("150101","Dundee语言学校"),
new Array("160100","Dundee区其它学校")



);

function FillProvinces(selProvince)
{
    selProvince.options[0]=new Option("选择学校名称","");
    for(i=0;i<Provinces.length;i++)
    {
        selProvince.options[i+1]=new Option(Provinces[i][1],Provinces[i][0]);
        //selProvince.options[i+1]=new Option(Provinces[i][1],Provinces[i][1]);
    }
    selProvince.options[0].selected=true;
    selProvince.length=i+1;
}

function FillCitys(selCity,ProvinceCode)
{
    //if the province is a direct-managed city, like Beijing, shanghai, tianjin, chongqin,hongkong, macro
        //need not "请选择选项"
        if(ProvinceCode=="140000"||ProvinceCode=="150000")
             count=0;
        else
                {selCity.options[0]=new Option("选择系名",ProvinceCode);
                count=1;}
    for(i=0;i<Citys.length;i++)
    {
        if(Citys[i][0].toString().substring(0,2)==ProvinceCode.substring(0,2))
        {
            //selCity.options[count]=new Option(Citys[i][1],Citys[i][0]);
            selCity.options[count]=new Option(Citys[i][1],Citys[i][1]);
            count=count+1;
        }
    }
    selCity.options[0].selected=true;
    selCity.length=count;
}

function Province_onchange()
{
    FillCitys(g_selCity,g_selProvince.value);
}

function InitCitySelect(selProvince,selCity)
{
    //alert("begin");
    g_selProvince=selProvince;
    g_selCity=selCity;
    selProvince.onchange=Function("Province_onchange();");
    FillProvinces(selProvince);
    Province_onchange();
}
function InitCitySelect2(selProvince,selCity,CityCode)
{
    InitCitySelect(selProvince,selCity)
    for(i=0;i<selProvince.length;i++)
    {
        if(selProvince.options[i].value.substring(0,2)==CityCode.substring(0,2))
        {
            selProvince.options[i].selected=true;
        }
    }
    Province_onchange();
    for(i=0;i<selCity.length;i++)
    {
        if(selCity.options[i].value==CityCode)
        {
            selCity.options[i].selected=true;
        }
    }
}

