﻿function doContactSubmit(){
	fName=document.formContact.fnm.value;
	if (fName=="")
	 	{ msg="נא למלא שם פרטי ";
		  alert(msg);
		  document.formContact.fnm.focus();
		  return;}
	lName=document.formContact.lnm.value;
	if (lName=="")
	 	{ msg="נא למלא שם משפחה ";
		  alert(msg);
		  document.formContact.lnm.focus();
		  return;}
	Email=document.formContact.eml.value;
	if ((Email=='דוא"ל')||(Email==''))
	 	{ msg= "נא למלא דוא''ל";
		  alert(msg);
		  document.formContact.eml.focus();
		  return;}
	
	if ((Email.indexOf("@")<2) || (Email.lastIndexOf(".")<=(Email.indexOf("@")+2) || ((Email.length<8)) || (Email.charAt(0) == "-" || Email.charAt(0) == "_" || Email.charAt(0) == "@" || Email.charAt(0) == "-" || Email.charAt(0) == "_" || Email.charAt(0) == "."))) 
	  	{ msg= "נא למלא דוא''ל תקין";
		  alert(msg);
		  document.formContact.eml.select();
		  return;} 
	imgFileName=document.formContact.rezume_name.value;
	if (imgFileName!="")
			{ str = new String(imgFileName);			
			a = str.length;
			b = str.lastIndexOf(".")+1;
			c = (str.slice(b,a)); 
			c = c.toLowerCase();
			if ((c!="doc")&&(c!="pdf")&&(c!="txt")&&(c!="ppt")&&(c!="gif")&&(c!="jpg")&&(c!="jpeg")) 
			{msg= "נא להעלות\nקובץ בפורמטים\npdf או word\nאו txt או ppt\nאו gif או jpg";
				alert(msg);
				document.formContact.rezume_name.select();
				return;}
			}
	comments=document.formContact.comments.value;
	if (comments=="")
	 	{ msg="נא למלא את תאור הפנייה ";
		  alert(msg);
		  document.formContact.comments.focus();
		  return;} 
	document.formContact.submit();
	document.formContact.reset();
	//ClearContactForm();
}

function doSearchSubmit(){
	text1=document.formSearch.text1.value;	
	if (text1=='')
	 	{ msg= "נא למלא את תיבת החיפוש";
		  alert(msg);
		  document.formSearch.text1.select();
		  return;}
	document.formSearch.submit();
}

function isTel(e){	
	var strCheck = '0123456789-';
	var whichCode = (window.Event) ? e.which : e.keyCode;	
	if (whichCode != 0){
		if (whichCode == 13) return true;
		key = String.fromCharCode(whichCode);
		if (strCheck.indexOf(key) >-1 ) return  true;
		else return false;
	}
}

function isMail(e){	
	var strCheck = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.@';
	var whichCode = (window.Event) ? e.which : e.keyCode;		
	if (whichCode != 0){
		if (whichCode == 13) return true;
		key = String.fromCharCode(whichCode);
		if (strCheck.indexOf(key) == -1 ) return false;
		else return true;
	}
}
function isNmbr(e){	
	var strCheck = '0123456789';
	var whichCode = (window.Event) ? e.which : e.keyCode;	
	if (whichCode != 0){
		if (whichCode == 13) return true;
		key = String.fromCharCode(whichCode);
		if (strCheck.indexOf(key) >-1 ) return  true;
		else return false;
	}
}

function newWindow(winWidth,winHeight,imgName){
  myWindow=window.open(imgName,'mama','scrollbars=no,width='+winWidth+',height ='+winHeight+',left='+(screen.width/2-winWidth/2)+',top='+(screen.height/2-winHeight/2)+'');
  myWindow.focus();
}
function showhideNextLevel(prm,prm1)
	{var bAct;
	 if (document.getElementById("ul"+prm+"").style.display == 'none')
		bAct = 'block';
	 else if (document.getElementById("ul"+prm+"").style.display == 'block')
		bAct = 'none';
	if (!(isNaN(Number(tempPrm))))
		{if ((document.getElementById("ul"+tempPrm+""))&&((prm1!=tempPrm)||(prm1==0)))
			document.getElementById("ul"+tempPrm+"").style.display = 'none';
		 if ((tempPrm!=tempPrm1)&&(document.getElementById("ul"+tempPrm+""))&&(prm1!=tempPrm))//||(prm1==0)))
			document.getElementById("a"+tempPrm+"").className = '';}		
	 
	 var ul1 = document.getElementById("ul"+prm+"");
	 var iLength = ul1.childNodes.length;
	 for(i=0;i < iLength;i++)
      {var jLength = ul1.childNodes[i].childNodes.length;
      for(j=0;j < jLength;j++)
		{var str='';
		str = new String(ul1.childNodes[i].childNodes[j].id);
		if(str.slice(0,2)=="ul")//&&()
           ul1.childNodes[i].childNodes[j].style.display='none';}
       }
     document.getElementById("ul"+prm+"").style.display = bAct; 
     if (document.getElementById("a"+prm+""))
		document.getElementById("a"+prm+"").className = 'on';
     tempPrm = prm;
   }
function getPage(prm)
	{XMLHTTPConnectGetPage(prm);}
function decreaseFlash()
{ document.getElementById("divFooter").style.marginTop = "0";}

function increaseFlash()
{ document.getElementById("divFooter").style.marginTop = "-188";}
