

hideMenu = 2;
lcount = 0;

// Function to change styles and hide and show layers

// these are global variables used to remember what topic link on the 
// left was previosly highlighted, these are used later so when we mouse
// over a cell we don't have to change styles on all 16 of the cells, only
// the previous one which was white

pal = 'NONE';  // previous active link
pac = 'NONE';  // previous active cell



// function to change the background color of the table cells on the
// left and the text color when you mouseover
// this function is only called on mouseover so it needs to change the
// previous cell to plain background and change the cell just moused
// over to white - sample call:
// ChangeStyles(pac,pal,'menu-item01','menu-link01','#CC5500','#FFFFFF'); 

function ChangeStyles(pc,pl,x,tl,a,b) {

if (document.getElementById) {

   // if these variable are NONE it is the first time anything has
   // has been moused over in the page so we know these is no prevous
   // cell to unhighlight

   if (pc == "NONE" && pl == "NONE") {
   //       alert("executing if" + pc + " " + pl);
          var currentLink = document.getElementById(tl);
          var currentCell = document.getElementById(x);
          currentCell.style.background =  a; // highlight cell
          currentLink.style.color = b; // change text color

   } else {
//          alert("executing else" + pc + " " + pl);

// now we have to change styles of previously highlighted cell
// then change style of cell moused over
          
          var previousCell = document.getElementById(pc);
          var previousLink = document.getElementById(pl);
          previousCell.style.background = 'transparent';
          previousLink.style.color = "#CC5500";

          var currentLink = document.getElementById(tl);
          var currentCell = document.getElementById(x);
          currentCell.style.background =  a;
          currentLink.style.color = b;

   }
   // set gloabl variables to be current cell and link
   pac = x;
   pal = tl;


}

}

// Function to hide any visible submenu and reset menu state after
// a period of inactivity - based on code at www.truman.edu

function delayHide() {
	
	// call reset_menu and exit function if hideMenu = 0 - i.e.
	// no activity for specified delay, and function not paused 
	// by mousover of menu
	if (hideMenu == 0) { 
		reset_menu();
		lcount = 0;
		return false;
	}
	
	// exit function if hideMenu = 2 - i.e. psused by mouseover event
	if (hideMenu == 2) {
		lcount = 0;
		return false;
	}

	// here's the delay - function calls itself on each iteration, sets
	// hideMenu = 0 on 10th pass, causing reset_menu to be called above
	// if function not paused by user event in the interim.

	if (hideMenu == 1) {
		lcount = lcount + 1;
		if (lcount >= 10) { hideMenu = 0; }
		if (lcount <= 10) { setTimeout('delayHide(' + hideMenu + ')', 175); }
	}

}


// Standard Dreamweaver Hide and Show Layers functions

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);
// -->


function MM_showHideLayers() { //v3.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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}


// Function to close all open menu items, and reset navbar style - used onLoad and
// by delayHide

function reset_menu() {
	MM_showHideLayers('menu00','','hide','menu01','','hide','menu02','','hide','menu03','','hide','menu04','','hide','menu05','','hide','menu06','','hide','menu07','','hide','apply','','hide','status','','hide','aboutadm','','hide');
	
	if (pac != "NONE" && pal != "NONE") {
		var prevCell = document.getElementById(pac);
	    var prevLink = document.getElementById(pal);
	    	  prevCell.style.background = 'transparent';
	          prevLink.style.color = "#CC5500";
	}
}

// Function to clear search field only if default value ("Search Admissions") is present

function clear_search(val, fld) {
	if (document.getElementById) {
		if (val == "Search Admissions") {
		fld.value = "";
		}
	}
}

