<!-- 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.company.value == '') 
//	{
//		alert("Please enter your company name!");
//		document.contact.company.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 (document.contact.suburb.value == '') 
// 	{
// 		alert("Please enter your suburb name!");
// 		document.contact.suburb.focus()
// 		return false;
// 	}

	  	if (document.contact.postcode.value.length !=4) 
 	{
 		alert("Postcode must be 4 numbers!");
 		document.contact.postcode.focus()
 		return false;
 	}	
	
//  	if (document.contact.state.value == '') 
// 	{
// 		alert("Please enter your state name!");
// 		document.contact.state.focus()
// 		return false;
// 	}

	if (numcheck(document.contact.postcode.value)==false){
			document.contact.postcode.focus()
			return false
	}
	
	if (echeck(document.contact.useremail.value)==false){
			document.contact.useremail.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("Postcode 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
-->