function Trim(myval)
{return myval.split(" ").join("");}
function validateEmail(fld)
{var my=fld.value;var attherate=my.indexOf("@");var lastattherate=my.lastIndexOf("@")
var dotpos=my.lastIndexOf(".");var posspace=my.indexOf(" ");var totallen=my.length;if(attherate<=0||dotpos<=0||attherate>dotpos||(dotpos-attherate)<=1||(dotpos==totallen-1)||posspace>-1||attherate!=lastattherate)
return false;else
return true;}
function chkval(frm)
{if(frm.Message.value=="")
{alert("Message can not be blank.");frm.Message.focus();return false;}
if(frm.Email.value=="")
{alert("Email can not be blank.");frm.Email.focus();return false;}
if(!validateEmail(frm.Email))
{alert("Invalid Email.");frm.Email.focus();return false;}}
