function Trim(str) 
{
	return str.replace(/\s/g,"");
}
function IsBlank(obj, msgstr)
{
	if(Trim(obj.value)=="")
		{
			alert(msgstr);
			obj.focus();
			return false;
		}
	return true;
}
function IsEmail(obj, string, varmessage) 
{
	if(string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
	return true;
	else
	{
		alert(varmessage);
		obj.focus();
		return false;
	}
}
function valid() {
if (!IsBlank(document.form1.name,"Please enter your Name")) return false;
if (!IsEmail(document.form1.email, document.form1.email.value,"Please enter valid Email")) return false;
if (!IsBlank(document.form1.comments,"Please Insert Description")) return false;
return true;
}

