/*		Raquel Ortiz menu code
*/
// Detect browser for MSIE 5 on Mac
// From the webreference.com JavaScript Browser Sniffer
var agt = navigator.userAgent.toLowerCase();
var appVer = navigator.appVersion.toLowerCase();
var is_minor = parseFloat(appVer);
var is_major = parseInt(is_minor);
var is_mac = (agt.indexOf("mac")!=-1);
var iePos  = appVer.indexOf('msie');
if (iePos !=-1) {
   if(is_mac) {
       var iePos = agt.indexOf('msie');
       is_minor = parseFloat(agt.substring(iePos+5,agt.indexOf(';',iePos)));
   }
   else is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
   is_major = parseInt(is_minor);
}
var is_ie = (iePos != -1);
var is_ie5_mac = (is_ie && is_mac && is_major == 5);

// In MSIE assign the "iehover" style to all live top-level list items
// on a mouseover, and remove it on mouseout, so that their color will
// change properly; also handle menu ID for IE on the Mac
startList = function() {
	if (document.all&&document.getElementById) {
		IEAdjust("topul", "live", "ietophover");
	}
	// Change top menu ID for IE5 Mac
	if (is_ie5_mac) {
		topMenuRoot = document.getElementById('topmenu');
		topMenuRoot.setAttribute('id', 'topmenu_iemac');
	}
}
function IEAdjust(menuID, listClass, newClass) {
	menuRoot = document.getElementById(menuID);
	for (i=0; i<menuRoot.childNodes.length; i++) {
		node = menuRoot.childNodes[i];
		if ((node.nodeName=="LI") && (listClass == null ||
				(node.className==listClass))) {
			node.onmouseover=function() {
				this.className += " " + newClass;
			}
			node.onmouseout=function() {
				this.className = this.className.replace(" " + newClass, "");
			}
		}
	}
}
window.onload=startList;

