function SearchFor(){
  objForm = document.forms[0]
  objForm.submit()
}



    function toggleMouseOver(id){
	  document.getElementById('tab1').className='tab_off';
	  document.getElementById('tab2').className='tab_off';
   	  document.getElementById('tab3').className='tab_off';
	  //document.getElementById('tab4').className='tab_off';
	  document.getElementById('tab'+id).className='tab_on';
    }


    function toggleMouseOut(id){
	  document.getElementById('tab1').className='tab_off';
	  document.getElementById('tab2').className='tab_off';
   	  document.getElementById('tab3').className='tab_off';
	  //document.getElementById('tab4').className='tab_off';
    }


	function toggleDiv(id){
	  document.getElementById('tab1').className='tab_off';
	  document.getElementById('tab2').className='tab_off';
   	  document.getElementById('tab3').className='tab_off';
	  //document.getElementById('tab4').className='tab_off';

		document.getElementById('div1').style.display='none';
		document.getElementById('div2').style.display='none';
		document.getElementById('div3').style.display='none';
		//document.getElementById('div4').style.display='none';
		
		document.getElementById('div'+id).style.display='block';
	}



function PrintFlash(src,w,h){
  var str = ""
  str+="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+w+"' height='"+h+"' id='mov_contact' align='middle'>"
  str+="<param name='allowScriptAccess' value='sameDomain' />"
  str+="<param name='movie' value='"+src+"' />"
  str+="<param name='menu' value='false' />"
  str+="<param name='quality' value='best' />"
  str+="<param name='bgcolor' value='#FFFFFF' />"
  str+="<embed src='"+src+"' menu='false' quality='best' bgcolor='#FFFFFF' width='"+w+"' height='"+h+"' name='mov_contact' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"
  str+="</object>"
  
  document.write(str);
}


function GetBodyText(id){
  if (document.all(id).style.display == 'none') 
     document.all(id).style.display = 'inline';
  else 
     document.all(id).style.display = 'none';
}

 function PopWinInfo(id){
  var winW = 550
  var winH = 400
  var winl = (screen.width - winW) / 2;
  var wint = (screen.height - winH) / 2;
  WPOPUP = window.open("wininfo.asp?id="+id,"Terms","toolbar=0,top="+wint+",left="+winl+",location=0,resizable=0,directories=0,status=0,scrollbars=0,menubar=0,resizable=0,width="+winW+",height="+winH);
  WPOPUP.focus();
}



var LastRowBGColor;
var LastRowTxtColor;

function doColor(id,TheRow){
 if (document.all('Msg'+id).style.display == 'none'){
  LastRowBGColor  = TheRow.style.backgroundColor;
  LastRowTxtColor = TheRow.style.color;
  TheRow.style.backgroundColor = '#A8D6FF';
 // TheRow.style.color='#58595B';
 }
}

function undoColor(id,TheRow){
 if (document.all('Msg'+id).style.display == 'none'){
  TheRow.style.backgroundColor = LastRowBGColor;
  TheRow.style.color=LastRowTxtColor;
 } 
}



function CheckMsg(){
 var Autor=document.FMsg.AutorName
 var Msubj=document.FMsg.MsgSubject
 
  if (document.FMsg.AutorName.value == "") {
	 alert("נא ציין שם מלא");
	 Autor.focus();
	 return false;
  }
  if (Msubj.value == "") {
	 alert("נא ציין את נושא התגובה");
	 Msubj.focus();
	 return false;
  }
  return (true);
}	 





		
		
function CheckPublishForm(){
  objForm = document.forms[0];
  if (objForm.name.value == "") {
		alert("נא ציין שם מלא");
		objForm.name.focus();
		return false;
  }
  if (!validPhone(objForm.phone.value)){
		alert("נא ציין מספר טלפון או סלולרי");
		objForm.phone.focus();
		return false;
  }
  if (!validEmail(objForm.mail.value)){
		alert("נא ציין כתובת מייל");
		objForm.mail.focus();
		return false;
  }
  return true
}


 


function CheckContactForm(){
  objForm = document.forms[0];
  if (objForm.fname.value == "") {
		alert("נא ציין שם פרטי");
		objForm.fname.focus();
		return false;
  }
  if (objForm.lname.value == "") {
		alert("נא ציין שם משפחה");
		objForm.lname.focus();
		return false;
  }
  if (!validPhone(objForm.mobile.value)){
		alert("נא ציין מספר טלפון");
		objForm.mobile.focus();
		return false;
  }
  if (!validEmail(objForm.mail.value)){
		alert("נא ציין כתובת מייל");
		objForm.mail.focus();
		return false;
  }
  return true
}




function validPhone(PhoneNum)
{
 var num="-0123456789"
 if (PhoneNum.length < 9)
  return false;

  
 for (var i=0; i < PhoneNum.length ; i++)
 {
  temp=PhoneNum.substring(i,i+1)
   if(num.indexOf(temp)==-1)
   return false
 }	
 
   return true
}




function validEmail(email) {
invalidChars = " /:,;"
if (email == "") 
{						// cannot be empty
	return false
}

for (i=0; i<invalidChars.length; i++) {	// does it contain any invalid characters?
				badChar = invalidChars.charAt(i)
				if (email.indexOf(badChar,0) > -1) {
					return false
				}
			}
			atPos = email.indexOf("@",1)			// there must be one "@" symbol
			if (atPos == -1) {
				return false
			}
			if (email.indexOf("@",atPos+1) != -1) {	// and only one "@" symbol
				return false
			}
			periodPos = email.indexOf(".",atPos)
			if (periodPos == -1) {					// and at least one "." after the "@"
				return false
			}
			if (periodPos+3 > email.length)	{		// must be at least 2 characters after the "."
				return false
			}
			return true
		}
		
		

function ConfirmRead(){
 window.returnValue = true;
 window.close();
}



