// ●型號陣列         
aryModel = new Array();

//   "請選擇"
aryModel[0] = new Array("請選擇");

//   "Buick"
aryModel[1] = new Array("請選擇","Excelle","Lacrosse","Rendezvous","Park Avenue","Regal","Skylark");

//   "Cadillac"
aryModel[2] = new Array("請選擇","CTS","DTS","SRX","STS","STS-V","DHS");

// 	 "Opel"
aryModel[3] = new Array("請選擇","Astra 1.9 CDTI","New Astra","Astra OPC","Corsa","Vectra","Zafira","Tigra","Omega");

// ●預購型號陣列         
aryModelPre = new Array();

//   "請選擇"
aryModelPre[0] = new Array("請選擇");

//   "Buick"
aryModelPre[1] = new Array("請選擇","Excelle","Lacrosse","Rendezvous");

//   "Cadillac"
aryModelPre[2] = new Array("請選擇","CTS","DTS","SRX","STS","STS-V");

// 	 "Opel"
aryModelPre[3] = new Array("請選擇","Astra 1.9 CDTI","New Astra","Astra OPC","Corsa","Vectra","Zafira");

function changeModel(objLstMaker,objLstModel,intLstMakerIndex)
{
	if ( intLstMakerIndex == 'Buick' ) { intLstMakerIndex = 1; }
		else if ( intLstMakerIndex == 'Cadillac' ) { intLstMakerIndex = 2; }
		else if ( intLstMakerIndex == 'Opel') { intLstMakerIndex = 3; }
	if(intLstMakerIndex == 1 || intLstMakerIndex == 2 || intLstMakerIndex == 3) {
		objLstModel.length = aryModel[intLstMakerIndex].length;
		for (intCount = 0; intCount < aryModel[intLstMakerIndex].length; intCount++) 
		{
			objLstModel.options[intCount].value = aryModel[intLstMakerIndex][intCount];
			objLstModel.options[intCount].text = aryModel[intLstMakerIndex][intCount];
		}
		objLstModel.selectedIndex = 0;
		DisplayData('CarSpec', 'inline');
	}else{
		objLstModel.options.length = 0;
		DisplayData('CarSpec', 'none');
	}
}

function changeModelPre(objLstMaker,objLstModel,intLstMakerIndex)
{
	if ( intLstMakerIndex == 'Buick' ) { intLstMakerIndex = 1; }
		else if ( intLstMakerIndex == 'Cadillac' ) { intLstMakerIndex = 2; }
		else if ( intLstMakerIndex == 'Opel') { intLstMakerIndex = 3; }
	if(intLstMakerIndex == 1 || intLstMakerIndex == 2 || intLstMakerIndex == 3) {
		objLstModel.length = aryModelPre[intLstMakerIndex].length;
		for (intCount = 0; intCount < aryModelPre[intLstMakerIndex].length; intCount++) 
		{
			objLstModel.options[intCount].value = aryModelPre[intLstMakerIndex][intCount];
			objLstModel.options[intCount].text = aryModelPre[intLstMakerIndex][intCount];
		}
		objLstModel.selectedIndex = 0;
		DisplayData('CarSpec_Pre', 'inline');
	}else{
		objLstModel.options.length = 0;
		DisplayData('CarSpec_Pre', 'none');
	}
}

function setMaker(objLstMaker,objLstModel,strModel)
{
	var intLstMakerIndex = 0;
	if ( objLstMaker.value == 'Buick' ) { intLstMakerIndex = 1; }
		else if ( objLstMaker.value == 'Cadillac' ) { intLstMakerIndex = 2; }
		else if ( objLstMaker.value == 'Opel') { intLstMakerIndex = 3; }
	
	if ( intLstMakerIndex == 1 || intLstMakerIndex == 2 || intLstMakerIndex == 3 ) {
		for (intCount = 0; intCount < objLstModel.length; intCount++) 
		{
			if (objLstModel.options[intCount].value == strModel)
			{
				objLstModel.options[intCount].selected = true;
			}
		}
	}
}