// JavaScript Document
function ValidateSubmitEmail(){
		var ValError = 0;
		$('.errorTxt').html('');
		if(jQuery.trim($('#idcheck').val()) != 9 ){
			$('#Erridcheck').show();
			$('#Erridcheck').html('&nbsp;Enter the total of 2+7');
			$('#idcheck').focus();
			ValError++;				
		}else{
			$('#Erridcheck').hide();
		}
		if(jQuery.trim($('#txtEmail').val()) == "" || $('#txtEmail').val()=='E-Mail Address'){
			$('#ErrtxtEmailID').show();
			$('#ErrtxtEmailID').html('Enter email Address');
			$('#txtEmail').focus();
			ValError++;
		}else if(!IsValidEmail(jQuery.trim($('#txtEmail').val()))){
			$('#ErrtxtEmailID').show();
			$('#ErrtxtEmailID').html('&nbsp;Enter valid email address');
			$('#txtEmail').focus();
			ValError++;
		}else{
			$('#ErrtxtEmailID').hide();
		}
		if(jQuery.trim($('#txtFullName').val()) == "" || $('#txtFullName').val()=='Enter your full name'){
			$('#ErrtxtNamelID').show();
			$('#ErrtxtNamelID').html('&nbsp;Enter your name');
			$('#txtFullName').focus();
			ValError++;				
		}else{
			$('#ErrtxtNamelID').hide();
		}
		
		
		//alert(ValError);
		//alert('hi');
		if(ValError > 0){
			return false
		}else{
			PostData ="EmailID="+$('#txtEmail').val()+"&Name="+$('#txtFullName').val()+"&Phone="+$('#txtPhone').val()+"&Msg="+$('#txtmessage').val()+"&check="+$('#idcheck').val()+"&Zip="+$('#idZip').val();
			//alert(PostData);
			$.ajax({
				   type: "POST",
				   url: "http://tutortutor.org/send_mail.php",
				   data: PostData,
				   success: function(msg){
						//alert(msg);
						if(msg==1){
							alert("Enquiry Submitted Successfully.");
						}else if(msg==2){
							alert("Your calculation is wrong");
						}else{
							alert("Server is busy. Try after some time.");
						}
						/*Hide wait image*/
				}
			});	
		}
		/*Show wait image*/
		
		
		
}
/*Function for Forgot password form validation Ends*/

function IsValidEmail(strValue)
{
	//var objRegExp  =/(^[a-z0-9]([a-z0-9_\.]*)@([a-z0-9_\-\.]*)([.][a-z]{3})$)|(^[a-z0-9]([a-z0-9_\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3})(\.[a-z]{2})*$)/i;
	var objRegExp  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return objRegExp.test(strValue);
}


$().ready(function() {
		$("#txtFullName").click(function() {if($(this).val() == "Enter your full name"){$(this).val("");}});
		$("#txtEmail").click(function() {if($(this).val() == "E-Mail Address"){$(this).val("");}});
		$("#txtPhone").click(function() {if($(this).val() == "Phone Number"){$(this).val("");}});
		$("#txtmessage").click(function() {if($(this).val() == "Enter Your Message Content here..."){$(this).val("");}});
		$("#txtNameID").click(function() {if($(this).val() == "Your name..."){$(this).val("");}});
		$("#txtEmailID").click(function() {if($(this).val() == "Your email address..."){$(this).val("");}});
		
		
		$("#txtFullName").blur(function() {if($(this).val() == ""){$(this).val("Enter your full name");}});
		$("#txtEmail").blur(function() {if($(this).val() == ""){$(this).val("E-Mail Address");}});
		$("#txtPhone").blur(function() {if($(this).val() == ""){$(this).val("Phone Number");}});
		$("#txtmessage").blur(function() {if($(this).val() == ""){$(this).val("Enter Your Message Content here...");}});
		$("#txtNameID").blur(function() {if($(this).val() == ""){$(this).val("Your name...");}});
		$("#txtEmailID").blur(function() {if($(this).val() == ""){$(this).val("Your email address...");}});		
		
 });


