function checkEmail(email) {if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)) return true;else return false;}$(document).ready(function(){$("#email_ml").hide();});
function submitMailing() {
	address = jQuery.trim($("#email_ml").val());
	email = jQuery.trim($("#address_ml").val());
	phone = jQuery.trim($("#phone_ml").val());
	name = jQuery.trim($("#name_ml").val());

	if(currLang==1) {
		if(name=='name ›') name='';
	}
	else {
	    if(name=='שם ›') name='';
	}
	if(currLang==1) {
		if(email=='email ›') email='';
	} else {
		if(email=='אימייל ›') email='';
	}
								if(!checkEmail(email)) {if(currLang==1)alert("Please enter a valid email address.");else alert("יש להזין כתובת דואר אלקטרוני תקינה.");$("#address").focus();return false;}
	$.post("/php/ajax.MailingList.php",{currLang: currLang,name: name,email: email,address: address,phone: phone},
	function(data) {			
			$("#mailingpop").fadeOut(function(){
				if(currLang==1)
					$("#mailingpop").html("<table border=0 width=100% style='margin:10px 0px;'><tr><td valign=center align=center>[ thanks ]</td></tr></table>");
				else
					$("#mailingpop").html("<table border=0 width=100% style='margin:10px 0px;'><tr><td valign=center align=center>[ תודה ]</td></tr></table>");

				var t=setTimeout('$("#mailingpop").fadeOut("slow",function(){$("#mailingbutton").fadeIn("slow");});',3000);
				$("#mailingpop").fadeIn();
			});
		});
}



