$(document).ready(function() {
	$("#newsletterForm").find('input[@type=text]').each(function (i) {
    var standardText = $(this).attr("value");
		$(this).focus(function() {
			if($(this).attr("value") == standardText)
		  	$(this).attr("value", "");
		});
		$(this).blur( function () {
			if($(this).attr("value") == null || $(this).attr("value") == '')
				$(this).attr("value", standardText);	 
		});
  });
	$('#newsletterForm').submit(function() {
		if(!isValidEmail($("input[@name=email]").attr("value"))) {
			alert($("#emailError").attr("title"));
			return false;
		}
		return true;
	});

});

function isValidEmail(str) {
	if(str)
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  return false;
}