var quoteArray=[];
function p(){quoteArray.push(arguments[0])}
function el(id){return document.getElementById(id)}
function checkprice(){
	var strOutput;
	
	var QuoteCode=el("lstVehicle").value;
	var QuoteYear=el("lstYear").value;
	var QuoteCC=el("lstEngineSize").value;
	var obj=el("txtPrice");
	obj.options.length=0;
	for(var i=0;i<quoteArray.length;i++){
		/*item	0 - QuoteCode
				1 - QuoteCC
				2 - 10 years and under
				3 - Price
				4 - Product
		*/
		if((quoteArray[i][0]=="X" && QuoteCode=="X") || ( (quoteArray[i][0]==QuoteCode) && (quoteArray[i][1]==QuoteCC) ) ){
			//if((quoteArray[i][2]==1 && QuoteYear>=(new Date().getFullYear()-10)) || (quoteArray[i][2]==0)){
				if(flagPhoneScriptMode){
					strOutput="£"+quoteArray[i][2]+" - "+quoteArray[i][3];
				}
				else{
					if(quoteArray[i][2]<250)
						strOutput="£"+(quoteArray[i][2]-10)+" - "+quoteArray[i][3];
					else
						strOutput="£"+(quoteArray[i][2]-20)+" - "+quoteArray[i][3];
				}
				try{obj.add(new Option(strOutput),null)}
				catch(err){obj.add(new Option(strOutput))}
			//}
		}
	}
	//return false;
}
addEvent(window,'load',function(){
	var obj;
	obj=el("x");if(obj)obj.onclick=checkprice;

	obj=el("lstVehicle");if(obj){obj.onkeypress=checkprice;obj.onchange=checkprice;obj.onclick=checkprice;obj.focus();obj.onclick()}
	obj=el("lstYear");if(obj){obj.onkeypress=checkprice;obj.onchange=checkprice;obj.onclick=checkprice;}
	obj=el("lstEngineSize");if(obj){obj.onkeypress=checkprice;obj.onchange=checkprice;obj.onclick=checkprice;}

	obj=el('submitlink');if(obj){
		obj.onclick=function(){document.frmDetails.onsubmit();document.frmDetails.submit();return false}
		obj.style.display='block';
	}
	obj=el('submitbutton');if(obj)obj.style.display='none';

	document.frmDetails.onsubmit=function(){
		var obj1=el("txtVehicleName");
		var obj2=el("lstVehicle");
		obj1.value=obj2.options[obj2.selectedIndex].text;
	}
});