
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
///////////////////////////////////////////
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
///////////////////// MENU FUNCTIONS ///////////////////////////////
// total nr of main menu items
totalMM = 6
// total nr of submenulayers
totalSubs = 4
function show(itemclicked, menuitem){
	// first hide all and reset bgcolor
	restoreMenuToDefault()
	// then show selected
	if (arguments.length == 2){
		menuitem = (menuitem==4)?3:menuitem
		MM_showHideLayers("subMenu_" + menuitem,"","show")
	}
	highlightCell(itemclicked, true)
}
function restoreMenuToDefault(){

	for (x=0; x<totalSubs; x++) {
					MM_showHideLayers("subMenu_" + x,"","hide");
				}
		for (x=0; x<totalMM; x++) {
				obj = "mm_" + x
				obj = MM_findObj(obj);
					if (x<4){
						obj.className="td_MainMenu";
					}else{
						obj.className="td_MainSubMenu";
					}
				obj.childNodes[0].className = "mainMenu"
				}
}
function highlightCell (element, flag) {
  		while (element.tagName.toUpperCase() != 'TD' && element != null)
   		 element = document.all ? element.parentElement : element.parentNode;
  		if (element){
			if (flag) {
				element.className="td_MainMenu_hl";
				element.childNodes[0].className = "mainMenu_hl"
			}else{
				element.className='td_MainMenu';
				element.childNodes[0].className = "mainMenu"
			}
	}
}
function initMenu (currentSubject, hasChildren) {
	nrActiveMenu = currentSubject;
	if (currentSubject != null){
		hasSubMenu = hasChildren;
		restoreMenu();
	}
MM_showHideLayers("mainMenu","","show");
}
function restoreMenu(){
	if (nrActiveMenu != null){
		var menuCell = MM_findObj("mm_" + nrActiveMenu);
		if (hasSubMenu) {
			show(menuCell, nrActiveMenu)
		}else{
			show(menuCell)
		}
	}else{
		restoreMenuToDefault();
	}
}
fwHideMenuTimer = null;
fwDHFlag = false;
function KV_startTimeout() {
	fwHideMenuTimer = setTimeout("restoreMenu()", 3600);
}
function KV_clearTimeout() {
	if (fwHideMenuTimer) clearTimeout(fwHideMenuTimer);
	fwHideMenuTimer = null;
}
///////////////////// END MENU FUNCTIONS ///////////////////////////////
function MM_openBrWindow(theURL,winName,popW, popH, features) { //v2.0
  //newwin = window.open(theURL,winName,features);
 // newwin.focus();
  
  	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	features = features + ',width='+popW+',height='+popH+',left='+winleft+',top='+winUp+''
	Win = window.open(theURL, winName, features)
	if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}
