// JavaScript Document
function Valid()
{
  var tName=document.frmQuery.txtName.value;
  var tEmail=document.frmQuery.txtEmail.value;
  var tMsg=document.frmQuery.txtMsg.value;
  if (tName == "" || tName.length == 0)
  {
     alert("Please Enter your Name");
	 document.frmQuery.txtName.focus();
	 return false;
  }
 if (tEmail == "" || !ValidateEmail(tEmail))
  {
     alert("Please Enter your valid Email ID");
	 document.frmQuery.txtEmail.focus();
	 return false;
  }
  if (tMsg == "" || tMsg.length == 0)
  {
     alert("Please Enter your Message");
	 document.frmQuery.txtMsg.focus();
	 return false;
  }
}

function ValidateEmail( Email )
{
		var atCharPresent = false;
		var dotPresent = false;
		for ( var Idx = 0; Idx < Email.length; Idx++ )
		{
			if ( Email.charAt ( Idx ) == '@' )
				atCharPresent = true;
			if ( Email.charAt ( Idx ) == '.' )
				dotPresent = true;
		}
		if ( !atCharPresent || !dotPresent )
			return false;

	return true;
}