﻿

var MyDisplayed = new Object();
MyDisplayed.id="";

function reminder(id)
{
if (MyDisplayed.id!="") {MyDisplayed.style.display="none";}
var My = eval("document.all.vr"+id);
if (My!=MyDisplayed)
	{
		MyDisplayed=My;
		My.style.display="inline";
	}
else {
	MyDisplayed= new Object();
	MyDisplayed.id="";
	}
}

function reminder2(id)
{
if (MyDisplayed.id!="") {
MyDisplayed.style.display="none";
document.getElementById('dv1').innerHTML = "קרא עוד";
}
var My = eval("document.all.vr"+id);
if (My!=MyDisplayed)
	{
		MyDisplayed=My;
		My.style.display="inline";
		document.getElementById('dv1').innerHTML = "סגור";
	}
else {
	MyDisplayed= new Object();
	MyDisplayed.id="";
	}

}

function showHide(show,hide)
		{
		 var showObj,hideObj;
		  hideObj = document.getElementById(hide);
		  showObj = document.getElementById(show);
		  if (show!="no"){
		   showObj.style.display='inline';
		    }
		   if (hide!="no"){
		      hideObj.style.display='none';
		   }
		}



function changHpTab(objId){
resetHpTabs();
switch (objId)
{
	case 1: 
	  document.getElementById("hpTab_"+objId).src = document.getElementById("hpTab_"+objId).src.replace("_Off","_On");
	  document.getElementById("hpTab_"+2).src = document.getElementById("hpTab_"+2).src.replace("_Off","_1_On");
	  break
	case 2: 
	  document.getElementById("hpTab_"+objId).src = document.getElementById("hpTab_"+objId).src.replace("_Off","_On");
	  document.getElementById("hpTab_"+1).src = document.getElementById("hpTab_"+1).src.replace("_Off","_2_On");
	  document.getElementById("hpTab_"+3).src = document.getElementById("hpTab_"+3).src.replace("_Off","_2_On");
	  break
	case 3: 
	  document.getElementById("hpTab_"+objId).src = document.getElementById("hpTab_"+objId).src.replace("_Off","_On");
	  document.getElementById("hpTab_"+2).src = document.getElementById("hpTab_"+2).src.replace("_Off","_3_On");
	  document.getElementById("hpTab_"+4).src = document.getElementById("hpTab_"+4).src.replace("_Off","_3_On");
	  break
	case 4: 
	   document.getElementById("hpTab_"+objId).src = document.getElementById("hpTab_"+objId).src.replace("_Off","_On");
	  document.getElementById("hpTab_"+3).src = document.getElementById("hpTab_"+3).src.replace("_Off","_4_On");
	  break
}
/*
 var tabL = document.getElementById("l"+objId);
 var txt  = document.getElementById("text"+objId);
 
   tabR.src = tabR.src.replace("_Off","_On");
   tabL.src = tabL.src.replace("_Off","_On");
   txt.className = "txtTabsOn";*/
}	


function changeFlash(url){
 var thePath = document.getElementById("tabs").movie.substring(0,(document.getElementById("tabs").movie.lastIndexOf("/")+1));
 document.getElementById("tabs").movie = thePath + url;
}


function resetHpTabs(){

   for (i=1;i<=4;i++){
  
	   var tabObj = document.getElementById("hpTab_"+i);
	   var thePath = tabObj.src.substring(0,(tabObj.src.lastIndexOf("/")+1));
	   tabObj.src = thePath+"b_hpTab"+i+"_Off.gif";   
	}
}



function goMenu(id){
  var Obj = document.getElementById("menu" + id);
    if(Obj.className.indexOf("On")!=-1){
	  Obj.className = "menu_Off";
	  dispP("subMenu"+ id);
	}else{
	  Obj.className = "menu_On";
	  dispP("subMenu"+ id);
	}
}



function goSearch(){

   var bt = document.getElementById("btSearch");
   var txtObj = document.getElementById("txtSearch");
   var tr = document.getElementById("trSearch"); 

	   if(tr.style.display=="none"){
		 bt.src = bt.src.replace("_On","_Off");
		 txtObj.innerText = 'פתח חיפוש';
		 dispP("tblSearch");
	   }else{
	     bt.src = bt.src.replace("_Off","_On");
		 txtObj.innerText = ' סגור חיפוש';
		 dispP("tblSearch");
	   }      
}

