navinfo = navigator.userAgent.split(' ');
var ie7 =  navinfo[3]=='7.0;' ? true : false;
if(ie7){
document.write('<link rel="StyleSheet" href="/_media/css/ifIe7.css" type="text/css">');
}

function changeStatus(id){
	var obj = document.getElementById(id);
	
	if(obj.style.display=="none"){
		obj.style.display="";
	}else{
		obj.style.display="none";
	}
}

function validForm(){
	if(document.contactForm.firstName.value==""){
		alert("יש למלא שם פרטי.");
		document.contactForm.firstName.focus();
	}else if(document.contactForm.lastName.value==""){
		alert("יש למלא שם משפחה.");
		document.contactForm.lastName.focus();
	}else if(document.contactForm.phone.value==""){
		alert("יש להכניס מספר טלפון.");
		document.contactForm.phone.focus();
	}
	else if(!IsEmail(document.contactForm.email.value)){
		alert("יש למלא כתובת אימייל תקנית");
		document.contactForm.email.focus();
	}else{
		document.contactForm.submit();
	}
}


function IsEmail(sText) {
	var at="@";
	var dot=".";
	var lat=sText.indexOf(at)
	var lstr=sText.length
	var ldot=sText.indexOf(dot)
	if (sText=="" || sText==null){ return false }
	if (sText.indexOf(at)==-1 || sText.indexOf(at)==0 || sText.indexOf(at)==lstr){ return false }
	if (sText.indexOf(dot)==-1 || sText.indexOf(dot)==0 || sText.indexOf(dot)==lstr){ return false }
	if (sText.indexOf(at,(lat+1))!=-1){ return false }
	if (sText.substring(lat-1,lat)==dot || sText.substring(lat+1,lat+2)==dot){ return false }
	if (sText.indexOf(dot,(lat+2))==-1){ return false }
	if (sText.indexOf(" ")!=-1){ return false }
 	return true					
}

function changeClass(element,newClass){
	element.className = "linkBox " + newClass;
}

