var oBndRct;
var CurrProfileExpierd;
var CurrentScreen;

function EGalert(msgHTML,m_seconds){
oTitle="פורטל דרושים ";
	if(window.createPopup==null){
	return;
};

if(m_seconds==undefined)m_seconds=5100;
var isWin = false;
msgHTML = (msgHTML==null)?"&nbsp;" : msgHTML;
oTitle = (oTitle==null)?"EventGo Ltd." : oTitle;
var popWin = window.createPopup(); 
   
var borderStyle = "border-top:solid 1px #eeeeee; border-left:solid 1px #cccccc; border-bottom:solid 1px #666666;border-right:solid 1px #555555;";
var HTML = " <TABLE  style='" + borderStyle + ";  width:100%;height:100%;border-collapse:collapse;'>";
	HTML += "<TR><TD style='" + borderStyle + ";height:2px; filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#ffffff, endColorStr=#cccccc, gradientType=0)' disabled>" + oTitle + "</TD></TR>";
	HTML += "<TR><TD vAlign='middle' style='direction:rtl;text-align:center;filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#dedede, endColorStr=#ffffff, gradientType=0)'><div style='width:100%;height:100%; overflow:hidden;vertical-align:middle;padding-top:20px;font-weight:bold'>" + msgHTML + "</div></TD></TR>";
	HTML += "<TR><TD style='height:12px;text-align:center;filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#ffffff, endColorStr=#dedede, gradientType=0)'>&nbsp;</TD></TR>";
	HTML += "</TABLE>";
    HTML += "<marquee  style='position:absolute; top:3px;right:23px;cursor:hand; width:32px; height:12px;font-size:7px;' >. . . . . . . .</marquee>";
	HTML += "<span id='closeBTN' style='position:absolute; top:3px;right:3px;cursor:hand; width:12px; height:12px;font-family:Marlett;color:red;font-size:7px;text-align:center;filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#ffffff, endColorStr=#C6EAFD, gradientType=0);padding-top:1px;padding-left:1px;" + borderStyle + "'>r</span>";
	HTML += "<style>*{font-family:arial;font-size:10pt;}a{color:blue;text-decoration:underline;cursor:hand;}<\/style>";

popWin.document.body.innerHTML =HTML;
popWin.document.body.style.overflow = "hidden";
popWin.document.body.all.closeBTN.onclick = popWinHide;
var popWinHeight = 120;
var popWinWidth = 220;
var popWinTop = 0 ; 
var popWinLeft = 0 ; 
var popWinCurrentHeight = 0 ; 
var popWinCurrentWidth = 0 ; 
var popTimer = ""
popWinShow();
	 
function popWinShow(){
	if((popWinCurrentHeight  < popWinHeight) || (popWinCurrentWidth < popWinWidth )){
		popWinCurrentHeight += Math.ceil(( popWinHeight - popWinCurrentHeight )/5);		
		popWinCurrentWidth  += Math.ceil(( popWinWidth - popWinCurrentWidth )/5);		
		popWinTop =  ( screen.availHeight   - popWinCurrentHeight )/2 - screenTop;
		popWinLeft = ( screen.availWidth   - popWinCurrentWidth  )/2 - screenLeft;
		setTimeout(popWinShow,1);		   
	}else{	
		popWinCurrentHeight =  popWinHeight;
		popWinCurrentWidth  =  popWinWidth  ; 
		popWinHeight = 0;
		popWinWidth = 0;
		popTimer = setInterval( KeepAlive,1);
		setTimeout(popWinHide,2000);	
	}
	popWin.show( popWinLeft ,popWinTop ,popWinCurrentWidth , popWinCurrentHeight, document.body);
	isWin = true;
}	

function KeepAlive(){
	if(isWin)return;
	popWin.show( popWinLeft ,popWinTop ,popWinCurrentWidth , popWinCurrentHeight, document.body);
	isWin = false;
}

function popWinHide(){
	clearTimeout(popTimer);
	if(popWin.isOpen){
		var PopSpeed = 5;
		if(( (popWinCurrentHeight-PopSpeed)  > popWinHeight) ||  ((popWinCurrentWidth - PopSpeed) > popWinWidth )){
			popWinCurrentHeight += Math.ceil(( popWinHeight - popWinCurrentHeight ) / PopSpeed);		
			popWinCurrentWidth  += Math.ceil(( popWinWidth - popWinCurrentWidth ) / PopSpeed);		
			popWinTop =  (screen.availHeight - popWinCurrentHeight ) / 2 - screenTop;
			popWinLeft = (screen.availWidth - popWinCurrentWidth  )/2 - screenLeft;
		//	status = popWinCurrentWidth;
			setTimeout(popWinHide,0);		      
		}else{
			popWin.hide();	
			return;
		}
		popWin.show( popWinLeft ,popWinTop ,popWinCurrentWidth , popWinCurrentHeight, document.body);
	} 
}
}

