//初始化option list
function fillSelect(nodeString,array) {
    var node = document.getElementById(nodeString);
    var nodelen = node.length;
    for(var i=nodelen,j=0;i<array.length+nodelen;i++,j++){    
        node.options[i] = new Option(array[j][1],array[j][0]);
    }
}
//初始化默认
function firstSelect(id,value) {
    if(value == null || value == '') return;
    var sTmp = document.getElementById(id);
    for (var i=0; i < sTmp.length; i++){
        if(sTmp.options[i].value == value) {
            sTmp.options[i].selected = true;
            return;
        }
    }
}


function change_area(country,city){
    var cg=country.options[country.selectedIndex].value;
    var select2=document.getElementById(city);
    var j=0;
    for(var i=0;i<coutryAndCity.length;i++){
        if(coutryAndCity[i].country==cg){
            select2.options[j]=new Option(coutryAndCity[i].cityValue,coutryAndCity[i].cityText);
            j++;
        }
    }
    if(cc>j) {
        for(var ii=cc;ii>=j;ii--){
            select2.options[ii] = null;
        }
    }
    cc=j;
}
var provinceArray = [
    ["0","-省/直辖市-"],
    ["北京","北京"],
    ["上海","上海"],
    ["天津","天津"],
    ["广东","广东"],
    ["浙江","浙江"],
    ["江苏","江苏"],
    ["福建","福建"],
    ["湖南","湖南"],
    ["湖北","湖北"],
    ["重庆","重庆"],
    ["辽宁","辽宁"],
    ["吉林","吉林"],
    ["黑龙江","黑龙江"],
    ["河北","河北"],
    ["河南","河南"],
    ["山东","山东"],
    ["陕西","陕西"],
    ["甘肃","甘肃"],
    ["青海","青海"],
    ["新疆","新疆"],
    ["山西","山西"],
    ["四川","四川"],
    ["贵州","贵州"],
    ["安徽","安徽"],
    ["江西","江西"],
    ["云南","云南"],
    ["内蒙古","内蒙古"],
    ["广西","广西"],
    ["西藏","西藏"],
    ["宁夏","宁夏"],
    ["海南","海南"],
    ["香港","香港"],
    ["澳门","澳门"],
    ["台湾","台湾"]
];
 

