﻿// Need this code to make the main navigation and toolbox work in IE6, because IE6 does not understand the :hover attribute for a list item.
// This code will convert :hover to mouseover/mouseout events for IE5+.
// Need to look for each UL id, including the child UL ids, otherwise the :hover effect will not work on subnavs.
startList = function() {

    if (document.all&&document.getElementById) {
        // Top-level nav - parent id - Alphabetically
        navRootAlpha = document.getElementById("selectBusinessesAlpha");
        for (i=0; i<navRootAlpha.childNodes.length; i++) {
	        nodeAlpha = navRootAlpha.childNodes[i];
	        if (nodeAlpha.nodeName=="LI") {
		        nodeAlpha.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeAlpha.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        // sub nav - child id - Alphabetically
        navRootAlphaList = document.getElementById("selectBusinessesAlphaList");
        for (i=0; i<navRootAlphaList.childNodes.length; i++) {
	        nodeAlphaList = navRootAlphaList.childNodes[i];
	        if (nodeAlphaList.nodeName=="LI") {
		        nodeAlphaList.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeAlphaList.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        
        // Top-level nav - parent id - Service Category
        navRootService = document.getElementById("selectBusinessesService");
        for (i=0; i<navRootService.childNodes.length; i++) {
	        nodeService = navRootService.childNodes[i];
	        if (nodeService.nodeName=="LI") {
		        nodeService.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeService.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        // sub nav - child id - Service Category
        navRootServiceList = document.getElementById("selectBusinessesServiceList");
        for (i=0; i<navRootServiceList.childNodes.length; i++) {
	        nodeServiceList = navRootServiceList.childNodes[i];
	        if (nodeServiceList.nodeName=="LI") {
		        nodeServiceList.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeServiceList.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        
        // Top-level nav - parent id - Clinical Development
        navRootClinical = document.getElementById("selectCategory1");
        for (i=0; i<navRootClinical.childNodes.length; i++) {
	        nodeClinical = navRootClinical.childNodes[i];
	        if (nodeClinical.nodeName=="LI") {
		        nodeClinical.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeClinical.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        // sub nav - child id - Clinical Development
        navRootClinicalList = document.getElementById("selectCategory1List");
        for (i=0; i<navRootClinicalList.childNodes.length; i++) {
	        nodeClinicalList = navRootClinicalList.childNodes[i];
	        if (nodeClinicalList.nodeName=="LI") {
		        nodeClinicalList.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeClinicalList.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        
        // Top-level nav - parent id - Strategic Planning
        navRootStrategic = document.getElementById("selectCategory2");
        for (i=0; i<navRootStrategic.childNodes.length; i++) {
	        nodeStrategic = navRootStrategic.childNodes[i];
	        if (nodeStrategic.nodeName=="LI") {
		        nodeStrategic.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeStrategic.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        // sub nav - child id - Strategic Planning
        navRootStrategicList = document.getElementById("selectCategory2List");
        for (i=0; i<navRootStrategicList.childNodes.length; i++) {
	        nodeStrategicList = navRootStrategicList.childNodes[i];
	        if (nodeStrategicList.nodeName=="LI") {
		        nodeStrategicList.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeStrategicList.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        
        // Top-level nav - parent id - Marketing & Communications
        navRootMarketing = document.getElementById("selectCategory3");
        for (i=0; i<navRootMarketing.childNodes.length; i++) {
	        nodeMarketing = navRootMarketing.childNodes[i];
	        if (nodeMarketing.nodeName=="LI") {
		        nodeMarketing.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeMarketing.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        // sub nav - child id - Strategic Planning
        navRootMarketingList = document.getElementById("selectCategory3List");
        for (i=0; i<navRootMarketingList.childNodes.length; i++) {
	        nodeMarketingList = navRootMarketingList.childNodes[i];
	        if (nodeMarketingList.nodeName=="LI") {
		        nodeMarketingList.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeMarketingList.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        
        // Top-level nav - parent id - Sales Solutions
        navRootSales = document.getElementById("selectCategory4");
        for (i=0; i<navRootSales.childNodes.length; i++) {
	        nodeSales = navRootSales.childNodes[i];
	        if (nodeSales.nodeName=="LI") {
		        nodeSales.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeSales.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        // sub nav - child id - Sales Solutions
        navRootSalesList = document.getElementById("selectCategory4List");
        for (i=0; i<navRootSalesList.childNodes.length; i++) {
	        nodeSalesList = navRootSalesList.childNodes[i];
	        if (nodeSalesList.nodeName=="LI") {
		        nodeSalesList.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeSalesList.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        
        // Top-level nav - parent id - Improve Patient Outcomes
        navRootImprove = document.getElementById("selectCategory5");
        for (i=0; i<navRootImprove.childNodes.length; i++) {
	        nodeImprove = navRootImprove.childNodes[i];
	        if (nodeImprove.nodeName=="LI") {
		        nodeImprove.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeImprove.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
        // sub nav - child id - Improve Patient Outcomes
        navRootImproveList = document.getElementById("selectCategory5List");
        for (i=0; i<navRootImproveList.childNodes.length; i++) {
	        nodeImproveList = navRootImproveList.childNodes[i];
	        if (nodeImproveList.nodeName=="LI") {
		        nodeImproveList.onmouseover=function() {
			        this.className+=" over";
		        }
		        nodeImproveList.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
		        }
	        }
        }
    }
}

window.onload=startList;

function displayAlphaList()
{
    document.getElementById("selectBusinessesAlpha").style.display = "block";
    document.getElementById("selectBusinessesService").style.display = "none";
    document.getElementById("selectCategory1").style.display = "none";
    document.getElementById("selectCategory2").style.display = "none";
    document.getElementById("selectCategory3").style.display = "none";
    document.getElementById("selectCategory4").style.display = "none";
    document.getElementById("selectCategory5").style.display = "none";
    
    location.href = "default.aspx";
}

function displayCategoryList()
{
    // display drop down list 1
    document.getElementById("selectBusinessesAlpha").style.display = "none";
    document.getElementById("selectBusinessesService").style.display = "block";
    		    
    // display selected drop down list 2
    document.getElementById("selectCategory1").style.display = "block";
    
    location.href = "default.aspx?category=1";
}