﻿var where = new Array(5); 
function comefrom(loca,locacountry) { this.loca = loca; this.locacountry = locacountry; }
where[0]= new comefrom("请选择洲别","请选择国家");
where[1] = new comefrom("亚洲","请选择国家|阿富汗|阿联酋|孟加拉|巴林|文莱|印度尼西亚|以色列|印度|伊朗|约旦|日本|哈萨克斯坦|吉尔吉斯斯坦|柬埔寨|韩国|老挝|黎巴嫩|斯里兰卡|缅甸|蒙古|马来西亚|尼泊尔|巴布亚新几内亚|菲律宾|巴基斯坦|卡塔尔|新加坡|叙利亚|沙特阿拉伯|塔吉克斯坦|泰国|乌兹别克斯坦|越南"); 
where[2] = new comefrom("欧洲","请选择国家|阿尔巴尼亚|奥地利|比利时|保加利亚|白俄罗斯|瑞士|塞浦路斯|捷克|德国|丹麦|西班牙|芬兰|法国|英国|希腊|克罗地亚|匈牙利|爱尔兰共和国|意大利|立陶宛|卢森堡|马耳他|荷兰|挪威|波兰|葡萄牙|罗马尼亚|俄罗斯|斯洛文尼亚|瑞典|斯洛伐克|土耳其|乌克兰"); 

where[3] = new comefrom("美洲","请选择国家|加拿大|塞班|特立尼达和多巴哥|美国|阿根廷|玻利维亚|巴西|智利|哥伦比亚|古巴|厄瓜多尔|墨西哥|巴拿马|秘鲁|乌拉圭|委内瑞拉");

where[4] = new comefrom("非洲","请选择国家|安哥拉共和国|喀麦隆|阿尔及利亚|埃及|埃塞俄比亚|加纳|几内亚|肯尼亚|利比亚|摩洛哥|毛里塔尼亚|莫桑比克|纳米比亚|苏丹|塞拉利昂|突尼斯|坦桑尼亚|南非|津巴布韦|尼日利亚"); 

where[5] = new comefrom("大洋洲","请选择国家|澳大利亚|斐济|新西兰|汤加"); 

function select1(){
   with(document.creator.continent) { var loca2 = options[selectedIndex].value;  }
   for(i = 0;i < where.length;i ++) {
     if (where[i].loca == loca2) {
       loca3 = (where[i].locacountry).split("|");
       for(j = 0;j < loca3.length;j++) { with(document.creator.country) { length = loca3.length; options[j].text = loca3[j]; options[j].value = loca3[j];var
         loca4=options[selectedIndex].value;selectedIndex=0;}}
         break;
     }}
     //document.creator.newlocation.value=loca2+loca4;
 }
function select2() {
   with(document.creator.continent) { var loca2 = options[selectedIndex].value;  }
   for(i = 0;i < where.length;i ++) {
     if (where[i].loca == loca2) {
       loca3 = (where[i].locacountry).split("|");
       for(j = 0;j < loca3.length;j++) 
       { with(document.creator.country) { length = loca3.length; options[j].text = loca3[j]; options[j].value = loca3[j];var
         loca4=options[selectedIndex].value;
       }}

         break;
     }}
     xajax_getVisaSort(loca4);
}
function init_visa(area,country) {
   var index_area=0;
   var index_country=0;
   with(document.creator.continent) {
     length = where.length;

     for(k=0;k<where.length;k++) { 
       options[k].text = where[k].loca; 
       options[k].value = where[k].loca;
       if(area==where[k].loca)
            index_area=k;
     }
     selectedIndex=index_area;
     options[selectedIndex].text = where[index_area].loca; options[selectedIndex].value = where[index_area].loca;
   }
   with(document.creator.country) {
     loca3 = (where[index_area].locacountry).split("|");
     length = loca3.length;
     for(l=0;l<length;l++) {
       options[l].text = loca3[l]; options[l].value = loca3[l]; 
       if(country==loca3[l])
            index_country=l;
     }
     selectedIndex=index_country;
     options[selectedIndex].text = loca3[index_country]; options[selectedIndex].value = loca3[index_country];
   }
}
