// LIST ALL SHOW/HIDE ELEMENT IDS HEREmenus_array = new Array ('dd01','dd02', 'dd03', 'dd04', 'dd05', 'dd06', 'dd07', 'dd08', 'dd09');dirs_array = new Array ('','overview', 'programs', 'apply', 'students', 'visit', 'parents', 'teachers', 'alumni');menus_status_array = new Array ();// remembers state of switchesfunction getCookie(name) {  var dc = document.cookie;  var prefix = name + "=";  var begin = dc.indexOf("; " + prefix);  if (begin == -1) {    begin = dc.indexOf(prefix);    if (begin != 0) return null;  } else    begin += 2;  var end = document.cookie.indexOf(";", begin);  if (end == -1)    end = dc.length;  return unescape(dc.substring(begin + prefix.length, end));}function getHost(){	var url = window.location.href;	var urlparts = url.split('/');	var i = 0;	//var host = urlparts[0];	/*for(i=0;i<urlparts.length;i++){				alert("Part " + i + ":" + urlparts[i]);	}*/	/*var d = urlparts[urlparts.length-2];	return d;*/		var d = "";	for ( var j=0; j<dirs_array.length; j++ ) {		if ( urlparts[urlparts.length-1]  == dirs_array[j] ) {						d=urlparts[urlparts.length-1];		}else if ( urlparts[urlparts.length-2]  == dirs_array[j] ) {			d=urlparts[urlparts.length-2];		}		}		return d;}          function showHideSwitch (theid) {  if (document.getElementById) {    var switch_id = document.getElementById(theid);       if (menus_status_array[theid] != 'show') {           switch_id.className = 'showSwitch';	  menus_status_array[theid] = 'show';	  document.cookie = theid+'=show';    }else{           switch_id.className = 'hideSwitch';	  menus_status_array[theid] = 'hide';	  document.cookie = theid+'=hide';    }  }}/*function resetMenu () { // read cookies and set menus to last visited state  if (document.getElementById) {	var dir = getHost();	alert(dir);    for (var i=0; i<menus_array.length; i++) {		      var idname = menus_array[i];	        var switch_id = document.getElementById(idname);	              if (getCookie(idname) == 'show') {	            switch_id.className = 'showSwitch';	    menus_status_array [idname] = 'show';	  }else{	           switch_id.className = 'hideSwitch';	    menus_status_array [idname] = 'hide';	  }    }  }}*/function checkLinks() {	var links = document.getElementsByTagName("a");	for (var i=0; i<links.length; i++) {			if (links[i].className == "e_sub") {			//alert( links[i].href );						var url = window.location.href;			if ( links[i].href.indexOf("/undergrad_admission/") != -1  && 				url.indexOf("/undergrad_admission/") != -1 ) {								var thisStart = links[i].href.indexOf("/undergrad_admission/");				var thisSRR = links[i].href.substring(thisStart);								var urlStart = url.indexOf("/undergrad_admission/");				var urlSRR = url.substring(urlStart);																if ( urlSRR == thisSRR ) {										links[i].className = "hilite";					links[i].setAttribute("class","hilite");									}else if ( urlSRR == thisSRR + "index.shtml" ) {					links[i].className = "hilite";					links[i].setAttribute("class","hilite");													}else if ( urlSRR  + "index.shtml" == thisSRR ) {					links[i].className = "hilite";					links[i].setAttribute("class","hilite");									}																											}					}		}}function resetMenu () { // read cookies and set menus to last visited state	if (document.getElementById) {		var dir = getHost();			for (var i=0; i<menus_array.length; i++) {			var idname = menus_array[i];			var switch_id = document.getElementById(idname);			var head_name = "dt" + idname.substring(2);			var head_id = document.getElementById(head_name);			if ( dirs_array[i] == dir ) {				head_id.className= 'hilite';				head_id.setAttribute("class","hilite");				switch_id.className = 'showSwitch';				menus_status_array [idname] = 'show';								}else{				switch_id.className = 'hideSwitch';				menus_status_array [idname] = 'hide';				head_id.className= 'normal';			}		}	checkLinks();	}}