// JavaScript Document


function MM_preloadImages() { //v3.0  
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


/*
function menu(id) {
var element = document.getElementById(id);
	for (var i = 1; i<=5; i++) {
		if (document.getElementById('menu_'+i)) {document.getElementById('menu_'+i).style.display='none';}
	}
if (element) {element.style.display='block';}
}

function menu_sub(id){
	document.getElementById(id).style.display='none';
}
*/
var active_menu='';
function menu_on(id, id_bkg){
	document.getElementById(id).style.display='block';
	if(id_bkg==active_menu){ return; }
	document.getElementById(id_bkg).style.background = "url(graph/shared/menu/menu_bkg_active.gif) no-repeat";
	document.getElementById(id_bkg).style.backgroundColor='#e14b01';
	document.getElementById(id_bkg).style.color='#262627';
}

function menu_off(id, id_bkg){
	document.getElementById(id).style.display='none';
	
	if(id_bkg==active_menu){ return; }
	Bkg=document.getElementById(id_bkg);
	Bkg.style.background = "url(graph/shared/menu/menu_bkg.gif) no-repeat";
	Bkg.style.backgroundColor='#2a2a2a';
	Bkg.style.color='#ff9126';
}

function menu_set_active(id){
	active_menu=id;
	document.getElementById(active_menu).style.background = "url(graph/shared/menu/menu_bkg_active.gif) no-repeat";
	document.getElementById(active_menu).style.backgroundColor='#e14b01';
	document.getElementById(active_menu).style.color='#262627';
}


function OpacityOver(This){
	This.style.filter='alpha(opacity=80)';
	This.style.opacity='0.8';
}

function OpacityOut(This){
	This.style.filter='alpha(opacity=100)';
	This.style.opacity='1';
}


function marquee(x,typ,p){
    typ={
        'up':[-1,'top','offsetHeight'],
        'down':[1,'top','offsetHeight'],
        'left':[-1,'left','offsetWidth'],
        'right':[1,'left','offsetWidth']
    }[typ];
    var m=this,mOut,mIn,turlaj,T,i=typ[0],j=0,p=p||30;
    (mOut=document.getElementById(x)).onmouseover=function(){T=clearInterval(T)};
        mOut.appendChild((mIn=mOut.childNodes)[0].cloneNode(1));
        mOut.onmouseout=function(e){
            e=e||event;e=e.toElement||e.relatedTarget;
            if(e)do{if(e==this)return!1}while(e=e.parentNode) 
            T=setInterval(turlaj,p)
        };
    mOut=mIn[0][typ[2]];
    turlaj=function(){
        mIn[0].style[typ[1]]=(-2*i*(j+=i)<(i-1)*mOut?(j=(-i-1)/2*mOut+i):j)+'px';
        mIn[1].style[typ[1]]=j+mOut+'px';
    }
    T=setInterval(turlaj,p);    
}
