function isValidEmail(str) {
return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}
function CheckData()
{
with(document.mailform)
{
if(txtName.value == "")
{
alert("Please enter your name.");
txtName.focus();
return false;
}

if(txtEmail.value == "")
{
alert("Please enter your email address.");
txtEmail.focus();
txtEmail.value="";
return false;
}
if (!isValidEmail(txtEmail.value)) 
{
alert("Please enter a valid email address");
txtEmail.focus();
txtEmail.value="";
return false;
}


if(txtComments.value == "")
{
alert("Please enter Message/Query.");
txtComments.focus();
return false;
}
}
return true;
}















function isValidEmail(str) {
return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}
function CheckData1()
{
with(document.frm)
{
if(txtName.value == "")
{
alert("Please enter your name.");
txtName.focus();
return false;
}

if(txtEmail.value == "")
{
alert("Please enter your email address.");
txtEmail.focus();
txtEmail.value="";
return false;
}
if (!isValidEmail(txtEmail.value)) 
{
alert("Please enter a valid email address");
txtEmail.focus();
txtEmail.value="";
return false;
}


if(txtComments.value == "")
{
alert("Please enter Message/Query.");
txtComments.focus();
return false;
}
}
return true;
}
