
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "香港", "香港", "");
addOption(document.drop_list.Category, "深圳", "深圳", "");
addOption(document.drop_list.Category, "上海", "上海", "");
addOption(document.drop_list.Category, "北京", "北京", "");
addOption(document.drop_list.Category, "廣州", "廣州", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "選擇服務", "");

if(document.drop_list.Category.value == '香港'){
addOption(document.drop_list.SubCat,"contact_hkaudit.html", "審計和其他認證服務");
addOption(document.drop_list.SubCat,"contact_hkchina.html", "商務諮詢 - 中國");
addOption(document.drop_list.SubCat,"contact_hkitaly.html", "商務諮詢 - 意大利");
addOption(document.drop_list.SubCat,"contact_hkjapan.html", "商務諮詢 - 日本");
addOption(document.drop_list.SubCat,"contact_hklatin.html", "商務諮詢 - 拉丁美洲及西班牙");
addOption(document.drop_list.SubCat,"contact_hkfinance.html", "商務諮詢 - 企業融資");
addOption(document.drop_list.SubCat,"contact_hkim.html", "商務諮詢 - 移民顧問");
addOption(document.drop_list.SubCat,"contact_hkrisk.html", "商業諮詢 - 風險管理");
addOption(document.drop_list.SubCat,"contact_hkbpo.html", "業務流程外包");
addOption(document.drop_list.SubCat,"contact_hkcos.html", "公司秘書");
addOption(document.drop_list.SubCat,"contact_hktax.html", "稅務服務")

;
}
if(document.drop_list.Category.value == '深圳'){
addOption(document.drop_list.SubCat,"contact_szaudit.html", "審計和其他認證服務");
addOption(document.drop_list.SubCat,"contact_szchina.html", "中國商務諮詢");
addOption(document.drop_list.SubCat,"contact_szim.html", "商務諮詢 - 移民顧問");
addOption(document.drop_list.SubCat,"contact_szbpo.html", "業務流程外包", "");
addOption(document.drop_list.SubCat,"contact_szcos.html", "公司秘書");


;
}
if(document.drop_list.Category.value == '上海'){
addOption(document.drop_list.SubCat,"contact_shchina.html", "中國商務諮詢");

addOption(document.drop_list.SubCat,"contact_shim.html", "商務諮詢 - 移民顧問");

;
}
if(document.drop_list.Category.value == '北京'){
addOption(document.drop_list.SubCat,"contact_bjchina.html", "中國商務諮詢");

;
}
if(document.drop_list.Category.value == '廣州'){
addOption(document.drop_list.SubCat,"contact_gzchina.html", "中國商務諮詢");


}
if(document.drop_list.Category.value == 'Scripts'){
addOption(document.drop_list.SubCat,"PHP", "PHP");
addOption(document.drop_list.SubCat,"ASP", "ASP");
addOption(document.drop_list.SubCat,"Perl", "Perl");
}

}
////////////////// 

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}


function Redirect()
{
	var dropdownIndex = document.getElementById("SubCat").selectedIndex;
	var dropdownValue = document.getElementById("SubCat")[dropdownIndex].value;
	window.location = (dropdownValue);
}
