// Test drive form index.aspx model selector shizz
function modelSelectorRolls(imgRef,doOver){
	var carList = new Array("car93ss","car93sw","car93c","car93x","car95s","car95e");
	if(doOver){
		for(var i=0;i<carList.length;i++){
			document.getElementById(carList[i]).src = carList[i]==imgRef ? offImgs[carList[i]].src : overImgs[carList[i]].src;
		}
	} else if(!sticky) {
		for(var i=0;i<carList.length;i++){
			document.getElementById(carList[i]).src = offImgs[carList[i]].src;
		}
	}
}

// Brochure form index.aspx model selector shizz
var sticky = false;
function modelSelectorRollsBro(imgRef,doOver){
	var carList = new Array("car93ss","car93sw","car93c","car93x","car95s","car95e");
	if(doOver){
		for(var i=0;i<carList.length;i++){
			document.getElementById(carList[i]).src = carList[i]==imgRef ? offImgs[carList[i]].src : overImgs[carList[i]].src;
			if(carList[i]==imgRef){
				document.getElementById("brochureSelect").brochureModel[i].checked = true;
			}
		}
	} else if(!sticky) {
		for(var i=0;i<carList.length;i++){
			document.getElementById(carList[i]).src = offImgs[carList[i]].src;
		}
	}
}

// Brochure Validation functions...
function checkBrochureSelect(f){
	var isValid = true;
	var validMessage = "Before proceeding...\n\n";
	// 1st lets check that a model has been selected...
	var unChecked = 0;
	for(var i=0;i<f.brochureModel.length;i++){
		unChecked = !f.brochureModel[i].checked ? unChecked+1 : unChecked;
	}
	if(unChecked == f.brochureModel.length){
		validMessage += "Please select the model which interests you.\n";
		isValid = false;
	}
	// 2nd lets check brochure type
	if(!f.brochureType[0].checked && !f.brochureType[1].checked){
		validMessage += "Please select how you would like to receive your brochures.";
		isValid = false;
	}
	if(!isValid){
		alert(validMessage);	
	}
	return isValid;
}



