//image rollover for hornav with current section highlighted 
function navRollOver (whichNav,imageFileType) {	
	var rollOverSuffix = "-over";
	var whichNav = whichNav.replace(/^\s+|\s+$/g,'');
	var imageFileType = imageFileType.replace(/^\s+|\s+$/g,'');
	var imagePath = "/i/hornav-";
	var navRoot = document.getElementById(whichNav);
	var args = getUrlSubString();	
	for(i=0; i<navRoot.childNodes.length; i++){
		node0 = navRoot.childNodes[i];
		if(node0.nodeName=='A'){
			for(a=0; a<node0.childNodes.length; a++){
				node1=node0.childNodes[a];
				if(node1.nodeName=="IMG"){
					node1.onmouseover=function(){
						if (
							(this.id=="medicaldoctors" && args=="doctors")||
							(this.id=="physicianssurgeons" && args=="surgeons")||
							(this.id=="surgery" && args=="surgery")||
							(this.id=="healthinformation" && args=="health-information")||
							(this.id=="womenshealth" && args=="womens-health")||
							(this.id=="menshealth" && args=="mens-health")
							)
						{
							srcactive = imagePath+this.id+"-on"+imageFileType;
						} else {
							srcactive = imagePath+this.id+rollOverSuffix+imageFileType;
						}
						this.src = srcactive;						
					}
					node1.onmouseout=function(){						
						if (
							(this.id=="medicaldoctors" && args=="doctors")||
							(this.id=="physicianssurgeons" && args=="surgeons")||
							(this.id=="surgery" && args=="surgery")||
							(this.id=="healthinformation" && args=="health-information")||
							(this.id=="womenshealth" && args=="womens-health")||
							(this.id=="menshealth" && args=="mens-health")
							)
						{
							src = imagePath+this.id+"-on"+imageFileType;
						} else {
							src = imagePath+this.id+imageFileType;	
						}						
						this.src = src;
					}
				}
			}
		}
	}
}

//image rollover for hornav with current section highlighted 
function navRollOverForm (whichNav,imageFileType) {	
	var rollOverSuffix = "-over";
	var whichNav = whichNav.replace(/^\s+|\s+$/g,'');
	var imageFileType = imageFileType.replace(/^\s+|\s+$/g,'');
	var imagePath = "/i/hornav-";
	var navRoot = document.getElementById(whichNav);
	var args = getUrlSubString();	
	for(i=0; i<navRoot.childNodes.length; i++){
		node0 = navRoot.childNodes[i];
		if(node0.nodeName=='A'){
			for(a=0; a<node0.childNodes.length; a++){
				node1=node0.childNodes[a];
				if(node1.nodeName=="IMG"){
					node1.onmouseover=function(){
						if (
							(this.id=="doctorsearch" && args=="doctors")||
							(this.id=="surgeonsearch" && args=="surgeons")							
							)
						{
							srcactive = imagePath+this.id+"-on"+imageFileType;
						} else {
							srcactive = imagePath+this.id+rollOverSuffix+imageFileType;
						}
						this.src = srcactive;						
					}
					node1.onmouseout=function(){						
						if (
							(this.id=="doctorsearch" && args=="doctors")||
							(this.id=="surgeonsearch" && args=="surgeons")							
							)
						{
							src = imagePath+this.id+"-on"+imageFileType;
						} else {
							src = imagePath+this.id+imageFileType;	
						}						
						this.src = src;
					}
				}
			}
		}
	}
}

//image rollover for hornav with current section highlighted 
function navRollOverHome (whichNav,imageFileType) {	
	var rollOverSuffix = "-over";
	var whichNav = whichNav.replace(/^\s+|\s+$/g,'');
	var imageFileType = imageFileType.replace(/^\s+|\s+$/g,'');
	var imagePath = "/i/hornav-";
	var navRoot = document.getElementById(whichNav);
	var args = getUrlSubString();	
	for(i=0; i<navRoot.childNodes.length; i++){
		node0 = navRoot.childNodes[i];
		if(node0.nodeName=='A'){
			for(a=0; a<node0.childNodes.length; a++){
				node1=node0.childNodes[a];
				if(node1.nodeName=="IMG"){
					node1.onmouseover=function(){
						if (this.id=="medicaldoctors") {
							srcactive = imagePath+this.id+"-home"+imageFileType;
						} else {
							srcactive = imagePath+this.id+rollOverSuffix+imageFileType;
						}
						this.src = srcactive;						
					}
					node1.onmouseout=function(){						
						if (this.id=="medicaldoctors") {
							src = imagePath+this.id+"-home"+imageFileType;
						} else {
							src = imagePath+this.id+imageFileType;	
						}						
						this.src = src;
					}
				}
			}
		}
	}
}

//image rollover for hornav with current section highlighted 
function buttonRollover (whichNav,imageFileType) {	
	var rollOverSuffix = "-over";
	var imageFileType = imageFileType.replace(/^\s+|\s+$/g,'');
	var imagePath = "/i/";
	var navRoot = document.getElementById(whichNav);
	for(i=0; i<navRoot.childNodes.length; i++){
		node0 = navRoot.childNodes[i];
		if(node0.nodeName=='A'){
			for(a=0; a<node0.childNodes.length; a++){
				node1=node0.childNodes[a];
				if(node1.nodeName=="IMG"){
					node1.onmouseover=function(){
						srcactive = imagePath+this.id+rollOverSuffix+imageFileType;						
						this.src = srcactive;						
					}
					node1.onmouseout=function(){						
						src = imagePath+this.id+imageFileType;	
						this.src = src;
					}
				}
			}
		}
	}
}

//returns the current section to navRollOver
function getUrlSubString() {
	var url = document.URL;
	var whichPageArray=url.split("/");	
	return whichPageArray[3];
}