function validSubmit()
{
	var frm = document.frmContact;
	
	if(frm.name.value == '' || frm.name.value == 'Your Name')
	{
		alert("Enter name");
		return;
	}
	if(frm.email.value == '' || frm.email.value == 'Your Email ID')
	{
		alert("Enter email");
		return;
	}

	if(EmailValidation(frm.email)==0)
	{
		return;
	}

	if(frm.phone.value == '' || frm.phone.value == 'Your Phone Number')
	{
		alert("Enter Phone Number");
		return;
	}
	else
	{
		if(isNaN(frm.phone.value) == true)
		{
			alert("Enter Valid Phone Number");
			return;
		}
	}

	if(frm.comments.value == '' || frm.comments.value =='Your Comments / Questions ?')
	{
		alert("Enter Commets");
		return;
	}

	frm.action = "contactus.php";
	frm.submit();
}


	function EmailValidation(Element)
	{
		Flag  = 1;
		count = 0;
		iflag = 1;
			
		var alp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_@.-";
		
		if(Element.value.length > 0)
		{
			for (var i=0; i<Element.value.length; i++)
			{
				temp = Element.value.substring(i, i+1);
	
				if (alp.indexOf(temp) == -1)
				{
					Flag = 0;
				}
			} // closing the for loop
		}
		else
		{
			Flag = 0;
			iflag=0
		}
	
		for(var i=0; i <= Element.value.length; i++)
		{
			if(Element.value.charAt(0)=='@')
			{
				Flag = 0;
				break;
			}

			if(Element.value.charAt(Element.value.length-1)=='@')
			{
				Flag = 0;
				break;
			}

			if(Element.value.charAt(i)=='@') 
			{
				count = count + 1;

				if(count>1)
				{
					Flag = 0;
					break;
				}
			  
				if((Element.value.charAt(i-1)=='.') || (Element.value.charAt(i+1)=='.'))
				{
					Flag = 0;
					break;
				}
			}
			if(Element.value.indexOf('@')==-1)
			{
				Flag = 0;		    	
				break;
			}
			if(Element.value.charAt(0)=='.')
			{
				Flag = 0;
				break;
			}
			if(Element.value.indexOf('.')==-1)
			{
				Flag = 0;		    	
				break;
			}
		  } //closing the for loop
		
		if(Element.value.charAt(Element.value.length-1) == '.')
			Flag = 0;
		
		if(iflag != 1)
		 return 1;
					
		if(Flag != 1)
		{
			alert("Please enter Valid Email");
			Element.focus();
			return 0;
		}	
		else
			return 1; 
	}
	
	// JavaScript Document