var md=500;
var obj;
var oldClassname;
var i=0;

function init(id){
	startList();
	window.status="page id="+id;
	image1=new Image();
	image1.src="gfx/button.gif";
	image2=new Image();
	image2.src="gfx/over_button.gif";
}


function startList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
//					if (this.className!="selectedtop"){						this.className+=" over";					}
						this.className+=" over";
//					window.status=node.nodeName+"  "+this.className;
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}


function reloadme(){
//window.location.reload();
document.location=document.location;
window.status=" reloading.";
}

function switchClass(obj){

}

function expandSubMenu(obj){
	menu=obj.id.split("_");
window.status="expand"+menu[0]+'_'+menu[1];
switch (menu[0]){
	case 'submenu':
		menupref='subsubmenu';
	break;
	case 'topmenu':
		menupref='submenu';
	break;
	case 'subsubmenu':
		return;
	break;
}

menuidx=menu[1]-1;
submenu=document.getElementById(menupref+'_'+menuidx);
submenu.style.visibility='visible';
oldClassname=submenu.className;
submenu.className='visiblemenu';
}

function collapseSubMenu(obj){
window.status="collapse"+menu[0]+'_'+menu[1];
window.status = obj.className+ i + oldClassname;
i++;
	menu=obj.id.split("_");
	if( menu[0] == 'submenu'){
		menupref='subsubmenu';
	}else{
		menupref='submenu';
	}
	menuidx=menu[1]-1;
	submenu=document.getElementById(menupref+'_'+menuidx);

submenu.style.visibility='hidden';
submenu.className=oldClassname;

}

