var  ie4, nn6, xx, yy, docall="document.getElementById('" , style_type='msie.css' ; docsty="').style" ; var gwindow ;
var scrolled=0 ; var current=0 ; var currents=0 ; var minint=2 ; var lastscrolled=0 ; var  first=true ; var bot_top=0 ;
var subject=0 ; var timer=0 ; var submenu=0 ; var timer1 ;
var meteg=0 ;last_doc=0 ; current_year="2007"

if (document.all)  ie4=true 
else  if (document.getElementById)  nn6=true ;


function load1(kk,jj,nn) {

body_height=document.body.clientHeight ; 
div_height=body_height-positionT("tr_frcontent") -22 ;  
eval(docall + "div_frcontent" + "').style.height=" + div_height );

yy=positionT("tr2"); 
xx=positionL("tr2")-1;

objbot1=eval(docall + "bot1" + docsty ) ;
objbot1.left=xx ;
objbot1.top=body_height - 21;
bot_top=body_height - 21; 
//alert (bot_top) ;
objbot1.visibility ="visible" ;
//document.onmousemove=movefloat ;

eval(docall + "a" + kk  + "').style.backgroundImage=" + "'url(newimages/menu_bg_selected.gif)'" ) ;
eval(docall + "r" + kk  + "').src='newimages/menu_r_selected.gif'") ;
if (kk!=9) eval(docall + "l" + kk  + "').src='newimages/menu_l_selected.gif'") ;

if (kk==8) { //iton
//obj=eval(docall + "r8_odot" + "')") ;
objarrow=eval(docall + "r" + kk + "_" + jj  + "')") ;
if  (arguments.length == 2){ // odot
objarrow.style.fontWeight=700 ; 
objarrow=eval(docall + "r" + kk + "_" + current_year  + "')") ; }
displaysub(objarrow) ;
if   (arguments.length > 2) {
obj2=eval(docall + "r" + kk + "_" + jj  + "_" + nn  +"')") 
obj2.style.fontWeight=700 ; }
 }

else {
// set selection in right sub menu
if (arguments.length > 1) {
objarrow=eval(docall + "r" + kk + "_" + jj  + "')") ;

if (arguments.length > 2) {displaysub(objarrow) 
objarrow=eval(docall + "r" + kk + "_" + jj  + "_" + nn  +"')") ;}

objarrow.style.fontWeight=700   ; }


// set selection in top menu
if ((kk!=0) && (arguments.length > 1)) { // selection of specific item in submenu
submenu=jj ;
objtbody=eval(docall + "tab" + kk +  "')" ) ; // submenu tab id
objtbody.firstChild.childNodes[submenu-1].firstChild.style.backgroundColor="#ffecb1" ;
objtbody.firstChild.childNodes[submenu-1].firstChild.firstChild.style.color="#455e37" ;
objtbody.firstChild.childNodes[submenu-1].firstChild.firstChild.style.fontWeight="700" ;
}
} // kk not iton (8) 


// calculate position of sub menu
for (ii=2 ; ii <= 9 ; ii++ ) {
objtab=eval(docall + "tab" + ii + "')" );
objdiv=eval(docall + "layer" + ii + docsty ) ;
objdiv.left=eval("positionL('r" + ii + "')") - objtab.width + 6 ;
objdiv.top=yy ; }

 }  



function switch1(jj) { 
clearTimeout(timer) ;
// closes prior layer if different
if ((current!=0) && (current!=jj)) hide2() ;
current=jj ;
objdiv=eval(docall + "layer" + jj + docsty ) ;
objdiv.visibility ="visible" ;
}


function hide1() {
timer=setTimeout ("hide2()", 1500);
}

function hide2() {
objdiv=eval(docall + "layer" + current + docsty ) ;
objdiv.visibility ="hidden" ;
}

function onsubmenu(obj) {
clearTimeout(timer);
obj.style.color="#455e37" ;
obj.parentNode.style.backgroundColor="#ffecb1" ;
}

function outsubmenu(obj) {
if (obj.style.fontWeight!="700" )
obj.style.color="white" ;
obj.parentNode.style.backgroundColor="#e79800" ;
timer=setTimeout ("hide2()", 1500);
}



