var ns4=(document.layers)?true:false; 
var ie4=(document.all)?true:false;
var ns6=(!document.all&&document.getElementById)?true:false;
var ie6 = (document.all)?true:false;
var g=0;
var zoomSym=5;
var current="";
var x;
var y;
//var nam;
var arrowActive=0;
var nwin=0;
var startW;
var startH;

function findDOM(objectId,frames) {
if (document.getElementById) {
return (frames.document.getElementById(objectId));}
if (document.all) {
return (frames.document.all[objectId]);}
}

function reset(imgx,campus){
imgd = top.findDOM(imgx,top.frames[1]);
imgd.width=startW;
imgd.height=startH;
sym = top.findDOM(zoomSym,top.frames[0]);
sym.src='http://www.huji.ac.il/huji/images/campuses-maps/083.gif';
if(campus.match(/rehovot/)) zoomSym=7;
else zoomSym=5;
sym = top.findDOM(zoomSym,top.frames[0]);
sym.src='http://www.huji.ac.il/huji/images/campuses-maps/1dot1a.gif';
top.frames[1].document.getElementById('arrow').style.visibility = "hidden";
if(campus.match(/rehovot/)) zoomSym=7;
else zoomSym=5;
arrowActive=0;
return 0;
}

function printVer(x){
url='http://www.huji.ac.il/huji/maps/'+x;
nwin=window.open(url,"nana","toolbar=yes,member=no,location=no,directories=no,scrollbars=yes,status=yes,copyhistory=no,resizable=yes,height=600,width=1000");
nwin.focus();
}

/*
document.onmousedown=MouseAction;
if(document.layers) windows.captureEvents(Event.MOUSEDOWN);
window.onmousedown=MouseAction;
*/




function show(item)
{

arrowActive=1;

   if ((current!="") && (current!=item)) {
	// hide the current sub-menu
       top.frames[1].document.getElementById(current).style.visibility = "hidden";
   }
	// show the new sub-menu
                top.frames[1].document.getElementById(item).style.top=y;
                top.frames[1].document.getElementById(item).style.left=x; 
 	        top.frames[1].document.getElementById(item).style.visibility = "visible";

	if(top.frames[1].document.momo.val2.value.match(/givatram/)){
    	z=y-250;
	w=x-375;
	}else{
        z=y-165;
	w=x-500;
	}

	top.frames[1].scroll(w,z);

   top.current = item;
   return true;
}

/*
 pjx.prototype.pjxCompleted = function(el){ 
  alert(this.url); 
} 
*/

 function openWin(url){
  nwin=window.open(url,"nana","toolbar=no,member=no,location=no,directories=no,scrollbars=yes,status=no,copyhistory=no,resizable=yes,height=220,width=550");
  nwin.focus();
  }

function openHelp(url){
  nwin=window.open(url,"nana","toolbar=no,member=no,location=no,directories=no,scrollbars=yes,status=no,copyhistory=no,resizable=yes,height=500,width=800");
  nwin.focus();
  }

