// JavaScript Document
<!--
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;
}

function YY_checkform() { 

 if(document.contact.firstname.value==""){
	 alert("First name is mandatory");
	 document.contact.firstname.focus();
	 return false;
 }
 if(document.contact.lastname.value==""){
	 alert("Last name is mandatory");
		 document.contact.lastname.focus();
	 return false;
 }
 if(document.contact.rank.value==""){
	 alert("Rank is mandatory");
	 document.contact.rank.focus();
	 return false;
 }

 if(document.contact.email.value==""){
	 alert("Email address is mandatory");
	 document.contact.email.focus();
	 return false;
 }

  if(document.contact.country.value=="Please select.."){
	 alert("Area of duty station is mandatory");
	 return false;
 }

  if(document.contact.dutyarea.value==""){
	 alert("Country of duty station is mandatory");
	 return false;
 }
 
}

function getRadioValue(RadioName)
{
	var colRadio = document.getElementsByName(RadioName);
	for (var i = 0; i < colRadio.length; i++){
		if (colRadio[i].checked){
			return colRadio[i].value;
		}
	}
	return null;
}

function brochure_order() { 

 if(document.contact.name.value==""){
	 alert("Name is mandatory");
	 document.contact.name.focus();
	 return false;
 }

 if(document.contact.email.value==""){
	 alert("Email address is mandatory");
	 document.contact.email.focus();
	 return false;
 }

  if(document.contact.location.value==""){
	 alert("Please select your Location");
	 document.contact.location.focus();
	 return false;
 }
 
 if (document.contact["vehicle[]"].value == ""){
	alert("Please select at least one vehicle model");
	return false;
}
 if(document.contact.location.value=="Other" && document.contact.location2.value == ""){
	 alert("Please tell us your location (Other)");
	 document.contact.location2.focus();
	 return false;
 }
 
 if(document.contact.heard_from.value==""){
	 alert("Where did you hear about us?");
	 document.contact.heard_from.focus();
	 return false;
 }
 
 if(document.contact.heard_from.value=="Other" && document.contact.heard_from_other.value == ""){
	 alert("Please tell us where you heard about us (Other)");
	 document.contact.heard_from_other.focus();
	 return false;
 }
 
 if(getRadioValue('delivery')=='Other' && document.contact.delivery_other.value==""){
	 alert("Please tell us where you would expect to take delivery");
	 document.contact.delivery_other.focus();
	 return false;
 }

  if(document.contact.contact_number.value==""){
	 alert("Please provide your contact number");
	 document.contact.contact_number.focus();
	 return false;
 }

}
//-->