function checkAll(){
		  //alert(document.all.tags("Checkbox").length)
		  /*for (i=0;i<document.forms['PrintAdds'].elements.length;i++)
			{
			  if (document.forms['PrintAdds'].elements[i].type=='checkbox')
				{
				 if (theParam == '1'){
				  document.forms['PrintAdds'].elements[i].checked=true
				  }else{
				  document.forms['PrintAdds'].elements[i].checked=false
				  }
				}
			}*/
	   }


function dispP(id){
	var Obj = document.getElementById(id);
	if(Obj){
	    if (Obj.style.display == ''){
	                Obj.style.display = 'none';
				}else{
	                Obj.style.display = "";
	            }
			}
	}


function changeMeOnOff(Obj){
	  if(Obj.src.indexOf("_On")!=-1){
	      Obj.src = Obj.src.replace("_On","_Off");
	   }else{
	      Obj.src = Obj.src.replace("_Off","_On");
	   }  
}
	
	
function chngeClass(Obj,clsName,flag){
 if(Obj.className.indexOf("On")<0){
	if(flag){
	  Obj.className = clsName + "_over";
	}else{
	  Obj.className = clsName;
	}
  }
}
	

function changeAllArrows(){
  //document.all.tags("img").item(0); 
  var Obj,j,flag;
  j=1;
  flag = 0;//if rows colsed or opend
  
		
		  for(i=0;i<document.all.tags("img").length-1;i++){
		    Obj = document.all.tags("img").item(i)
				if(Obj.src.indexOf("i_row")>0) {
				 if(document.getElementById("btShowAll").innerText.toString().indexOf("הצג")==-1){
				    //hide
					theTrObj = document.getElementById("trSub" + j)
					theTrObj.style.display = "none";
					if(document.getElementById("btRow" + j).src.indexOf("_Off")<0){
					  changeMeOnOff(document.getElementById("btRow" + j));
					}
					j++;
					flag=1;
				  }else{
				  //show
				    theTrObj = document.getElementById("trSub" + j)
			        theTrObj.style.display = "";
					if(document.getElementById("btRow" + j).src.indexOf("_On")<0){
					  changeMeOnOff(document.getElementById("btRow" + j));
					}
					j++;
					flag=0;
				  } 
				}
		  }
		        
				 if(document.getElementById("btShowAll").innerText.toString().indexOf("הצג")!=-1){
				    document.getElementById("btShowAll").innerText = CLOSEINFORMATION;
				  }else{
					document.getElementById("btShowAll").innerText = OPENINFORMATION; 
				  }
	  
	  
}

	
var ObjDisplayed = new Object();
ObjDisplayed.id="";

function disp(id)
{
if(id=="")
	return;
	
if (ObjDisplayed.id!="") {ObjDisplayed.style.display="none";}
var Obj = document.getElementById(id);
if (Obj!=ObjDisplayed)
	{
		ObjDisplayed=Obj;
		Obj.style.display="inline";
	}
else {
	ObjDisplayed= new Object();
	ObjDisplayed.id="";
	}
}




function changTab(objId){
resetTabs();
 var tabR = document.getElementById("r"+objId);
 var tabL = document.getElementById("l"+objId);
 //var txt  = document.getElementById("text"+objId);
 
   tabR.src = tabR.src.replace("_Off","_On");
   tabL.src = tabL.src.replace("_Off","_On");
   //txt.className = "txtTabsOn";
}	

function resetTabs(){

   for (i=1;i<=4;i++){
	   var tabR = document.getElementById("r"+i);
	   var tabL = document.getElementById("l"+i);
	   //var txt  = document.getElementById("text"+i);
	   
	   tabR.src = tabR.src.replace("_On","_Off");
       tabL.src = tabL.src.replace("_On","_Off");
      // txt.className = "txtTabsOff";
	}
}
		
		
function checkAll(obj,chId){
	       var items = document.all.tags("INPUT");
		   for (i=1; i < items.length; i++)
		    {
			  if(items[i].id.indexOf(chId)!=-1){
			    if(obj.checked){
			        items[i].checked = true;
				  }else{
				     items[i].checked = false;
				  }
			  }
			}
	   }	

	   
	   