function HH_MessengerWindow(msgHTML,oTitle){
	if(window.createPopup==null){
	return;
};

oTitle = (oTitle == null) ? "EventGo Ltd." : oTitle;
msgHTML = (msgHTML == null) ? "&nbsp;" : msgHTML;
var popWin = window.createPopup(); 
   
var borderStyle = "border-top:solid 1px #eeeeee; border-left:solid 1px #cccccc; border-bottom:solid 1px #666666;border-right:solid 1px #555555;";
var HTML = " <TABLE  style='" + borderStyle + ";  width:100%;height:100%;border-collapse:collapse;'>";
	HTML += "<TR><TD style='" + borderStyle + ";height:2px; filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#ffffff, endColorStr=#cccccc, gradientType=0)' disabled>" + oTitle + "</TD></TR>";
	HTML += "<TR><TD vAlign='middle' style='text-align:center;filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#dedede, endColorStr=#ffffff, gradientType=0)'><div style='width:100%;height:100%; overflow:hidden;vertical-align:middle;padding-top:20px;;font-weight:bold'>" + msgHTML + "</div></TD></TR>";
	HTML += "<TR><TD style='height:12px;text-align:center;filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#ffffff, endColorStr=#dedede, gradientType=0)'>&nbsp;</TD></TR>";
	HTML += "</TABLE>";
    HTML += "<marquee  style='position:absolute; top:3px;right:23px;cursor:hand; width:32px; height:12px;font-size:7px;' >. . . . . . . .</marquee>";
	HTML += "<span id='closeBTN' style='position:absolute; top:3px;right:3px;cursor:hand; width:12px; height:12px;font-family:Marlett;color:red;font-size:7px;text-align:center;filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#ffffff, endColorStr=#C6EAFD, gradientType=0);padding-top:1px;padding-left:1px;" + borderStyle + "' >r</span>";
	HTML += "<style>*{font-family:arial;font-size:10pt;}a{color:blue;text-decoration:underline;cursor:hand;}<\/style>";

popWin.document.body.innerHTML =HTML;
popWin.document.body.style.overflow = "hidden";
popWin.document.body.all.closeBTN.onclick = popWinHide;
var popWinHeight = 120;
var popWinTop = 0 ; 
var popWinCurrentHeight = 0 ; 
var popTimer = ""
popWinShow();
	 
function popWinShow(){
	if(popWinCurrentHeight  < popWinHeight){
		popWinTop = screen.Height - popWinCurrentHeight - (screen.Height - screen.availHeight); 
		popWinCurrentHeight += Math.ceil((popWinHeight - popWinCurrentHeight ) / 5);		   
		setTimeout(popWinShow,1);		   
	}else{		
		popWinCurrentHeight = popWinHeight;
		popWinHeight = 0;
		popTimer = setInterval(KeepAlive,1);
		setTimeout(popWinHide,2000);	
	}
	popWin.show( (screen.availWidth-180) ,popWinTop ,180, popWinCurrentHeight, document.body);
	isWin = true;
}
	
function popWinHide(){
    clearTimeout(popTimer);
	if(popWin.isOpen){
		var PopSpeed = 5 
		if(  (popWinCurrentHeight-PopSpeed)  > popWinHeight ){
			popWinTop =  screen.Height   - popWinCurrentHeight - (screen.Height  - screen.availHeight ); 
			popWinCurrentHeight += Math.ceil(( popWinHeight - popWinCurrentHeight )/PopSpeed);		   
			setTimeout( popWinHide,1);		   
		}else{
			popWin.hide();	
			return;
		}
		popWin.show( 5000 ,popWinTop ,180, popWinCurrentHeight, document.body);	  
	} 
}

function KeepAlive(){
	if(isWin)return;
    popWin.show( 5000 ,popWinTop ,180, popWinCurrentHeight, document.body);
    isWin = false;
}
}

//-----------------------------------------------------------------------------------------------

