// JavaScript Document
function loadFlashOrNot()
{
	//eraseCookie('flashSeen')
	if(readCookie('flashSeen')==null)
	{
		document.location.href='default_new.asp';
	}
}

function sendToNewsletter()
{
	//userName = document.getElementById("NL_username").value
	userEmail = document.getElementById("NL_useremail").value
	document.getElementById("newsLetterIF").src = "/ShlExternalSubmits/Publicators.aspx?user_email="+userEmail
	document.getElementById("newsLetterBox").innerHTML = "פנייתך נשלחה בהצלחה.";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

if(!document.all)
{
	document.write("<style>")
	document.write(".joinUs	{width:337px;}")
	document.write("</style>")

}
else
{
	document.write("<style>")
	document.write(".joinUs	{width:361px;}")
	document.write("</style>")
}

function CheckContactForm()
{
	var check = true
	if (document.ContactForm.firstName.value=="")
	{
		alert("אנא רשום שם פרטי")
		document.ContactForm.firstName.focus();
		check = false;
		return false;
	}
	if (document.ContactForm.lastName.value=="")
	{
		alert("אנא רשום שם משפחה")
		document.ContactForm.lastName.focus();
		check = false;
		return false;
	}
	if (document.ContactForm.email.value != "")
	{
		var testresults
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
				
			if (filter.test(document.ContactForm.email.value))
			{
			
			}
			else
			{
			check = false;
			alert("פרטי האמייל אינם חוקיים")
			document.ContactForm.email.focus();
			return false;
			}
	}
	if (document.ContactForm.phone.value=="")
	{
		alert("רשום את מספר הטלפון שלך")
		document.ContactForm.phone.focus();
		check = false; 
		return false;
	}
	
	if (check==true)
	{
		document.ContactForm.submit();
	}	
}

function ChangeRightTab(TabID)
{
	for(i = 1; i < 5; i++)
    {
	  document.getElementById("RightTab"  + i).src="HebSite/images/homepage/"+i+".gif";
	  document.getElementById("LeftTab"  + i).style.display="none";
    }
	document.getElementById("RightTab"  + TabID).src="HebSite/images/homepage/"+TabID+"_SELECTED.gif";
	document.getElementById("LeftTab"  + TabID).style.display="";
}

























