
function isblank(s)
{
    for(var i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
    }
    return true;
}
function isValidEmail(e)
{
	var alnum="a-zA-Z0-9";
	exp="^[^@\\s]+@(["+alnum+"+\\-]+\\.)+["+alnum+"]["+alnum+"]["+alnum+"]?$";
	emailregexp = new RegExp(exp);

	result = e.match(emailregexp);
	if (result != null)
	{
		return true;
	}
	else
	{
		return false;
	}
}


function Validate()
{
	if (isblank(document.getElementById("txt_name").value))
	{
		alert("Enter Name!");
		document.getElementById("txt_name").focus();
		return false;
	}
	else if (!isValidEmail(document.getElementById("txt_mail").value))
	{
		alert("Enter Valid Email ID!");
		document.getElementById("txt_mail").focus();
		return false;
	}
	else if (isblank(document.getElementById("txt_query").value))
	{
		alert("Enter your Query!");
		document.getElementById("txt_query").focus();
		return false;
	}
	else
	{
		return true;
	}
}

