function check_form(){

  
  var f = document.contact;  
  var errortxt = "";

 
	if((f.name.value=="") || (f.name.value=="Name:"))
	  	{
	 	 alert("Please enter your name");
	  	f.name.focus();
	  	return false;
	  	}
		
		
		var st=f.email.value;

	if((f.email.value=="") || (f.email.value=="Email:"))
	{
		alert("Please enter your email");
		f.email.focus();
		f.email.select();
		return false;
	}	
	else
	{			
		if(checkEmail(st)!=true)
		{
			alert("Invalid E-Mail  \n"+st);
			f.email.focus();
			f.email.select();
			return false; 
		}
	}
	
	
	var stripped = f.phone.value.replace(/[\(\)\.\-\ ]/g, ''); 
	var illegalChars = /[\W_a-zA-Z]/;	
	if((f.phone.value== "" ) || (f.phone.value== "Phone:"))
	{
	alert("Please enter your Phone Number.");
	f.phone.focus();
	f.phone.select();
	return false;
	}
	

	
	
	
	
	if(f.checkcaptcha.value.replace(/ /g, '')=="")
	{
	alert("Please enter the captcha");
	f.checkcaptcha.focus();
	return false;
	}
	
	else
		document.contact.action = "quick_mail.php";


//return true;		
 function checkEmail(str)
{
	if((str.indexOf("@")==-1))
	{
		fstr="Please Enter @ or .";
		return false;
	}
	else
	{
		if((str.indexOf("@") == 0) )
		{
			fstr="@  Cannot Be first";
			alert(fstr);
			return false;
		}
	
		if((str.indexOf("@") == (str.length-1)))
		{
			fstr="@ Cannot Be Last";
			return false;
		}
	
		if((str.indexOf("@")+1) == str.indexOf("."))
		{
			fstr="@. IS Invalid Email";
			return false;
		}

	}

	var cp=0;					
	if(cp==2)
	{
		fstr="@ cannnot be repeated";
		return false;
	}
	return true;
}



}
function isNumberKey(evt)
{
  var charCode = (evt.which) ? evt.which : event.keyCode
   if (charCode == 46)
  	return charCode;
  if (((charCode >= 33) && (charCode <= 47)) || ((charCode >= 58) && (charCode<=255)))
  {
  		if(evt.which)
		{
			evt.preventDefault();
		}
		else
		{
			evt.returnValue=false;
		}
  }else
  {
		
		return charCode;
  }
  
}

function isNumber(v)
   {
       var i;
       if(v.length==0)
               return false;
       for(i=0;i<v.length;i++)
               if( !(v.charAt(i)>="0" && v.charAt(i)<="9"))
                       return false;
       return true;
   }

