﻿function openMenu(objName)
{
	if(document.all[objName].style.display=="none")
		{document.all[objName].style.display="block";}
	else
		{document.all[objName].style.display="none";}
		
}

function BrowserCheck() {
var b = navigator.appName;
if (b == "Netscape") this.b = "NS";
else if (b == "Microsoft Internet Explorer") this.b = "IE";
else this.b = b;
this.v = parseInt(navigator.appVersion);
this.NS = (this.b == "NS" && this.v>=4);
this.NS4 = (this.b == "NS" && this.v == 4);
this.NS5 = (this.b == "NS" && this.v == 5);
this.IE = (this.b == "IE" && this.v>=4);
this.IE4 = (navigator.userAgent.indexOf('MSIE 4')>0);
this.IE5 = (navigator.userAgent.indexOf('MSIE 5')>0);
if (this.IE5 || this.NS5) this.VER5 = true;
if (this.IE4 || this.NS4) this.VER4 = true;
this.OLD = (! this.VER5 && ! this.VER4) ? true : false;
this.min = (this.NS||this.IE);
}


function hideAlert(obj){

alertBox.visibility = "hidden";
document.all[obj].focus();
}

function makeAlert(aTitle,aMessage,objName){
document.all.alertLayer.innerHTML = "<table border=0 width=100% height=100%>" +
"<tr height=5><td colspan=4 class=alertTitle>" + " " + aTitle + "</td></tr>" +
"<tr height=5><td width=5></td></tr>" +
"<tr><td width=5></td><td width=20 align=left><img src='images/alert.gif'></td><td align=center class=alertMessage>" + aMessage + "<BR></td><td width=5></td></tr>" + 
"<tr height=5><td width=5></td></tr>" +
"<tr><td width=5></td><td colspan=2 align=center><input type=button value='OK' onClick=hideAlert('"+objName+"') class=okButton><BR></td><td width=5></td></tr>" +
"<tr height=5><td width=5></td></tr></table>";
thisText = aMessage.length;
if (aTitle.length > aMessage.length){ thisText = aTitle.length; }

aWidth = (thisText * 5) + 80;
aHeight = 100;
if (aWidth < 150){ aWidth = 200; }
if (aWidth > 350){ aWidth = 350; }
if (thisText > 60){ aHeight = 110; }
if (thisText > 120){ aHeight = 130; }
if (thisText > 180){ aHeight = 150; }
if (thisText > 240){ aHeight = 170; }
if (thisText > 300){ aHeight = 190; }
if (thisText > 360){ aHeight = 210; }
if (thisText > 420){ aHeight = 230; }
if (thisText > 490){ aHeight = 250; }
if (thisText > 550){ aHeight = 270; }
if (thisText > 610){ aHeight = 290; }

alertBox.width = aWidth;
alertBox.height = aHeight;
alertBox.left = (document.body.clientWidth - aWidth)/2;
alertBox.top = (document.body.clientHeight - aHeight)/2;

alertBox.visibility = "visible";
}


function homelistvalidate()
{
    var flag = "0";
    if(document.all.FirstName.value=="")
    {
        makeAlert('שם פרטי','אנה הכנס שם פרטי','FirstName');
        document.all.FirstName.focus();
        return false;
    }
    if(document.all.LastName.value=="")
    {
        makeAlert('שם משפחה','אנה הכנס שם משפחה','LastName');
        document.all.LastName.focus();
        return false;
    }
     if(document.all.EMail.value=="")
    {
        makeAlert('E-Mail','אנה הכנס כתובת דואר אלקטרוני','EMail');
        document.all.EMail.focus();
        return false;
    }
     if(document.all.Job.value=="")
    {
        makeAlert('תפקיד','אנה הכנס תפקיד אחרון','Job');
        document.all.Job.focus();
        return false;
    }
    if(document.all.CV.value=="")
    {
        makeAlert('קובץ קורות חיים','אנה טען קובץ קורות חיים','CV');
        document.all.CV.focus();
        return false;
    }
    if(flag=="0")
    document.form2.submit();
}

function openMap(num, height, width)
{   window.open ('showmap.aspx?map='+ num, 'map','height='+height+',width='+width+', toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no');
}

function doUpdate(result,context)
{
    document.getElementById("divOutput").innerHTML = result;
    sfHover();
    setSelectJob();
    hidedvLoading();
}

function firstClick(btnName)
{
document.getElementById(btnName).click();
}


function doSetJobStatus(result,context)
{
  alert(result);
    //sfHover();
}

function doNextJob(result,context)
{
    document.getElementById("divOutput").innerHTML = result;
}
function showdvLoading(){
  if (document.all&&document.readyState=="complete"){
    document.all.dvLoading.style.pixelLeft=450
    document.all.dvLoading.style.pixelTop=400
    document.all.dvLoading.style.visibility="visible";
}
  else if (document.layers){
    document.dvLoading.document.nstip.document.close()
    document.dvLoading.document.nstip.left=0
    currentscroll=setInterval("scrolltip()",100)
    document.dvLoading.left=e.pageX
    document.dvLoading.top=e.pageY
    document.dvLoading.visibility="visible"
}
}
function hidedvLoading(){
  if (document.all)
    document.all.dvLoading.style.visibility="hidden"
    else if (document.layers){
    clearInterval(currentscroll)
    document.dvLoading.visibility="hidden"
}
}