function validate()
{
	var msg = "";
	var err = 0;
	var email_pattern = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
	$(".required").each(function(){
		if ($.trim($(this).val()).length < 1)
		{
			$(this).css("border","1px solid red");
			msg += "\""+$(this).attr('title')+"\" field is required\n";
			err++;
		} else if ($(this).attr('title')=="Email" && $(this).attr("class","required")) {
			if (!$(this).val().match(email_pattern))
			{
				$(this).css("border","1px solid red");
				msg += "\"Email\" is invalid\n";
				err++;
				
			} else {
				$(this).css("border","1px solid #666");
			}
		} else {
			$(this).css("border","1px solid #666");
		}
	});
	if (err > 0)
	{
		alert(msg);
		
		return false;
	} else {
		return true;
	}
}