var oLastBtn=0;

function RaiseButton(){
	
	window.event.cancelBubble=true;
	oBtn = window.event.srcElement;
	if(oLastBtn && oLastBtn != oBtn){
		HideButton();
	}
	if(oBtn.buttonType){
		oBtn.className = oBtn.buttonType + "Up";
		oLastBtn=oBtn;
	}
	else
		oLastBtn = 0;
	
	
}


function DepressButton(){
	window.event.cancelBubble=true;
	oBtn = window.event.srcElement;
	if(oBtn.buttonType){
		oBtn.className = oBtn.buttonType + "Down"; 
	}
}

function btnHideChosen(oFrom){
	if (btnLastClass == null) 
		btnLastClass = "LeftNavChosen";
	btnHide(oFrom);
}

function HideButton(){
	oLastBtn.className = oLastBtn.buttonType + "Off";
}

function MakeBGBlue(oRegion) {
	oRegion.style.backgroundColor="#99CCFF";	
	oRegion.style.cursor="hand";		
}

function MakeBGWhite(oRegion) {
	var oToEl = window.event.toElement;
	if ((oToEl && !oRegion.contains(oToEl))||!oToEl) {
	oRegion.style.backgroundColor="#FFFFFF";	
	}		
}

function ToolbarRed() {
	oSrcEl = window.event.srcElement;
	if (oSrcEl.tagName == "IMG") {
		oSrcEl.src = oSrcEl.src.substring(0,(oSrcEl.src.indexOf(".gif"))) + "-red.gif";
		window.event.cancelBubble = true;
	}
}
function ToolbarWhite() {
	oSrcEl = window.event.srcElement
	if (oSrcEl.tagName == "IMG") {
		oSrcEl.src = oSrcEl.src.substring(0,(oSrcEl.src.indexOf("-red.gif"))) + ".gif";
		window.event.cancelBubble = true;
	}
}

//*****************************************	 
//Global caps function.  Use g_bc in all pages
//to access the browser info
//*****************************************	 
function globalCaps(){
	var A=navigator.userAgent, t=true, p="", v="";
	p=A.indexOf("MSIE");
	if (p!=-1){
    	this.ie=true;
		v=A.charAt(p+5);
		(v=="2")?this.ie2=true:this.ie2=false;
		(v=="3")?this.ie3=true:this.ie3=false;
		(v=="4")?this.ie4=true:this.ie4=false;
		(v=="5")?this.ie5=true:this.ie5=false;
	} else {
		this.ie=false;
		this.ie2=false;
		this.ie3=false;
		this.ie4=false;
		this.ie5=false;	
	}
	(this.ie4||this.ie5)?this.IE4RelOrNewer=true:this.IE4RelOrNewer=false;
	(A.indexOf("Mozilla") != -1 && A.indexOf("compatible")==-1)?this.nav=true:this.nav=false;
	(A.indexOf("Windows 95")>0||A.indexOf("Win95")!=-1||A.indexOf("Win98")!=-1||A.indexOf("Windows 98")!=-1||A.indexOf("Windows NT")!=-1)?this.win32=true:this.win32=false;
	(A.indexOf("Windows 3.1")!=-1||A.indexOf("Win16")!=-1)?this.win16=true:this.win16=false;
	(A.indexOf("Mac")!=-1)?this.anymac=true:this.anymac=false;
	(A.indexOf("SunOS")!=-1||A.indexOf("HP-UX")!=-1||A.indexOf("X11")!=-1)?this.unix=true:this.unix=false;
	(A.indexOf("Windows CE")!=-1)?this.wince=true:this.wince=false;
}

//*****************************************
//Global browser info object
//*****************************************
var gbc=new globalCaps();



//*****************************************	 
//Functions to support left nav menu
//*****************************************	 

var btnLastClass = null;
var btnLastFontColor = null;

function btnUp(oFrom){
	
	if (document.readyState != "complete") return;
	//movement between A and DIV
	if (window.event.fromElement == null || window.event.toElement == null) return;

	if ((!oFrom.children(0).className) && ((oFrom.children(0).className == "LeftNavOff")  && (window.event.fromElement.contains(window.event.toElement) || window.event.toElement.contains(window.event.fromElement)))) {
		window.event.cancelBubble=true;
		btnLastClass = oFrom.children(0).className;
		btnLastFontColor = oFrom.children(0).children(0).style.color;
		oFrom.children(0).className = "LeftNavUp";	
		oFrom.children(0).children(0).style.color = "white";
	}
	if (gbc.ie4) {	
		if (window.event.fromElement.contains(window.event.toElement) || window.event.toElement.contains(window.event.fromElement)) return;
	}
	window.event.cancelBubble=true;
	btnLastClass = oFrom.children(0).className;
	btnLastFontColor = oFrom.children(0).children(0).style.color;
	oFrom.children(0).className = "LeftNavUp";	
	oFrom.children(0).children(0).style.color = "white";
}

function btnHide(oFrom){
	if (document.readyState != "complete") return;
	//moving out of the button space
	if (window.event.toElement == null || window.event.toElement.tagName == "BODY" || window.event.toElement.tagName == "IMG" || window.event.toElement.tagName == "TD") {
		//alert ("Class: " + btnLastClass + " Color: " + btnLastFontColor);
		window.event.cancelBubble=true;
		if (btnLastClass == null) btnLastClass = "LeftNavOff";
		oFrom.children(0).className = btnLastClass;
		oFrom.children(0).children(0).style.color = btnLastFontColor;
		return;
	}

	//movement between A and DIV
	if (gbc.ie4) {
		if (window.event.fromElement.contains(window.event.toElement) || window.event.toElement.contains(window.event.fromElement)) return;
	}
	//moving between buttons
	window.event.cancelBubble=true;
	if (btnLastClass == null) btnLastClass = "LeftNavOff";
	oFrom.children(0).className = btnLastClass;
	oFrom.children(0).children(0).style.color = btnLastFontColor;
}

function btnDown(oFrom){
	if (document.readyState != "complete") return;
	window.event.cancelBubble=true;
	oFrom.children(0).className = "LeftNavDown";
}
//*****************************************	 
//End functions to support left nav menu
//*****************************************	 

