function validation(thisform)
{
	with (thisform)
	{	
			if (emptyvalidation(fname,"Woops! You forgot to fill in your Name")==false) 
			{
				fname.focus();
				return false;
			}
			if (emptyvalidation(customer_id,"Woops! You forgot to fill in your Customer ID")==false) 
			{
				customer_id.focus();
				return false;
			}				
			if (emptyvalidation(email,"Woops! You forgot to fill in your Email Address")==false) 
			{
				email.focus();
				return false;
			}
			if(emailvalidate(thisform)==false)
			{
				alert("Woops! You have entered an invalid Email Address");
				email.select();
				email.focus();
				return false;
			}
			
	}
	thisform.submit();
	document.getElementById("load_button").innerHTML='<img  src="images/loading.gif" alt=""width="120" height="15" />';
	return true;
}


function emptyvalidation(entered, alertbox)
{
		
	with (entered)
	{
		while (value.charAt(0) == ' ')
			value = value.substring(1);
		while (value.charAt(value.length - 1) == ' ')
			value = value.substring(0, value.length - 1);
		if (value==null || value=="")
		{
			if (alertbox!="") alert(alertbox);
			return false;
		}
		else return true;
	}
}
  function emailvalidate(thisform) 
 {
	
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = thisform.email.value;
   if(reg.test(address) == false)
   {
      //alert('Invalid Email Address');
      return false;
   }
  }
