// ●廠牌陣列-----------------------------------------------------------------------------------------------------------
aryGMaker = new Array("請選擇","Opel","Buick","Cadillac");
             
// ●型號陣列         
aryGModel = new Array(4);

aryGModel[0] = new Array("請選擇");

// 	 "Opel"
aryGModel[1] = new Array("請選擇","Astra 1.9 CDTI","New Astra","Astra OPC","Corsa","Vectra","Zafira");
//   "Buick"
aryGModel[2] = new Array("請選擇","Excelle","Lacrosse","Rendezvous");
//   "Cadillac"
aryGModel[3] = new Array("請選擇","CTS","DTS","SRX","STS","STS-V");


function setGMaker(objLstGMaker,objLstGModel,strGMaker,strGModel)
{
	if ((strGMaker != "") && (strGModel != ""))
	{
		for (intCount = 0; intCount < aryGMaker.length; intCount++) 
		{
			if (objLstGMaker.options[intCount].value == strGMaker)
			{
				objLstGMaker.options[intCount].selected = true;
				var intLstGMakerIndex = intCount;
			}
		}
	
		changeGModel(objLstGMaker,objLstGModel);
		
		for (intCount = 0; intCount < aryGModel[intLstGMakerIndex].length; intCount++) 
		{
			if (objLstGModel.options[intCount].value == strGModel)
			{
				objLstGModel.options[intCount].selected = true;
			}
		}
	}
}

function initialGMaker(objLstGMaker)
{
	objLstGMaker.length = aryGMaker.length;
	for (intCount = 0; intCount < aryGMaker.length; intCount++) 
	{
		objLstGMaker.options[intCount].value = aryGMaker[intCount];
		objLstGMaker.options[intCount].text = aryGMaker[intCount];
	}
	objLstGMaker.selectedIndex = 0;
}

function initialGModel(objLstGMaker,objLstGModel)
{
	changeGModel(objLstGMaker,objLstGModel);
}


function changeGModel(objLstGMaker,objLstGModel)
{
	intLstGMakerIndex = objLstGMaker.selectedIndex;
	objLstGModel.length = aryGModel[intLstGMakerIndex].length;
	for (intCount = 0; intCount < aryGModel[intLstGMakerIndex].length; intCount++) 
	{
		objLstGModel.options[intCount].value = aryGModel[intLstGMakerIndex][intCount];
		objLstGModel.options[intCount].text = aryGModel[intLstGMakerIndex][intCount];
	}
	
	objLstGModel.selectedIndex = 0;
	
}

