function checkEmailValidation(that)
{
	if (that.value)
	{
		if (that.value.match(/^(?:(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))$/))
			return true;
		else
		{
			alert('כתובת דואר אלקטרוני לא חוקית, אנא הזן/י כתובת דואר חוקית');
			that.value='';
			that.style.backgroundColor='red';
			tempThat=that;
			that.focus();
			setTimeout('tempThat.style.backgroundColor="";',3000);
			return false;
		}
	}
}
function lightErr(that)
{
	that.style.backgroundColor='red';
	that.focus();
	tempThat=that;
	setTimeout('tempThat.style.backgroundColor="";',3000);
}
function registerToNewsletter()
{
	if (!document.forms[0].RightNewsLertterFullName.value)
	{
		alert('אנא הזן שם מלא');
		lightErr(document.forms[0].RightNewsLertterFullName);
		return;
	}
	if (!document.forms[0].RightNewsLertterEMail.value)
	{
		alert('אנא הזן כתובת דואר אלקטרוני');
		lightErr(document.forms[0].RightNewsLertterEMail);
		return;
	}
	if ((!document.forms[0].RightNewsLetterYouClient[0].checked) && (!document.forms[0].RightNewsLetterYouClient[1].checked))
	{
		alert('אנא בחר האם את/ה לקוח You');
		return;
	}
	
	if (checkEmailValidation(document.forms[0].RightNewsLertterEMail))
	{
		document.forms[0].target='NewsLetterFrame';
		document.forms[0].action='xregister_to_newsletter.php';
		document.forms[0].submit();
		document.forms[0].target='';
	}
}
function newslettersaved()
{
	document.getElementById('NewsLetterRegister').innerHTML='<table cellpadding="0" cellspacing="0" class="AlignCenter" width="100%"><tr><td class="AlignCenter"><h2 class="GeneralPage"><br />הרשמתך התקבלה בהצלחה,<br />תודה רבה!<br /><br /><br /></h2></td></tr></table>';
	document.getElementById('registerToNewsLetterButton').style.display='none';
}
function checkRightIsFriend()
{
	if (document.forms[0].RightNewsLetterYouClient[0].checked)
		document.getElementById('NewsLetterIsFriend').style.display='';
	else
		document.getElementById('NewsLetterIsFriend').style.display='none';
}
