// JavaScript Document
function mailsent()
{
	//alert ("Hello");
	var objNotesRow = document.getElementById("notesrow");
	objNotesRow.style.display ='none';
	if(document.frmqst.txtname.value=="")
	{
		$("#contentArea").html("Please enter your name.");
		document.frmqst.txtname.focus();
		return(false);	
	}
	if (document.frmqst.txtemail.value == "")
  {
    	$("#contentArea").html("Please enter your e-mail address.");
    	document.frmqst.txtemail.focus();
    	return(false);
  }
  
if (document.frmqst.txtemail.value.indexOf("@")<1 ||
    document.frmqst.txtemail.value.indexOf(".")==-1 ||
    document.frmqst.txtemail.value.indexOf(",")!=-1 ||
    document.frmqst.txtemail.value.indexOf(" ")!=-1 ||
    document.frmqst.txtemail.value.length<6)
  {
	$("#contentArea").html("Enter like: name@domainname.com.");
    document.frmqst.txtemail.focus();
    return(false);
  }
  
if(document.frmqst.selcountry.value==1)
	{
		$("#contentArea").html("Please select country .");
		document.frmqst.selcountry.focus();
		return(false);	
	}
  
  
  
if(document.frmqst.txtqst.value=="")
	{
		$("#contentArea").html("Please enter your question .");
		document.frmqst.txtqst.focus();
		return(false);	
	}
if(document.frmqst.txtcode.value=="")
	{
		$("#contentArea").html("Please enter code .");
		document.frmqst.txtcode.focus();
		return(false);	
	}
	
	var myname=document.frmqst.txtname.value;
	var myemail=document.frmqst.txtemail.value;
	var myurl=document.frmqst.txturl.value;
	var mycntry=document.frmqst.selcountry.value;
	var myqst=document.frmqst.txtqst.value;
	var mycode=document.frmqst.txtcode.value;
	
	document.frmqst.action="sentmail.php?name="+myname+"&email="+myemail+"&url="+myurl+"&cntry="+mycntry+"&qst="+myqst+"&code="+mycode;
	document.frmqst.submit();
	
	
	//document.frmqst.txtname.value="";
//	document.frmqst.txtemail.value="";
//	document.frmqst.txturl.value="";
//	document.frmqst.txtqst.value="";
//	document.frmqst.code.value="";
	//$.ajax({
//	url :"sentmail.php?name="+myname+"&email="+myemail+"&url="+myurl+"&qst="+myqst+"&code="+mycode,
//	success : function (data) 
//	{
//		
//		$("#contentArea").html(data);
//		
//	}
	//});
//	document.frmqst.txtname.focus();
}