function openprint(str) {
gwindow=window.open (str,'ww',"width=600,height=400,menubar=yes,scrollbars=yes") ;
gwindow.focus();
}

function printdoc1() {
//extract name of internal iframe file 
var pagename=parent.frames[0].location.href ; 
var kuku2= "frcontent/" + pagename.substring((pagename.lastIndexOf("/")+1),pagename.length); 
openprint(kuku2) ;
}

function printdoc2() { // for iton
//extract name of internal iframe file 
var pagename=parent.frames[0].location.href ; 
var kuku2= "iton/" + pagename.substring((pagename.lastIndexOf("/")+1),pagename.length); 
openprint(kuku2) ;
}

function positionT(id) {  
    var offsetTrail = document.getElementById(id);
    var offsetTop = 0;
    while (offsetTrail) {
    offsetTop=offsetTop + offsetTrail.offsetTop; 
    offsetTrail = offsetTrail.offsetParent; }
	return offsetTop
	}
	
	function positionL(id) {
    var offsetTrail = document.getElementById(id);
    var offsetLeft = 0;
    while (offsetTrail) {
    offsetLeft=offsetLeft + offsetTrail.offsetLeft; 
    offsetTrail = offsetTrail.offsetParent; }
	return offsetLeft
	}

		
	
	
	function movefloat() {
if (ie4) scrolled=bot_top + document.body.scrollTop ;
else if (nn6 || ns4) scrolled=bot_top + window.pageYOffset;
if (lastscrolled==scrolled) return ; // no scroll 
lastscrolled=scrolled ;
move() 
}

function move() {
obj=eval(docall + 'bot1' + docsty ) ;
currents=parseInt(obj.top) ;  
var temp=scrolled-currents ;  // distance to move
if (Math.abs(temp) < minint ) { obj.top = scrolled  ; return ; }
obj.top=currents + (temp / 2) ;
timer1=setTimeout ("move()", 1);
}


	function opencamera(str) {
gwindow=window.open (str,'ww',"resizable,width=350,height=350" ) ;
	gwindow.focus();
				}
				
				
	
function displaysub1 (obj) {
if (meteg!=0 ) { // closes open node
obj1=eval(docall + meteg  + "')") ;
if (obj1.firstChild.name=="open") {
obj1.firstChild.name="closed" ;
obj1.parentNode.parentNode.nextSibling.style.display="none" ;
obj1.firstChild.src="newimages/right_bullet_close.gif" ;

//obj.parentNode.style.paddingBottom='0px' ;
}}
meteg=obj.id ; 
if (obj.firstChild.name=="closed") {
obj.parentNode.parentNode.nextSibling.style.display="block" ;
//obj.parentNode.style.paddingBottom='0px' ;
obj.firstChild.src="newimages/right_bullet_open.gif" ;
obj.firstChild.name="open" ;   }
 }

 function displaysub (obj) {
 if (obj.firstChild.name=="closed") {
 obj.firstChild.name="open" ;
 obj.firstChild.src="newimages/right_bullet_open.gif" ;
 obj.parentNode.parentNode.nextSibling.style.display="block" ; }
if ((meteg!=0 ) && (obj.id != meteg)) {
obj1=eval(docall + meteg  + "')") ;
obj1.firstChild.name="closed" ;
obj1.parentNode.parentNode.nextSibling.style.display="none" ;
obj1.firstChild.src="newimages/right_bullet_close.gif" ; }

meteg=obj.id ; 

 }
 
 function openwin1(str,ww,hh) {
gwindow=window.open (str,'ww',"resizable=1,width=" +ww + ",height=" + hh ) ;
gwindow.focus();
}
		
	function openluach() {
	gwindow=window.open ("http://www.atlasals.org.il/boards/luach1/nis_position.asp","kuku","width=800,height=400,scrollbars") ;
	gwindow.focus();
		}
		
		function mark(obj) {
		if (last_doc!=0) {
		last=eval(docall + last_doc  + docsty )  ; last.fontWeight="400" ;}
		obj.style.fontWeight="700" ;
		last_doc=obj.id ;
		}