function HH_LegendWindow(msgHTML,oTitle,oHeight){
	if(window.createPopup == null){
	return;
};

oTitle = (oTitle == null) ? "EventGo Ltd." : oTitle;
msgHTML = (msgHTML == null) ? "&nbsp;" : msgHTML;
oHeight = (oHeight == null) ? "120" : oHeight;
var popWin = window.createPopup(); 
   
var borderStyle = "border-top:solid 1px #eeeeee; border-left:solid 1px #cccccc; border-bottom:solid 1px #666666;border-right:solid 1px #555555;";
var HTML = " <TABLE  style='" + borderStyle + ";  width:100%;height:100%;border-collapse:collapse;'>";
	HTML += "<TR><TD style='" + borderStyle + ";height:2px; filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#ffffff, endColorStr=#cccccc, gradientType=0)' disabled>" + oTitle + "</TD></TR>";
	HTML += "<TR><TD vAlign='middle' style='text-align:center;filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#dedede, endColorStr=#ffffff, gradientType=0)'><div style='width:100%;height:100%; overflow:hidden;vertical-align:middle;padding-top:20px;;font-weight:bold'>" + msgHTML + "</div></TD></TR>";
	HTML += "<TR><TD style='height:12px;text-align:center;filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#ffffff, endColorStr=#dedede, gradientType=0)'>&nbsp;</TD></TR>";
	HTML += "</TABLE>";
    HTML += "<marquee  style='position:absolute; top:3px;right:23px;cursor:hand; width:32px; height:12px;font-size:7px;' >. . . . . . . .</marquee>";
	HTML += "<span id='closeBTN' style='position:absolute; top:3px;right:3px;cursor:hand; width:12px; height:12px;font-family:Marlett;color:red;font-size:7px;text-align:center;filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#ffffff, endColorStr=#C6EAFD, gradientType=0);padding-top:1px;padding-left:1px;" + borderStyle + "' >r</span>";
	HTML += "<style>*{font-family:arial;font-size:10pt;}a{color:blue;text-decoration:underline;cursor:hand;}<\/style>";

popWin.document.body.innerHTML =HTML;
popWin.document.body.style.overflow = "hidden";
popWin.document.body.all.closeBTN.onclick = popWinHide;
var popWinHeight = oHeight;
var popWinTop = 0 ; 
var popWinCurrentHeight = 0 ; 
var popTimer = ""
popWinShow();
	 
function popWinShow(){
	if(popWinCurrentHeight  < popWinHeight){
		popWinTop = screen.Height - popWinCurrentHeight - (screen.Height - screen.availHeight); 
		popWinCurrentHeight += Math.ceil((popWinHeight - popWinCurrentHeight ) / 5);		   
		setTimeout(popWinShow,1);		   
	}else{		
		popWinCurrentHeight = popWinHeight;
		popWinHeight = 0;
		popTimer = setInterval(KeepAlive,1);
		//setTimeout(popWinHide,2000);	
	}
	popWin.show( (screen.availWidth-180) ,popWinTop ,180, popWinCurrentHeight, document.body);
	isWin = true;
}
	
function popWinHide(){
    clearTimeout(popTimer);
	if(popWin.isOpen){
		var PopSpeed = 5 
		if(  (popWinCurrentHeight-PopSpeed)  > popWinHeight ){
			popWinTop =  screen.Height   - popWinCurrentHeight - (screen.Height  - screen.availHeight ); 
			popWinCurrentHeight += Math.ceil(( popWinHeight - popWinCurrentHeight )/PopSpeed);		   
			setTimeout( popWinHide,1);		   
		}else{
			popWin.hide();	
			return;
		}
		popWin.show( 5000 ,popWinTop ,180, popWinCurrentHeight, document.body);	  
	} 
}

function KeepAlive(){
	if(isWin)return;
    popWin.show( 5000 ,popWinTop ,180, popWinCurrentHeight, document.body);
    isWin = false;
}
}


var CalWinTop = 0 ; 
var CalWinLeft = 0 ; 
var CalWinCurrentHeight = 0 ; 
var CalWinCurrentWidth = 0 ; 


function ShowCal(objInput,t){

getCoords(event.srcElement)
	event.cancelBubble = true; 
	if (t!='')	{OuterDiv.style.top =  100;} else {screen.availHeight   - screenTop;}
	OuterDiv.style.left = oBndRct.right;
	//OuterDiv.scrollIntoView(true);
	 OuterDiv.style.visibility = "visible"; 
	CurrentOuterDiv = OuterDiv;	openingObj=objInput;}

function ShowCalWithHotKey(obj){
if (event.altKey==true && event.keyCode == 70){ShowCal(obj);}
}

function OuterDivClose()
{OuterDiv.style.visibility = "hidden";

	

}

function getCoords(oObject) { oBndRct=oObject.getBoundingClientRect();}


function ConvertDateU(objDate){
	//return objDate;
var gMonths=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

   var d, s ="" ; 
   d = objDate.split(" - ")
   var strNum=d[1]
   var intNum=strNum*1;
   
   var dd = intNum
   if (d[0]*1 < 10){s += "0" + d[0]*1 + "/";}
   else{s += d[0] + "/";}
   for (i=0; i < gMonths.length;i++){if (gMonths[i]== d[1]){intMonth=i}}
   if ((intMonth +1)*1 < 10){s += "0" + (intMonth +1)*1 + "/";}
   else{s += parseInt(intMonth +1) + "/";}
   s += d[2]; 
    
   return(s);
}

