function setLayer(elname,bool){
document.getElementById('subnavigation').style.visibility = 'hidden'

setTop = 185;

if(homepage){
setTop = 196;
}
setLeft =xnum;
isVisible = (bool)?"visible":"hidden";
layerHTML = "";

for(a=0;a<subnavcontent[elname].length;a++){
	subnavcontent[elname][a]+"<br>"


layerHTML += "<a href=\""+subnavcontent[elname][a][1]+"\" onmouseover='clearTimeout(t);' onmouseout='countdown()' class=\"subnavlink\">"+subnavcontent[elname][a][0]+"</a><br>"
}
document.getElementById('subnavigation').innerHTML = layerHTML

eval("document.getElementById('subnavigation').style.top = "+setTop)
eval("document.getElementById('subnavigation').style.left = "+setLeft)
eval("document.getElementById('subnavigation').style.visibility = '"+isVisible+"'")


}

function countdown(){
		t = setTimeout("document.getElementById('subnavigation').style.visibility = 'hidden'",1500)
}

function findPosX(obj){
		var curleft = 0;
		var paddingOffset=0;

		if(IE4){
			paddingOffset = 0
		}
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;
		return curleft+paddingOffset;
}


function rollover(which,bool){
		pfx="nav_";
		isOn=(bool)?"_lit":"";
		eval("document.getElementById(\"nav_"+which+"\").src = 'images/"+pfx+which+isOn+".gif'")

}

function setImage(pic){

topnudge = (IE4)?277:267;
leftnudge = (IE4)?168:178;
setTop = (pic.offsetTop)+topnudge
setLeft = (pic.offsetLeft)+leftnudge

imgname="subnavigation"
eval("document.getElementById(\""+imgname+"\").style.top = "+setTop)
eval("document.getElementById(\""+imgname+"\").style.left = "+setLeft)

}

function setHomeImage(lf){

tp = 50

topnudge = (IE4)?167:157;
leftnudge = (IE4)?168:178;
setTop = tp+topnudge
setLeft = lf+leftnudge

imgname="subnavigation"
eval("document.getElementById(\""+imgname+"\").style.top = "+setTop)
eval("document.getElementById(\""+imgname+"\").style.left = "+setLeft)

}

function setHomeVideo(which){


	document.getElementById("homevideo").innerHTML=document.getElementById("HPvideo"+which).innerHTML

}


function getNextHomeVideo(){

if(currentVideo >= (lastVideo-1)){
	currentVideo=0;
}else{
	currentVideo++;
}
setHomeVideo(currentVideo)
}


NS = (document.layers)?1:0;
IE4 = (document.all) ? 1 : 0;
ver4 = (IE4 || NS) ? 1 : 0;
arPopups = new Array();
var navigTopOffset;
navigTopOffsetConst = (NS)?17:18;
navTableWidth=173
navTableOffset=133
secNavBgColor = "#ffffff";
secSubnavLn = "#66676a";
selectBgColor="#eaeaea"; //
subnavbgcolor = "#DCD412";

var tout;
var Ptout;
primNavTopOffset = 210;
timeoutdelay = 3800;

function resetNavTableClass()
{
		for(cn=0;cn<count;cn++)
			if(document.all)
				document.all["secondarynavtable"+cn].className="secnav"
}

function CloseSecSubnav()
{
		writeToDiv("secondarysubnav","")
}

// real top nav
//subnavbgcolor = "#7F8AB5";

navsect = [];
navsect['gallery']='';
navsect['action_for_israel']='';


function showSubnav(which)
{
	clearTimeout(Ptout);
	hideLayer('subnavigation')
	subnav_html = "";
	primNavLeftOffset=0;

//alert(navsect[which].length);

	if(navsect[which].length>0){
		primNavLeftOffset = navsect[which][0]

		subnav_html += "<div>\n"

		for(sn=1;sn<navsect[which].length;sn++)
		{
			subnav_html +="<a href=\""+navsect[which][sn+1]+"\" class=secnav>"+navsect[which][sn]+"</a><br>\n"
			sn++;
		}

		subnav_html += 	"</div>\n"


	if(document.layers)
	{
		document.subnavigation.document.open()
		document.subnavigation.document.write(subnav_html)
		document.subnavigation.document.close()
	}
	else
	{
		lyr = document.getElementById('subnavigation')
		lyr.innerHTML = subnav_html

		//document.all['subnavigation'].innerHTML = subnav_html
	}

//	moveLayer('subnavigation',primNavLeftOffset,primNavTopOffset)
//	alert("foo")
	showLayer('subnavigation')
	Ptout = setTimeout("hideLayer('subnavigation')",timeoutdelay)

}

}

/////////////////

if (navigator.appName=='Netscape'){
NS = true
layerRef = "document.all."
styleRef = ""
}

else{
NS = false
layerRef = "document.all."
styleRef = ".style"
}
function showLayer(layername)
		{
		lyr = document.getElementById(layername)
		lyr.style.visibility='visible'

//		eval(layerRef+layername+styleRef+".visibility=\"visible\"")
		}

function hideLayer(layername)
	{
		lyr = document.getElementById(layername)
		lyr.style.visibility='hidden'
//		eval(layerRef+layername+styleRef+".visibility=\"hidden\"")
	}
function moveLayer(layername,left,top)
	{
		lyr = document.getElementById(layername)
		lyr.style.left=left
		lyr.style.top=top

//		eval(layerRef+layername+styleRef+".left="+left)
//		eval(layerRef+layername+styleRef+".top="+top)
	}

/////////////////////////////////////////////////////////


IE4 = (document.all) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
ver4 = (IE4 || NS4) ? 1 : 0;
arPopups = new Array();

function setCoords(which,x1,y1,x2,y2) {
	arPopups[which] = new Array();
	arPopups[which][0] = x1;
	arPopups[which][1] = y1;
	arPopups[which][2] = x2;
	arPopups[which][3] = y2;
}
	setCoords(1,0,0,90,30)
	setCoords(2,91,0,200,30)
	setCoords(3,201,0,270,30)
	setCoords(4,271,0,330,30)
	setCoords(5,331,0,440,30)
	setCoords(6,441,0,509,30)

function mapOverX(which,on) {

whichEl = document.getElementById("navlit").style;

if (!on) { whichEl.visibility = "hidden"; return }
	else{
		 clLeft = arPopups[which][0];
		 clTop = arPopups[which][1];
				clRight = arPopups[which][2];
				clBot = arPopups[which][3];
		 if (NS4) {
		   whichEl.clip.top = clTop;
		   whichEl.clip.bottom = clBot;
				  whichEl.clip.left = clLeft;
				  whichEl.clip.right = clRight;
		 }
		 else {
		   whichEl.clip = "rect(" + clTop + " " + clRight + " " + clBot + " " + clLeft + ")";
		 }
		whichEl.visibility = "visible"

	}
}

function getListURL(el){

if(el[el.selectedIndex].value==20){
	location.href="watch_video.php"
}else{
	location.href="israel_60_best.php?l="+el[el.selectedIndex].value
}

}