//\func.js
function moran()
{
	var atop,aleft;
	atop=window.screen.height/2-170;
	aleft=window.screen.width/2-120;
	var x=window.open("..\main\tahi.html","","width=240px, height=340px, top=" + atop + ", left=" + aleft  + ", resizable=no, status=no, location=no, toolbar=no, menubar=no, scrollbars=no ");
}//moran

function ofer()
{
	var atop,aleft;
	atop=window.screen.height/2-150;
	aleft=window.screen.width/2-100;
	var x=window.open("..\main\ofer.html","","width=200px, height=300px, top=" + atop + ", left=" + aleft  + ", resizable=no, status=no, location=no, toolbar=no, menubar=no, scrollbars=no ");
}//ofer

function ofer2()
{
	window.close();
	var x=window.open("http://www.acm-ltd.cc","","top=0, left=0, resizable=yes, status=no, location=no, toolbar=yes, menubar=yes, scrollbars=yes ");
}//ofer

function notyet()
{
        alert("לא מעודכן");
        return false;
}//notyet

function notyet2()
{
        alert("!!! בקרוב");
        return false;
}//notyet

function keren()
{
	var atop,aleft;
	atop=window.screen.height/2-150;
	aleft=window.screen.width/2-100;
	var x=window.open("..\main\keren1.html","","width=200px, height=300px, top=" + atop + ", left=" + aleft  + ", resizable=no, status=no, location=no, toolbar=no, menubar=no, scrollbars=no ");
}//keren

function noam()
{
	document.all.noam.style.visibility='hidden';
	
}//noam
function noam2()
{
	document.all.noam.style.visibility='visible';
}//noam2

function seker()
{
	var atop,aleft;
	atop=100;
	aleft=100;
	var x=window.open("..\main\seker.asp","","width=300px, height=400px, top=" + atop + ", left=" + aleft  + ", resizable=no, status=no, location=no, toolbar=no, menubar=no, scrollbars=no ");
}//seker
//----------------------------------------  getSearch     ---------------------------------------------//
function getSearch()
{
	
	if(document.myform.sItem.value == "" )
	{
		alert("Please Choose a Word or Frase to Search for");
		document.myform.sItem.select();
		return(false);
	}//empty-search filed
	else
	{
			return(true);
	}//else
}//getSearch

function israel()
{
	var atop,aleft;
	atop=window.screen.height/2-170;
	aleft=window.screen.width/2-120;
	var x=window.open("..\main\israel.html","","width=240px, height=380px, top=" + atop + ", left=" + aleft  + ", resizable=no, status=no, location=no, toolbar=no, menubar=no, scrollbars=no ");
}//israel

//---------------------------------------------------------------------------------------------------------------------------------------------------//

//Default browsercheck, added to all scripts!
function checkBrowser()
{
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()
/***************************************************************************************
Variables to set:
***************************************************************************************/
messages=new Array()
//Write your descriptions in here.
messages[10]=" זכויות דורשי העבודה בישראל<BR>באדיבות מוקד זכויות מובטלים"
messages[9]=" מה לא לעשות בעת חיפוש עבודה"
messages[8]="מדור חדש באתר"
messages[7]='עמותת חמישים פלוס מינוס<br>"בעלי שיער הכסף שווים זהב"'
messages[6]="מכתבים למנהל/ת כח האדם"
messages[5]="מוקד זכויות מובטלים מיסודה של עמותת מחויבות לשלום וצדק חברתי "
messages[4]="המי והמה שמסביב לאתר"
messages[3]="חברות כח אדם, השמה ומיון, לוחות משרות"
messages[2]="טפסים, הסברים, סטטיסטיקות, קישורים ישירים למידע "
messages[1]="קהילת המובטלים מדברת בפורום אבטלה ב - נענע<!--img src='..\nana_small.gif' alt='nana.co.il'-->"
messages[0]= "להעביר את הזמן במובטל"
//To have more descriptions just add to the array.

fromX=-110 //How much from the actual mouse X should the description box appear?
fromY=15////How much from the actual mouse Y should the description box appear?

//To set the font size, font type, border color or remove the border or whatever,
//change the clDescription class in the stylesheet.

//Makes crossbrowser object.
function makeObj(obj)
{	
   	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?document.layers[obj]:0;	
   	this.wref=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj].document:0;		
	this.writeIt=b_writeIt;																
	return this
}

function b_writeIt(text)
{
	if(bw.ns4)
	{
		this.wref.write(text);this.wref.close()	
	}
	else this.wref.innerHTML=text
	}

//Capturing mousemove
var descx,descy;
function popmousemove(e)
{
	descx=bw.ns4?e.pageX:event.x; descy=bw.ns4?e.pageY:event.y
}
//Initiates page
var isLoaded;

function popupInit()
{
    oDesc=new makeObj('divDescription')
    if(bw.ns4)document.captureEvents(Event.MOUSEMOVE)
    document.onmousemove=popmousemove;
    isLoaded=true;
}	

