
        var OSName = "";
        if (navigator.appVersion.indexOf("Win") != -1) OSName = "win";
        if (navigator.appVersion.indexOf("Mac") != -1) OSName = "mac";
        if (navigator.appVersion.indexOf("X11") != -1) OSName = "uni";
        if (navigator.appVersion.indexOf("Linux") != -1) OSName = "lin";


        $j(document).ready(function() {
            if ($j.browser.msie) {
                IEStyles();
            }
            else if ($j.browser.safari) {
                SafariStyles();
            }
            else if ($j.browser.mozilla) {
                FFStyles();
            }
            else {
            }


        });

        //handles style adjustments for Safari
        function SafariStyles() {
            $j('.footerCell').each(function(i) {
                $j(this).css({ 'margin-top': '0px' });
            });
            $j('.footerHeaderCell').each(function(i) {
                $j(this).css({ 'margin-top': '5px', 'margin-left': '-1px' });
                if (i == 0)
                    $j(this).css({ 'margin-left': '-2px' });
            });
            $j("#countrySelect_").css({ 'margin-top': '-7px' });
            $j("#countryHeader").css({ 'margin-left': '-1px' });
            $j("#countryLinks").css({ 'margin-top': '5px' });

            if ($j(".fieldNotes").length > 0)
                $j(".fieldNotes").css({ 'margin-top': '68px' });
        }

        //handles style adjustments for IE
        function IEStyles() {
            if ($j.browser.version == '7.0') {
                $j('.footerCell').each(function() {
                    $j(this).css({ 'display': 'inline', 'float': 'left', 'margin-top': '5px' });
                });
                $j('.footerHeaderCell').each(function(i) {
                    $j(this).css({ 'display': 'inline', 'float': 'left', 'margin-top': '5px' });

                    if (i == 0)
                        $j(this).css({ 'margin-left': '-1px' });
                });
                $j("#countrySelect_").css({ 'margin-top': '-7px' });
                $j(".tools-navigation").css({ 'margin-top': '50px' });

                if ($j(".tools-navigation").length > 0)
                    $j(".tools-navigation").css({ 'top': '360px' });

                $j('.dialog').children('div.ft').children('div.c').css({ 'margin-bottom': '20px' });

                $j('#mainFooter').css({ 'margin-top': '1px' });
                $j('.pageContent').css({ 'margin-bottom': '-1px' });

                if ($j(".fieldNotes").length > 0)
                    $j(".fieldNotes").css({ 'margin-top': '78px' });
            }
            else if ($j.browser.version == '8.0') {
                if ($j(".fieldNotes").length > 0)
                    $j(".fieldNotes").css({ 'margin-top': '62px' });
            }
        }

        //handles style adjustments for FireFox
        function FFStyles() {
            $j(".searchText").css({ 'vertical-align': 'bottom', 'padding-top': '2px' });

            if (OSName == 'mac') {
                $j('.footerHeaderCell').each(function(i) {
                    if (mainHomePage) {
                        $j(this).css({ 'margin-top': '0px', 'margin-left': '-1px', 'vertical-align': 'middle' })
                    } else {
                        $j(this).css({ 'margin-top': '5px', 'margin-left': '-1px', 'vertical-align': 'middle' })
                    }
                    if (i == 0)
                        $j(this).css({ 'margin-left': '-2px' });
                });
            }
        }

var menusToClose = new Array();
function addTopNavBehavior(context){
	if (!context) context = document.getElementById("primaryNav");
	
	if (context && context.childNodes){
	    for(var i = 0; i < context.childNodes.length; i++){
		    var n = context.childNodes[i];
		    if (n.nodeName == "LI"){
		    
		        if(/MSIE (5|6)/.test(navigator.userAgent)){
	                    n.showSubMenu = showSubMenu;
			            n.hideSubMenu = hideSubMenu;
			            n.onmouseenter = function() { this.className = this.className.replace(new RegExp('\\s+hover', 'g'),''); this.className += " hover"; this.showSubMenu(event);};
			            n.onmouseleave = function() { this.className = this.className.replace(new RegExp('\\s+hover', 'g'),''); this.hideSubMenu(event);}; 
		        }else{
		    	        n.onmouseover = showSubMenu;
			            n.onmouseout = hideSubMenu;
			    }
    			
			
   			    var s = n.getElementsByTagName("OL")[0];
			    if (s)addTopNavBehavior(s);
		    }	
	    }
	}
}



function showSubMenu(e){
    var subMenu = this.getElementsByTagName("OL")[0];
    
    if (!subMenu){
        subMenu = this.getElementsByTagName("DIV")[0];
        //check again whether element is valid
        if(subMenu){
        var imgs = subMenu.getElementsByTagName("IMG");
            for (i=0;i<imgs.length;i++){
              if (imgs[i].className == "productFeatureImage"){
                imgs[i].src = imgs[i].longDesc;
                break;
              }
          }
        }
    }

	if (!e) var e = window.event;
	if (this.closeTimeoutID > 0) this.closeTimeoutID = 0;
	
	this.className = this.className.replace("open", "");

	
	// We don't want to show a submenu for blog, so return
	if (this.className == "blog") 
	{
	    subMenu.style.height = "0px";
	    return;
	}
	
	if (!subMenu) return;
	this.className += " open";
	
	
	subMenu.style.zIndex = 1; /* otherwise borders of sibling dropdowns cause problems */
	subMenu.style.visibility = "visible";
		
	
	if (subMenu.offsetHeight < this.parentNode.offsetHeight) 
		subMenu.style.height = this.parentNode.offsetHeight-2 + "px";

}

function hideSubMenu(e){
	//find a submenu, or leave
	var subMenu = this.getElementsByTagName("OL")[0];
	if (!subMenu) subMenu = this.getElementsByTagName("DIV")[0];
	
	
	//figure out where the mouse is going to
	var relTarg = null;
	if (!e) var e = window.event;
	if (e.relatedTarget) relTarg = e.relatedTarget;
	else if (e.toElement) relTarg = e.toElement;
	
	//if it's going to one of my child elements, don't close anything
	while (relTarg != null && relTarg != this && relTarg.nodeName != 'BODY' && relTarg.nodeName != 'HTML')
		relTarg= relTarg.parentNode
	if (relTarg == this) return;
	
	    this.className = this.className.replace("open", "");
		if (subMenu){ subMenu.style.zIndex = 0;
		            subMenu.style.visibility = "hidden";
		 }
		
	//}
}
	
	
function hideSubMenu_Internal(){	
	var li = menusToClose.shift();	
	
	if (li.closeTimeoutID > 0){	
	
		li.className = li.className.replace("open", "");		
		li.closeTimeoutID = 0;
	}
}


var topNav_oldOnload = window.onload;
window.onload = function(){	
	if (topNav_oldOnload) topNav_oldOnload(); 
	addTopNavBehavior(document.getElementById("primaryNav"));
	addTopNavBehavior(document.getElementById("featuresAndCSNavList"));
}
