activatedMenu = '';
function menuPreCache(actMen)
{
	if(actMen != 'none' && actMen != '' && actMen != 'nursing'){
		activatedMenu = actMen;	
		highlightedMenu = activatedMenu;		
		tabdown = new Image(1, 25);
		tabdown.src = imgDir +"images/menu_down.gif";
		
		document.getElementById(activatedMenu).className = 'tabup';
	}
		//document.images[activatedMenu].src = activeImageArray[activatedMenu].src;				
	
}
function menuTabOver(tab) {

	if(tab.id == activatedMenu){
		navBar(tab,1,3);
	} else {
		navBar(tab,1,2);
	}
}
function menuTabOut(tab) {
	if(tab.id == activatedMenu){
		navBar(tab,0,3);
	} else {
		navBar(tab,0,2);
	}
}
var newWin = null;

function popWin(url,WinName) {
	var widthString  = ",width=" + 800;	
	var heightString = ",height=" +600;
	var args = "toolbar=yes,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=no,titlebar=no, dependent=no," + heightString + widthString;
	//window.newWin.close();
		
	if (newWin && !newWin.closed) {
		
		newWin.location = url;
		//return false;
		//if (newWin && newWin.focus) newWin.focus();
	} else {
		newWin = window.open("",WinName,args);
		newWin.moveTo(0, 17);
		//newWin.resizeTo(screen.availWidth, screen.availHeight);
		//newWin.resizeTo(650,	525);
		newWin.location = url;
		//newWin.focus();
	}
} 

function popWinVar(url,WinName, width, height) {
	var widthString  = ",width=" + 400;
	var heightString = ",height=" + 300;
	var args = "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no,titlebar=no, dependent=no" + heightString + widthString;
	//window.newWin.close();
		
	if (newWin && !newWin.closed) {
		
		newWin.location = url;
		//return false;
		//if (newWin && newWin.focus) newWin.focus();
	} else {
		newWin = window.open("",WinName,args);
		newWin.moveTo(0, 17);
		//newWin.resizeTo(width,	height);
		//newWin.resizeTo(screen.availWidth, screen.availHeight);
		
		newWin.location = url;
		//newWin.focus();
	}
} 


function closeWin(){
	if (newWin && newWin.close) newWin.close();
}
function goTo( url ) {
	window.location.href = url;
}

function roofBar( tableCellRef, hoverFlag ) {
	if ( hoverFlag ) {
		//tableCellRef.style.backgroundImage = 'url("images/roofbar_bg2.gif")';
		if ( document.getElementsByTagName ) {
			tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#c00';
		}
	} else {
		//tableCellRef.style.backgroundImage = 'url("images/roofbar_bg.gif")';
		if ( document.getElementsByTagName ) {
			tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#333';
		}
	}
}

function roofBarClick( tableCellRef, url ) {
	roofBar( tableCellRef, 0 );
	goTo( url );
}

function navBar( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		
		chgcolor = '#F3F3F3'; //E3E3E3 E2E5EA
		
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = chgcolor;
				break;
			case 2:
				
				tableCellRef.style.background = '#8494A1';
				tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#FFF';
				break;
			case 3:
				tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#7E8E9B';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#A5B6C6';
				}
		}
	} else {
		
		origcolor = '#FFF';
		
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = origcolor;
				break;
			case 2:
				tableCellRef.style.background = 'url(images/menu_down.gif) repeat-x top';
				tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#5A706E';	
				break;
			case 3:
				tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#5A706E';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#73828C';
				}
		}
	}
}

function navBarClick( tableCellRef, navStyle, url, location ) {
	navBar( tableCellRef, 0, navStyle);
	switch (location) {
	case 1: 
		window.open(url);
		break;
	case 2:
		popWin(url, 'kb');
		break;
	default:
		goTo( url );
	}
	
}


