/* Agilent Homepage JS from kkh                   */
/* edits to fit About Agilent by bb               */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

var userAgent = navigator.userAgent.toLowerCase();

/* hide from old browsers that do not support getElementByID */
if (document.getElementById) {
    init = function() {
	/* fixHeights on home page colored blocks */
        fixHeights = function() {
            var maxHeight = 0;
            var tmpHeight,i;
            for(i=0; i < arguments.length; i++) {
                tmpHeight = document.getElementById(arguments[i]).offsetHeight;
                if (maxHeight < tmpHeight) maxHeight = tmpHeight;
	    }
            for(i=0; i < arguments.length; i++) {
                document.getElementById(arguments[i]).style.height = maxHeight + "px";
            }
        }
        fixHeights("NavMenuJS");
    
	/* implement script-based flyouts for IE only */
        if(userAgent.indexOf("msie") > -1) {

	    /* we can skip Opera masquerading as IE */
            if(userAgent.indexOf("opera") == -1) {

                var navs = new Array("idnav");
                for(var j=0; j<navs.length;j++) {
                    var sfEls = document.getElementById(navs[j]).getElementsByTagName("LI");
                        for (var i=0; i<sfEls.length; i++) {
                            sfEls[i].onmouseover=function() {
                            this.className+=" sfhover";
                        }
                        sfEls[i].onmouseout=function() {
                            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
                        }
                    }
                }
            }
       }
    }
}

/* load init for browsers that support attachEvent, including IE and Opera */
if (window.attachEvent) { 
    window.attachEvent("onload", init); 
} 
/* otherwise, load only for known browsers that need the fixes */
else if (userAgent.indexOf("firefox/1.5" > -1) ) {
    window.onload=init;
}