function formvalidation(thisform)
{
	with (thisform)
	{
		if (name.value==name.defaultValue)name.value=""; 
		if(emptyvalidation(name,"Please fill in your Name")==false) 
			{
			name.focus();
			return false;
			}
		if (email.value==email.defaultValue)email.value=""; 
		if(emptyvalidation(email,"Please fill in your Email Address")==false) 
			{
			email.focus();
			return false;
			}
		/*if(emailvalidation(email,"Sorry, you have entered an invalid Email Address")==false)
		{
			email.select();
			email.focus();
			return false;
		}*/
		
		
		if(emailvalidation1(email)==false)
			{
				//alert("Woops! You forgot to enter a valid Email Address");
				alert("Sorry, you have entered an invalid Email Address.");
				email.select();
				email.focus();
				return false;
			}
		
		if(phone.value==phone.defaultValue)phone.value=""; 
		if(emptyvalidation(phone,"Please fill in your Phone Number")==false) 
		{
			phone.focus();
			return false;
		}
		
		
		/*var numericExpression = /^[0-9]+$/;
   if(!phone.value.match(numericExpression)){
 
       

    // window.alert("Woops! You forgot to enter valid Phone Number");
	
	window.alert("Woops! You have entered an invalid Phone Number");

           phone.focus();
           return false;
         }*/
		
		
		
		
		
		
		
		if(emptyvalidation(inq,"Please fill in your Inquiry")==false) 
		{
			inq.focus();
			return false;
		}	
		
		if(inq.value=="inquiry")
		{
			window.alert("Please fill in your Inquiry");
			inq.focus();
			return false;
			
		}
		
		
			/*if(emptyvalidation(inq,"Woops! You forgot to fill in your Inquiry")==false) 
		{
			inq.focus();
			return false;
		}	*/
		/*if(province.value==province.defaultValue)province.value=""; 
		if(emptyvalidation(province,"Woops! You forgot to fill in your Province/State")==false) 
			{
			province.focus();
			return false;
			}*/
		
		
	//}
	
	
	/*if (thisform.customerType.value=='') 
		{
			alert("Please Select Customer Type");
			thisform.customerType.focus();
			return false;
		}*/
	/*if(thisform.comment.value=='Comments' || thisform.comment.value=='' ) 
	{	
		if(thisform.formsubmit.value=="N")
		{
		var agree=confirm("Continue without any Comments?");
				if(agree)
					{
						
							if(thisform.formsubmit.value=="Y")
								{
								alert("Please Wait While the form is getting submitted");
								return false;
								}
								else
								{
									thisform.formsubmit.value="Y";
									thisform.submit();
								}
					}
					else
					{
						thisform.comment.focus();
						return false;
					}		
		}
		
	}
	
	if(thisform.formsubmit.value=="Y")
	{
		
		document.getElementById("button2").style.display='none';
		alert("Please Wait While the Form is Getting Submitted");
		return false;
	}*/
	/*else
	{*/
		
		//thisform.formsubmit.value="Y";
		//document.getElementById("button2").style.display='none';
		thisform.submit();
	}
}

function emailvalidation1(thisform) {

   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = thisform.value;
   var email = address.split(',');
   
   for (var i = 0; i < email.length; i++) {
   if(reg.test(email[i]) == false) {
    
      return false;
   }
   else
   {
   // alert('Valid Email Address');
   //return true;
   }
   }
}