function addToList(listToAddTo,listToRemove){

 //var theFrm = document.myCarForm;
 ////var removeList = eval("theFrm." + listToRemove)
 ////var addList = eval("theFrm." + listToAddTo)
 var removeList = document.getElementById(listToRemove)
 var addList = document.getElementById(listToAddTo)

 if (removeList.value!=""){
	 var theRemoveIndex = removeList.selectedIndex;
	 var theValue = removeList.options[removeList.selectedIndex].value;
	 var theText = removeList.options[removeList.selectedIndex].text;
	 var optionToAdd = new Option(theText,theValue)
	 var listLength = addList.length;
		 addList.options[listLength] = optionToAdd;
		 removeList.options[theRemoveIndex] = null;
	  }
}
	   
	   
	   
/////////////////////////////  START MENU FUNCTIONS ////////////////////////////////////////
var m_CurrentPopup;
var theShim;
var LeftPos,topPos
var menuwidth;
menuwidth = '105px';

var Xoff;
Xoff=10;

function popupHide(e,leftP,topP)
{
	//evt = e || window.event;
	var desElement;
	var srcElement;
	
		
	LeftPos = leftP;
	topPos = topP;
	
	if(typeof(m_CurrentPopup) != "undefined"){
	
				    if (window.event != null)
					{	
						srcElement = e.srcElement;
						desElement = event.toElement
						
					}
					else
					{
						srcElement = e.target;
						desElement = e.relatedTarget;	
					}
					
					if(desElement==null)
					{
						m_CurrentPopup.style.display = 'none';
						return;
					}	
				  
					/*if ((srcElement.id.indexOf('topMenuTD_')>0) && (desElement.id.indexOf('topMenuPopup_') >0 ))
					    return;	*/
				
				
					p = desElement;
				
				    	while( p != null)
				    	{
				
						if (p.id == m_CurrentPopup.id)
							return;
				
				        	p = p.offsetParent
				    	} 
				
				
					if (m_CurrentPopup == null)
						return;
					
					m_CurrentPopup.style.display = 'none';
	
	  }

	
	 if(theShim!=null){
	     theShim.style.display = 'none'; //EWAVE - hide the empty background frame
	  }
	  
	
}

function popupShow(srcObj,leftP,topP)
{
    
	LeftPos = leftP;
	topPos = topP;
	
	var topTD = srcObj; //.offsetParent;
	/*var theObjHeight =  document.getElementById(srcObj.id);
	theObjHeight = theObjHeight.id;
	theObjHeight = theObjHeight.style.height;
	alert(theObjHeight)*/
	var popTable = topTD.id.replace('b_','menu_');
	popTable = document.getElementById(popTable);
	theObjHeight = document.getElementById(popTable.id);
	//alert(theObjHeight.style.height)
	
	if (popTable == null)
		return
	
	if (m_CurrentPopup != null)
		m_CurrentPopup.style.display = 'none'	
	
	var left=0;
    	var top = 0;
	var p = topTD
    	while( p != null)
    	{
        	left += p.offsetLeft
        	top += p.offsetTop
        	p = p.offsetParent
    	} 
    
		m_CurrentPopup = popTable;
    	m_CurrentPopup.style.top = ((0) + top + topTD.offsetHeight -parseInt(topPos)) +'px';
    	m_CurrentPopup.style.left = (left + parseInt(LeftPos)) + 'px';
    	m_CurrentPopup.style.display = '';
		m_CurrentPopup.style.zIndex = '1000';
    	m_CurrentPopup.style.position = 'absolute';
		
	
	
	  theShim = document.getElementById("DivShimMenu");
	  dropmenuobj = popTable;
      dropmenuobj.x=getposOffset(srcObj, "left")
	  dropmenuobj.y=getposOffset(srcObj, "top")
	
	
	//EWAVE - THE EMPTY BACKGROUND FRAME FPR SELECT BOX COVER
	if(theShim!=null){
	theShim.style.top = (dropmenuobj.y-8)+"px";
	theShim.style.display = 'inline';
	theShim.style.width = eval(menuwidth.substring(0,menuwidth.lastIndexOf("px")))+12
	////theShim.style.height= (menuNum.length)*17+'px';
    theShim.style.height = theObjHeight.style.height;
	theShim.style.left = dropmenuobj.x-Xoff-clearbrowseredge(srcObj, "rightedge")+"px"
	theShim.style.top=(dropmenuobj.y-8)-clearbrowseredge(srcObj, "bottomedge")+srcObj.offsetHeight+"px"
	}
}
/////////////////////////////  END MENU FUNCTIONS ////////////////////////////////////////







