var FADER,CURRENTMENU,SLOWFADE=100;
function SymError()
{
  return true;
}
window.onerror = SymError;

function fade(menuID,delay){
	if (!delay) delay=100;
	CURRENTMENU=menuID;
	FADER=setTimeout("menus('"+menuID+"','hidden');",delay);
}
function show(menuID){
	if (CURRENTMENU==menuID)
		clearTimeout(FADER);
	menus (menuID,'visible');
}

function menus (menuID,state){
	
	if (document.getElementById)
		document.getElementById(menuID).style.visibility = state;
	else if (document.all)
		document[menuID].visibility = state;
	else if (document.layers){
		state=(state=='visible')?'show':'hide';
		document.layers[menuID].visibility = state;
	}
}

function menuinit(obj){
	navbarinit();
	var m=obj.contentWindow || obj.contentDocument;
	if (m.document)
		m=m.document;
	if (!m && obj.document)
		m=obj.document;
	if (m){
		m=m.getElementById('menubox');
		document.getElementById('menubox').innerHTML=m.innerHTML;
		m.innerHTML='';
	}
}
function getVal(str,p){
	var r='',f=p.indexOf(str+'=')+str.length+1;
	if(f>str.length) {
		var l=p.indexOf('&',f);
		r=p.substring(f,((l>1)?l:p.length));
	}
	return r;
}
function getRef(str,p){
	var r=getVal(str,p);
	if (r!='') return r+'.htm';
	else return false;
}
function navbarinit(){
	var NB=['navbar1', 'navbar2'];
	var n,A,s=document.location.search,u=getRef('m',s);
	for(j=0;j<2;j++){
		n=document.getElementById(NB[j]);
		//alert((n && u!=''));
		if (n && u){
			A=n.getElementsByTagName('a');
			for (i=0;i<A.length;i++){
			//alert(A[i].innerHTML);
				if (A[i].innerHTML.indexOf('src="mn.gif"')>-1)
					A[i].setAttribute('href',u); 
				else{
				var p='?m='+getVal('m',s);
					if (A[i].innerHTML.indexOf('src="bck.gif"')>-1)
						A[i].setAttribute('href',(getRef('b',s) || A[i].getAttribute('href')));
					if (A[i].innerHTML.indexOf('src="nxt.gif"')>-1)
						A[i].setAttribute('href',(getRef('n',s) || A[i].getAttribute('href')));
					A[i].setAttribute('href', A[i].getAttribute('href')+p);
				}
			}
		}
	}
}
