// ●城市陣列-----------------------------------------------------------------------------------------------------------
arySCity = new Array("請選擇","台北市","台北縣","桃園","新竹","台中/彰化","台南","高雄");
arySCityCode = new Array("請選擇","1","7","4","5","2","6","3");
             
// ●區域名稱陣列         
arySZone = new Array(8);
// 	 "請選擇"
arySZone[0] = new Array("請選擇")
//   "台北市"
arySZone[1] = new Array("全　部","中正區","大同區","中山區","松山區","大安區","萬華區","信義區","士林區","北投區","內湖區",
                        "南港區","文山區");
//   "台北縣"
arySZone[2] = new Array("全　部","板橋市","汐止市","新店市","永和市","中和市","土城市","樹林市","鶯歌鎮","三重市","新莊市","泰山鄉",
												"林口鄉","蘆洲市","五股鄉","淡水鎮");

//   "桃園"
arySZone[3] = new Array("全　部","桃園市","桃園縣龜山鄉","桃園縣八德市","桃園縣蘆竹鄉");

//   "新竹"
arySZone[4] = new Array("全　部","新竹市","新竹縣竹北市","新竹縣寶山鄉","新竹縣竹東鎮");

//   "台中"
arySZone[5] = new Array("全　部","台中市中區","台中市東區","台中市南區","台中市西區","台中市北區","台中市北屯區",
                        "台中市西屯區","台中市南屯區","台中縣太平市","台中縣大里市","台中縣烏日鄉",
                        "台中縣潭子鄉","台中縣大雅鄉","台中縣龍井鄉","彰化縣彰化市");

//   "台南"
arySZone[6] = new Array("全　部","台南市中區","台南市東區","台南市南區","台南市西區","台南市北區","台南市安平區",
												"台南市安南區","台南縣永康市","台南縣歸仁鄉","台南縣仁德鄉");

//   "高雄"
arySZone[7] = new Array("全　部","高雄市新興區","高雄市前金區","高雄市苓雅區","高雄市鹽埕區","高雄市鼓山區",
											  "高雄市前鎮區","高雄市三民區","高雄市小港區","高雄市左營區","高雄縣仁武鄉",
											  "高雄縣鳳山市","高雄縣鳥松鄉");


// ●區域號碼陣列
arySZipCode = new Array(8);
// 	 "請選擇"
arySZipCode[0] = new Array("")
//   "台北市"
arySZipCode[1] = new Array("","100","103","104","105","106","108","110","111","112","114",
                          "115","116");

//   "台北縣"
arySZipCode[2] = new Array("","220","221","231","234","235","236","238","239","241","242","243","244",
													 "247","248","251");
//   "桃園"
arySZipCode[3] = new Array("","330","333","334","338");
//   "新竹"
arySZipCode[4] = new Array("","300","302","308","310");
//   "台中"
arySZipCode[5] = new Array("","400","401","402","403","404","406","407","408","411","412","414",
													 "427","428","434","500");
//   "台南"
arySZipCode[6] = new Array("","700","701","702","703","704","708","709","710","711","717");
                          
//   "高雄"
arySZipCode[7] = new Array("","800","801","802","803","804","806","807","812","813","814","830",
													 "833");

function setSCity(objLstCity,objLstZone,strCity,strZone)
{
	//if ((strCity != "") && (strZone != ""))
	if (strCity != "")
	{
		for (intCount = 0; intCount < arySCity.length; intCount++) 
		{
			if (objLstCity.options[intCount].value == strCity)
			{
				objLstCity.options[intCount].selected = true;
				var intLstCityIndex = intCount;
			}
		}
	
		changeSZone(objLstCity,objLstZone);
		
		for (intCount = 0; intCount < arySZone[intLstCityIndex].length; intCount++) 
		{
			if (objLstZone.options[intCount].value == strZone)
			{
				objLstZone.options[intCount].selected = true;
			}
		}
	}
}

function initialSCity(objLstCity)
{
	objLstCity.length = arySCity.length;
	for (intCount = 0; intCount < arySCity.length; intCount++) 
	{
		objLstCity.options[intCount].value = arySCityCode[intCount];
		objLstCity.options[intCount].text = arySCity[intCount];
	}
	objLstCity.selectedIndex = 0;
}

function initialSZone(objLstCity,objLstZone)
{
	changeSZone(objLstCity,objLstZone);
}


function changeSZone(objLstCity,objLstZone)
{
	intLstCityIndex = objLstCity.selectedIndex;
	objLstZone.length = arySZone[intLstCityIndex].length;
	for (intCount = 0; intCount < arySZone[intLstCityIndex].length; intCount++) 
	{
		objLstZone.options[intCount].value = arySZipCode[intLstCityIndex][intCount];
		objLstZone.options[intCount].text = arySZone[intLstCityIndex][intCount];
	}
	
	objLstZone.selectedIndex = 0;
	
}