/////////////////////////////// START TICKER FUMCTIONS ////////////////////////////////
var g_OldPixselPerStep;
		var g_Direction ;         //up or down direction


		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()

		lstart=100     //The pixel value of where you want the layer to start (from the top)
		loop=true    //Set this to false if you just want it to go one time
		speed=40    //Set the speed, lower value gives more speed
		pr_step=1    //Set this to how many pixels you want it to go for each step, this also changes the speed.    

		PixselPerStep=pr_step            //Init
		g_OldPixselPerStep=PixselPerStep //Init
		g_Direction=0


		//Object constructor
		function makeObj(obj,nest){
			nest=(!nest) ? '':'document.'+nest+'.'
			this.el=bw.dom?document.getElementById(obj):bw.ie4?document.getElementById(obj):bw.ns4?eval(nest+'document.'+obj):0;
			this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.getElementById(obj).style:bw.ns4?eval(nest+'document.'+obj):0;
			this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
			this.newsScroll=newsScroll;
			this.moveIt=b_moveIt; this.x; this.y;
			this.obj = obj + "Object"
			eval(this.obj + "=this")
			return this
		}

		function b_moveIt(x,y)
		 {
				this.x=x;
				this.y=y;
				this.css.left=this.x;
				this.css.top=this.y;
		 }
		 
		function newsScroll(speed)  //Makes the object scroll up
		 {
		 
		  if (g_Direction == 0)
		  {
		  
			if(this.y>-this.scrollHeight)
			  {
			   this.moveIt(0,this.y-pr_step);
			   setTimeout(this.obj+".newsScroll("+speed+")",speed);
			  }
			 else if(loop)
			  {
			   this.moveIt(0,lstart);
			   eval(this.obj+".newsScroll("+speed+")");
			  }
		   }
		   else
		   {
			if(this.y<+this.scrollHeight)
			  {
			   this.moveIt(0,this.y+pr_step);
			   setTimeout(this.obj+".newsScroll("+speed+")",speed);
			  }
			 else if(loop)
			  {
			   this.moveIt(0,lstart);
			   eval(this.obj+".newsScroll("+speed+")");
			  }
			}
		 }
		 
		 

		function ChangeDirection(Direction)   //Change scrall direction
		  {
			if(Direction == 0)
			{
			 g_Direction=0;
			// newsScroll(speed);  //up
			  Start()
			}
			else
			{
			 g_Direction=1;
			 Start()
			// newsScroll(speed);  // down
			}
		  }


		//Makes the object
		function newsScrollInit()   //Makes the object
		  {
			if (document.getElementById('divNewsCont')!= null)
			{
			    oNewsCont=new makeObj('divNewsCont')
			    oNewsScroll=new makeObj('divNewsText','divNewsCont')
			    oNewsScroll.moveIt(0,lstart)
			    oNewsCont.css.visibility='visible'
			    oNewsScroll.newsScroll(speed)
			}
		   }
		   

		   function SetSpeed(PixselPerStep) // set scroller speed
			{
			  if (PixselPerStep==0)
			   {
			   pr_step=0;
			   newsScrollInit;  
			   }
			   else
			   {
			   g_OldPixselPerStep = PixselPerStep;
			   pr_step=PixselPerStep;
			   newsScrollInit;  
			   }
			}
			 


		   function Stop() // stop scroller
			{
			   SetSpeed(0);
			}
		 
		 
		   function Start()  //Start scroller
			{
			   SetSpeed(g_OldPixselPerStep);
			}



		  function Popup(SiteName)  // open popup windows with the request url
			{
			  window.open(SiteName, 'NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=no, width=400,height=300,top=100,left=100');
			}

		   
	
/////////////////////////////// START TICKER FUMCTIONS ////////////////////////////////