<!-- hide script from old browsers

// Order form validation
function checkrequired(which) 
{

	if (document.contact.firstName.value == '') 
	{
		alert("Please enter your first name!");
		document.contact.firstName.focus()
		return false;
	}
	if (document.contact.lastName.value == '') 
	{
		alert("Please enter your last name!");
		document.contact.lastName.focus()
		return false;
	}
	
//	if (document.contact.question.value == '') 
//	{
//		alert("Please type your entry in 25 words or less!");
//		document.contact.question.focus()
//		return false;
//	}

//  if(document.contact.question.value.split(' ').length >25)
//  {
//  	alert("Your entry must be less than 25 words");
//      document.contact.question.focus()
//  	return false;
//  }
	
 if (document.contact.phone.value == '') 
  {
  	alert("Please enter your phone number");
  	document.contact.phone.focus()
  	return false;
  }
    
	if (document.contact.useremail.value == '') 
	{
		alert("Please enter your email!");
		document.contact.useremail.focus()
		return false;
	}
	
	if (numcheck(document.contact.phone.value)==false){
		document.contact.phone.focus()
		return false
	}
	
	if (echeck(document.contact.useremail.value)==false){
			document.contact.useremail.focus()
			return false
	}
	
	if (document.contact.state.value == '') 
	{
		alert("Please select your state!");
		document.contact.state.focus()
		return false;
	}
	
	else
	return true;
}

function numcheck(str) {
	    //  check for valid numeric strings	
    var strValidChars = "0123456789.-";
    var strChar;
    var strCharPh;
    var blnResult = true;
   
	for (i = 0; i < str.length && blnResult == true; i++)
      {
	//alert("checking postcode");
	strChar = str.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
		 alert("Phone should be numerical!");	
         blnResult = false;
		 return false;
         }
      }	
}


function echeck(str) {
	
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("The email address you have entered is not valid\n Please enter a vaild email")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("The email address you have entered is not valid\n Please enter a vaild email")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("The email address you have entered is not valid\n Please enter a vaild email")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("The email address you have entered is not valid\n Please enter a vaild email")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("The email address you have entered is not valid\n Please enter a vaild email")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("The email address you have entered is not valid\n Please enter a vaild email")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("The email address you have entered is not valid\n Please enter a vaild email")
		    return false
		 }

 		 return true					
	}
	

//finish hiding
-->