//Shows the messages
function popup(num){
    if(isLoaded){
	oDesc.writeIt('<span class="clDescription" dir=rtl>'+messages[num]+'</span>')
	if(bw.ie5) descy=descy+document.body.scrollTop
	oDesc.css.left=descx+fromX; oDesc.css.top=descy+fromY
	oDesc.css.visibility='visible'
	{
	}
    }
}

//Hides it
function popout(num){
	if(isLoaded) oDesc.css.visibility='hidden'
}

//initiates page on pageload.
onload=popupInit;

function openW()
{
	var atop,aleft;
	atop=window.screen.height/2-200;
	aleft=window.screen.width/2-200;
	var x=window.open("help.asp","","width=500px, height=400px, top=" + atop + ", left=" + aleft  + ", resizable=no, status=no, location=no, toolbar=no, menubar=no, scrollbars=no ");
}//openW

function openW2()
{
	var atop,aleft;
	atop=window.screen.height/2-200;
	aleft=window.screen.width/2-200;
	var x=window.open("help.asp","","width=500px, height=400px, top=" + atop + ", left=" + aleft  + ", resizable=no, status=no, location=no, toolbar=no, menubar=no, scrollbars=no ");
}//openW2
//function goto()
//{
//	document.form1.mainnews.select();
//}
function showmenu(elmnt)
{
	document.all(elmnt).style.visibility="visible"
}//showmenu
function hidemenu(elmnt)
{
	document.all(elmnt).style.visibility="hidden"
}//hidemenu

/*----------------------------------------- RESUME JAVA SCRIPT------------------------------------------*/

function CollectDataCotert()
{
if(document.PerResData.CountCot[0].value==1)
return;
x=eval(window.event.srcElement.id)-1;
document.PerResData.AllData[x].value=document.PerResData.AllData[x].value + document.PerResData.DataDate[x].value + "#" + PerResData.DataDat[x].value + "|" ;
document.PerResData.DataDate[x].value =" ";
PerResData.DataDat[x].value =" ";
}

function CollectDataCotert2()
{
if(document.PerResData.CountCot[0].value==1)
return;
var x;
for (x=0;x<=document.PerResData.AllData.length-1;x++)
	{
	
		if (document.PerResData.AllData[x].value == "")
			document.PerResData.AllData[x].value=document.PerResData.AllData[x].value + document.PerResData.DataDate[x].value + "#" + PerResData.DataDat[x].value + "|" ;						


	}
}

function Checktext()
{
var temp="document.PerResData."+window.event.srcElement.id
temp=eval(temp);
if (window.event.srcElement.name=="טלפון:")
{
	var r=isNum(temp.value) 	
	if (r!=temp.value.length)
	{	
		alert("תו לא חוקי לטלפון");
		temp.value=temp.value.substring(0,r)
		return;

	}

}

for(i=0;i<temp.value.length ;i++)
{
if (temp.value.charAt(i) == ";" ||  temp.value.charAt(i) == "&" || temp.value.charAt(i) == "?" || temp.value.charAt(i) == "=")
{
	alert( temp.value.charAt(i) + " - תו לא חוקי ");
    temp.value=temp.value.substring(0,i)
    temp.focus();     
}}
}


function isNum(passedVal)
{
var x=true;
for (i=0; i<passedVal.length; i++) {
		if (passedVal.charAt(i) < "0" && passedVal.charAt(i)!="-" && passedVal.charAt(i)!=",") 	   
		{
			return i 
		}	
		if (passedVal.charAt(i) > "9" && passedVal.charAt(i)!="-" ) 
		{
			return i 
		}
	}

return i;	
}

function validEmail(email) {
	invalidChars = " /:,;"			
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) > -1) {
			return false;
		}
	}
	atPos = email.indexOf("@",1)
	if (atPos == -1) {
		return false;
	}
	if (email.indexOf("@",atPos+1) != -1) {
		return false;
	}
	periodPos = email.indexOf(".",atPos)
	if (periodPos == -1) {
		return false;
	}
	if (periodPos+3 > email.length)	{
		return false;
	}
	for (i=0; i<email.length; i++) {
		if (email.charAt(i) >="א" && email.charAt(i)<="ת" )  {
			return false;
		}
	}
	return true;
}


function CheckData()
{
if(cont==0)
return;
for(i=1;i<eval(document.PerResData.CountPer.value);i++)
{
   var temp ="document.PerResData.PerF" + i;
   temp=eval(temp);              
if (temp.name=="דואר אלקטרוני:" && temp.value!="")
{
	
	var check= validEmail(temp.value)
		if (check==false)
		{
			alert("כתובת דואר אלקטרוני לא חוקית");
			temp.focus();
			return false;
		}	
}}		
CollectDataCotert2()
return true
}

function checktextD(temp) 
{
for(i=0;i<temp.length ;i++)
{
if (temp.charAt(i) == ";" ||  temp.charAt(i) == "&" || temp.charAt(i) == "?" || temp.charAt(i) == "=" || temp.charAt(i) == "|")
{
	alert( temp.charAt(i) + " - תו לא חוקי ");
    temp=temp.substring(0,i)    
}}
return temp;
}