
// Highlight main nav images
//list of aspx file names with no extension
var pages = new Array();
pages[0] = "about_us:1";
pages[1] = "thought_leadership:1";
pages[2] = "board_members:1";
pages[3] = "patient_centered_health_management:1";
pages[4] = "management_team:1";
pages[5] = "board_of_directors:1";
pages[6] = "affiliations:1";
pages[7] = "careers:1";
pages[8] = "job_openings:1";
pages[9] = "who_we_serve:2";
pages[10] = "manufacturers:2";
pages[11] = "patients:2";
pages[12] = "providers:2";
pages[13] = "services:3";
pages[14] = "direct_distribution:3";
pages[15] = "drug_launch_programs:3";
pages[16] = "health_management_services:3";
pages[17] = "hub_services:3";
pages[18] = "reimbursement:3";
pages[19] = "rems:3";
pages[20] = "nursing_network:3";
pages[21] = "clinical_trial_support:3";
pages[22] = "hemophelia_treatment_programs:3";
pages[23] = "knowledge_base:4";
pages[24] = "podcasts:4";
pages[25] = "videos:4";
pages[26] = "whitepapers:4";
pages[27] = "presentations:4";
pages[28] = "news:5";
pages[29] = "news_article:5";
pages[30] = "news_archive:5";
pages[31] = "event:5";
pages[32] = "contact_us:6";
pages[33] = "articles:4";
pages[34] = "video_detail:4";
pages[35] = "hemophilia_treatment_programs:3";
pages[36] = "video_tour:1";
pages[37] = "conference_summary:5";




// JQUERY - MAIN NAV DROPDOWNS  //////////////////////////////////////////////////////////////////////////

$(document).ready(function(){

//get current file name in browser
var currentpage = window.location.href;
currentpage = currentpage.substring(currentpage.lastIndexOf("/")+1, currentpage.lastIndexOf("."));

//find in array
var x="";
var filename="";
var highlight = "";
for (i=0;i<=pages.length-1;i++)
{
   x = pages[i];
   filename = x.substring(0,x.indexOf(":"));
   if(currentpage == filename){
       highlight = x.substring(x.indexOf(":")+1);      
    }
}

//alert(highlight);


//hight nav item on page load
switch(highlight){
    case "1":
    $("#about").attr({src: "images/nav_about_on.gif"});
    break;
    
    case "2":
    $("#who_we_serve").attr({src: "images/nav_who_we_serve_on.gif"});
    break;
    
    case "3":
    $("#services").attr({src: "images/nav_services_on.gif"});
    break;
    
    case "4":
    $("#knowledge_base").attr({src: "images/nav_knowledge_base_on.gif"});
    break;
    
    case "5":
    $("#news").attr({src: "images/nav_news_on.gif"});
    break;
    
    case "6":
    $("#contact").attr({src: "images/nav_contact_on.gif"});
    break;

}



// hiding by css first hides menus while pages loads. Otherwise menus show until javascript takes effect.

//Uunhide css

document.getElementById("aboutMenu").style.display = "block";
document.getElementById("whoMenu").style.display = "block";
document.getElementById("servicesMenu").style.display = "block";

	
// hide using jquery						   
$("#aboutMenu").hide();
$("#whoMenu").hide();
$("#servicesMenu").hide();


//ROLLOVERS

//home
$("#home").mouseover(
	function(){	
		$("#home").attr({src: "images/nav_home_on.gif"});
});
$("#home").mouseleave(
	function(){		
		$("#home").attr({src: "images/nav_home.gif"});
});


//about
$("#about").mouseover(
	function(){
		$("#about").attr({src: "images/nav_about_on.gif"});
		$("#aboutMenu").show();
});
$("#about").mouseleave(
	function(){	
	    if(highlight != "1"){
		    $("#about").attr({src: "images/nav_about.gif"});
		}
		$("#aboutMenu").hide();
});

//who we serve
$("#who_we_serve").mouseover(
	function(){
		$("#who_we_serve").attr({src: "images/nav_who_we_serve_on.gif"});
		$("#whoMenu").show();
});
$("#who_we_serve").mouseleave(
	function(){	
	    if(highlight != "2"){
		    $("#who_we_serve").attr({src: "images/nav_who_we_serve.gif"});
		}
		$("#whoMenu").hide();
});

//services
$("#services").mouseover(
	function(){
		$("#services").attr({src: "images/nav_services_on.gif"});
		$("#servicesMenu").show();
});
$("#services").mouseleave(
	function(){
	    if(highlight != "3"){		
		    $("#services").attr({src: "images/nav_services.gif"})
		}
		$("#servicesMenu").hide();
});

//kb
$("#knowledge_base").mouseover(
	function(){	
		$("#knowledge_base").attr({src: "images/nav_knowledge_base_on.gif"});
});
$("#knowledge_base").mouseleave(
	function(){	
	    if(highlight != "4"){	
		    $("#knowledge_base").attr({src: "images/nav_knowledge_base.gif"});
		}
});

//news
$("#news").mouseover(
	function(){		
		$("#news").attr({src: "images/nav_news_on.gif"});
});
$("#news").mouseleave(
	function(){	
	    if(highlight != "5"){	
		    $("#news").attr({src: "images/nav_news.gif"});
		}
});

//contact
$("#contact").mouseover(
	function(){		
		$("#contact").attr({src: "images/nav_contact_on.gif"});
});
$("#contact").mouseleave(
	function(){	
	    if(highlight != "6"){	
		    $("#contact").attr({src: "images/nav_contact.gif"});
	    }
});

$("#aboutList").mouseover(
	function(){	
		$("#aboutMenu").show();
		$("#about").attr({src: "images/nav_about_on.gif"});
});

$("#aboutList").mouseleave(
	function(){

		$("#aboutMenu").hide();
		    if(highlight != "1"){
		        $("#about").attr({src: "images/nav_about.gif"});
		    }
});

$("#whoList").mouseover(
	function(){	
		$("#whoMenu").show();
		$("#who_we_serve").attr({src: "images/nav_who_we_serve_on.gif"});
});

$("#whoList").mouseleave(
	function(){

		$("#whoMenu").hide();
		if(highlight != "2"){
		    $("#who_we_serve").attr({src: "images/nav_who_we_serve.gif"});
		}
});

$("#servicesList").mouseover(
	function(){	
		$("#servicesMenu").show();
		$("#services").attr({src: "images/nav_services_on.gif"});
});

$("#servicesList").mouseleave(
	function(){

		$("#servicesMenu").hide();
		if(highlight != "3"){
		    $("#services").attr({src: "images/nav_services.gif"});
		 }
});

});//end $(document).ready(function(){

// END JQUERY //////////////////////////////////////////////////////////////////////////



//show -hide podcast player


function TogglePlusMinus(node)
{
var n = node.nextSibling;
	// Unfold the branch if it isn't visible
	if (n.nextSibling.style.display == 'none')
	{
		n.nextSibling.style.display = 'block';
	}
	// Collapse the branch if it IS visible
	else
	{
		n.nextSibling.style.display = 'none';
	}

}