// Model-Navigation 
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// Model-Navigation 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

// Model-Navigation 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
// Model-Navigation 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// FUNCTION JUMPS TO THE COMMITED PAGE
function jump(pageName){
	document.forms[0].action=pageName;
	document.forms[0].submit();
}
		
// FUNCTION SETS THE STEP (PAGE) NUMBER AND JUMPS TO THE COMMITET PAGE
function setStepValue(step, pageName){
	document.forms[0].elements.stepNumber.value=step;
	jump(pageName);
}
// FUNCTION SETS THE TRIM ID VALUE AND JUMPS TO THE COMMITET PAGE
function setTrimId(id, pageName){
	document.forms[0].elements.trimId.value=id;
	document.forms[0].elements.versionId.value=0;
	document.forms[0].elements.stepNumber.value=1;
	jump(pageName);
}
// FUNCTION SETS THE VERSION ID VALUE AND JUMPS TO THE COMMITET PAGE
function setVersionId(id, pageName){
	document.forms[0].elements.versionId.value=id;
	document.forms[0].elements.stepNumber.value=2;
	jump(pageName);
}
// FUNCTION COMMITET TO THE COLOR PAGE THE EXTERIOR COLOR ID VALUE
function setExteriorColor(colorId){
	document.forms[0].elements.extColourId.value=colorId;
	jump('colourPage.htm');
}
		
// FUNCTION COMMITET TO THE COLOR PAGE THE INTERIOR COLOR ID VALUE
function setInteriorColor(colorId){
	document.forms[0].elements.intColourId.value=colorId;
	jump('colourPage.htm');
}
// FUNCTION COMMITET TO THE WHEEL PAGE THE WHEEL ID VALUE
function setWheel(rimId){
	document.forms[0].elements.wheelId.value=rimId;
	jump('wheelOptionPage.htm');
}
		
function setOption(number){
//	document.forms[0].elements.optionList.value=optId;
//	alert("Check option #" + (number-1) + ": " + document.forms[0].elements.optionList[number-1]);
//	document.forms[0].elements.optionList[number-1].checked = !document.forms[0].elements.optionList[number-1].checked;
  	jump('wheelOptionPage.htm');
}
// FUNCTION COMMITET TO THE COLOR PAGE THE POINT OF VIEW(b, f, s) VALUE
function setViewPoint(point){
	document.forms[0].elements.view.value=point;
	jump('colourPage.htm');
}

// FUNCTION SETS THE ID' VALUE OF THE CONFLICTET FEATURE PROPERTY AND JUMPS TO THE COMMITET PAGE
function setConflict(id){
	document.mainForm.fpToRemove.value=id;
	document.mainForm.submit();
}
// FUNCTIONAND SETS THE COUNTRY AND MODEL ID VALUES AND JUMPS TO THE COMMITET PAGE
function flush(pageName, countryId, modelId){
	document.forms[0].elements.countryId.value=countryId;
	document.forms[0].elements.modelId.value=modelId;
	jump(pageName);
}


function viewFormInfo(){
//			alert('form method: ' + document.forms[0].method + '\n form action: ' + document.forms[0].action);
}


function MM_openBrWindow(theURL,winName,features) {
   window.open(theURL,winName,features);
}