function ConvertSimpleDate(objdate){
alert(objdate)
   var d, s = "";
   d = new Date(objdate);
   alert(d)
   s += d.getDate() + "/";
   s += (d.getMonth() + 1) + "/";
   s += d.getYear();
   return(s);
}

function showmenus(urlPage){
for (i=0; i < RightMenuLink.length; i++){
    if (RightMenuLink[i].exp==urlPage){
            RightMenuLink[i].className="RightMenuLink_Selected";
            for (z=0;z<TopMenuLink.length;z++){
                if (TopMenuLink[z].name==RightMenuLink[i].tpm){TopMenuLink[z].className="TopMenuLink_Selected"
                 divLeftMenu[z].style.display="block";
                 return false;
                 }
                }
        }
   }
}


function topmenuAction(objGen,objPri,objLeftMenu){
	var this_iii, this_zzz;	var thislinkA = ""; thislinkA.id="";
	for (i=0; i < objGen.length; i++){objGen[i].className="TopMenuLink"}  //Change menues to unsigned
		
		objPri.className="TopMenuLink_Selected" //The menue that has been choosen will br mark
		CurrentScreen=objPri;
		//alert(CurrentScreen)
		//navbar.innerText = objPri.innerText  + " > " //The name of the menu will insert into the navbar rarea
		for (i=0; i < objLeftMenu.length; i++){ //Fined the menu sub menu
		    objLeftMenu[i].style.display="none";
		    if (objLeftMenu[i].exp==objPri.name){
			        objLeftMenu[i].style.display="block";	//Make the sub menu active	
				
	        		for (z=0;z<objLeftMenu[i].children[0].rows.length;z++)	{ // Find the sub menu of the side menu, and retrive the link stored it it
				            if (objLeftMenu[i].children[0].rows[z].children[0].className=="RightMenuLink_Selected"){
					            thislinkA=objLeftMenu[i].children[0].rows[z].cells[0].linkA;
					            this_iii = i;
					            this_zzz = z;
					            }}}}}
					            
function RightMenuAction(objGen,objPri,objList) {
    //sectionClick(objPri);
	var giveError = false;
	try{var curexp=objPri.exp}
	catch (exception){giveError = true}
	finally	{
	if (giveError == false){}	
		var CurCell;
		for (i=0; i < objPri.parentElement.parentElement.rows.length; i++){
			CurCell = objPri.parentElement.parentElement.rows[i].cells.length-1;
			objPri.parentElement.parentElement.rows[i].cells[CurCell].className="RightMenuLink";
			}  
		objPri.className="RightMenuLink_Selected";
	}
	}
	
	
	function ScrollButtonOver(hElm){
	hElm.className = "ScrollButtonOver" ;
}

function ScrollButtonOut(hElm){
	hElm.className = "ScrollButton" ;
}

function ScrollButtonDown(hElm){
	hElm.className = "ScrollButtonDown" ;
}

function ScrollButtonUp(hElm){
	hElm.className = "ScrollButton" ;
}
function borderize(what,color){what.style.borderColor=color}
function borderize_on(e){
if (document.all)
source3=event.srcElement
else if (document.getElementById)
source3=e.target
if (source3.className=="menulines"){
borderize(source3,"#eeeeee")<!---->
}
else{
while(source3.tagName!="TABLE"){
source3=document.getElementById? source3.parentNode : source3.parentElement
if (source3.className=="menulines")
borderize(source3,"#eeeeee")<!---->
}}}
function borderize_off(e){
if (document.all)
source4=event.srcElement
else if (document.getElementById)
source4=e.target
if (source4.className=="menulines")
borderize(source4,"#abbbce")
else{
while(source4.tagName!="TABLE"){
source4=document.getElementById? source4.parentNode : source4.parentElement
if (source4.className=="menulines")
borderize(source4,"#abbbce")
}}}


function OpenBanners(muser)
{
 	    var pForm = document.createElement("FORM");
		var valrand=Math.random()
		pForm.action="http://www.drushim.co.il/bannersystem/Login.aspx";
		pForm.target="New";
		pForm.method="POST";
		pForm.id ="exForm";
		pForm.name ="exForm";
		document.body.insertBefore(pForm, null);

		var s = document.createElement("INPUT");
		s.id="iUser";
		s.name="iUser";
		s.value=muser;
		s.style.display="none";
		pForm.insertBefore(s, null);
		pForm.submit();   
    
}