var oLastBtn=0;

var posw=0;
var posv=0;

function MM_openBrWindow(theURL,winName,features) { //v2.0
var posw = (screen.width - 730)/2;
var posv = (screen.height - 470)/2;
features = features + ",left=" + posw + ",top="+ posv
window.open(theURL,winName,features);
}

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 = "#ffffff";
	}
	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 = "#ffffff";
}

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
//*****************************************	 



//*****************************************	 
//Functions to support image swap
//*****************************************	

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//*****************************************	 
//End functions to support image swap
//*****************************************	