	function nl_focused(){
		var nl_email=document.getElementById('nl_email').value;
		if(nl_email=='הכנס כתובת דואר אלקטרוני'){
			document.getElementById('nl_email').value='';
			document.getElementById('nl_email').style.color='000000';
			document.getElementById('nl_email').dir='ltr';
		}
	}
	function nl_blur(){
		var nl_email=document.getElementById('nl_email').value;
		if(nl_email.length==0){
			document.getElementById('nl_email').dir='rtl';
			document.getElementById('nl_email').style.color='919191';
			document.getElementById('nl_email').value='הכנס כתובת דואר אלקטרוני';
		}
	}
	function isValidEmail(str) {
		return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	}
	function check_nl_form(){
		var nl_email=document.getElementById('nl_email').value;
		var nl_uid=document.getElementById('uid').value;
		if(nl_email!='הכנס כתובת דואר אלקטרוני'){
			if(!isValidEmail(nl_email)){
				alert('כתובת דואר אלקטרוני לא תקינה!');
				return false;
			}else{
				ajax_join_nl(nl_uid,nl_email);
			}
		}else{
			alert('הכנס כתובת דואר אלקטרוני בבקשה!');
			document.getElementById('nl_email').focus();
			return false;
		}
	}
	
var xmlhttp=false;

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}


function ajax_join_nl(uid,email) {
	xmlhttp.open("POST", '/ajax_newsletter.php?op=add&uid='+uid+'&email='+email, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			document.getElementById('newsletter_div').innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
	return false;
}
