// JavaScript Document

<!--

function otherformsCheck(formobj){
	//1) Enter name of mandatory fields
	var fieldRequired = Array("name", "email");
	//2) Enter field description to appear in the dialog box
	var fieldDescription = Array("Name ", "Email");
	//3) Enter dialog message
	var alertMsg = "Please complete the following required fields:\n";
	
	var alertMsgconfirm = "Thank you for your feedback." + '\n\n' + "If you want to make any changes click on 'Cancel' to return to the page" + '\n' + "or click 'OK' to send.\n\n\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == "" || obj.options[obj.selectedIndex].text == "Please Select" || obj.options[obj.selectedIndex].text == "Not required for Personal Contracts"){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				else 
				if (obj.selectedIndex != -1 || obj.options[obj.selectedIndex].text != "" || obj.options[obj.selectedIndex].text != "Please Select" || obj.options[obj.selectedIndex].text != "Not required for Personal Contracts"){
					alertMsgconfirm += " # " + fieldDescription[i] + " - " + obj.options[obj.selectedIndex].text + "\n\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		//alert(alertMsgconfirm);
		return confirm(alertMsgconfirm);
		//return true;
	}else{
		alert(alertMsg);
		return false;
		
	}
}
function verify(){
	formCheck(formobj)
       //we get the values in the form out of the 0 index in the forms[] array since it's the only form in the document
       msg = "Please Verify the Information you Entered: \n\n Lease Term: " + document.forms[0].term.value + "\n Annual Mileage: " + document.forms[0].mileage.value + "\n\n If this information is correct, click 'OK'"
       return confirm(msg);
}

//-->

