
var ColorPBG = "transparent";
var ColorPBGNN = "#ffffff";
var ColorPBGOnSet = "#003366";
var ColorPBGOnSetNN = "#6699CC";
var ColorPBGFont = "#666666";
var ColorPBGFontOnSet = "#ffffff";

var ColorBBG = "#E7E3E7";
var ColorBBGOnSet = "#003366";
var ColorBBGOnSetNN = "#336699";
var ColorBBGFont = "#000000";
var ColorBBGFontOnSet = "#ffffff";

arrow = new Image();
arrow.src = "images/null.gif";
arrow_on = new Image();
arrow_on.src = "images/arrowred_blue.gif";

function applyColorsTo (id, backgroundColor, fontColor) {
   if (ns) {
//      document.layers[id].document.bgColor = backgroundColor;
      document.layers[id].bgColor = backgroundColor;
   }
   else if( document.getElementById ) {
		var obj = document.getElementById(id);
		if( obj )
			obj.style.backgroundColor = backgroundColor;
		obj = document.getElementById(id+'a');
		if( obj )
		    setTimeout('document.getElementById("' + id + 'a").style.color = "' + fontColor + '";',10);
      
   }
}

function swapImageIn(id) {	
//	if (ns)
//		document.layers[id].document.images[id + "_arrow"].src = eval("arrow_on.src");
//	else 
	if (!ns)
		 document[id + "_arrow"].src = eval("arrow_on.src");
}

function swapImageOut(id) {	
//	if (ns) 
//		document.layers[id].document.images[id + "_arrow"].src = eval("arrow.src");
//	else 
	if (!ns)
		 document[id + "_arrow"].src = eval("arrow.src");
}

function set (id) {
	if (lastParent != null) {
		applyColorsTo (lastParent, ColorPBG, ColorPBGFont);	
		swapImageOut(lastParent);
	}
	if (ns)
		applyColorsTo(id, ColorPBGOnSetNN, ColorPBGFontOnSet);
	else {
		applyColorsTo(id, ColorPBGOnSet, ColorPBGFontOnSet);	
	}		 
	swapImageIn(id);
	lastParent = id;
}

function swapIn (id) {
	if (id == lastParent) return;
	else
		if(ns)
			applyColorsTo(id, ColorPBGOnSetNN, ColorPBGFontOnSet);
		else {
			applyColorsTo(id, ColorPBGOnSet, ColorPBGFontOnSet);
		}
		swapImageIn(id);
  }

function swapOut (id) {
   if (id == lastParent) return;
   else {
	if(ns)
	    applyColorsTo(id, ColorPBGNN, ColorPBGFont);
    else
	    applyColorsTo(id, ColorPBG, ColorPBGFont);
	swapImageOut(id);
	}
}

//finctions for top banner menu rollovers
function setB (id) {
	if (lastParentB != null) {
		applyColorsTo (lastParentB, ColorBBG, ColorBBGFont);	
		//swapImageOut(lastParentB);
	}
	if (ns)
		applyColorsTo(id, ColorBBGOnSetNN, ColorBBGFontOnSet);
	else {
		applyColorsTo(id, ColorBBGOnSet, ColorBBGFontOnSet);	
	}		
	lastParentB = id;
}

function swapInB (id) {
	if (id == lastParentB) return;
	else
		if(ns)
			applyColorsTo(id, ColorBBGOnSetNN, ColorBBGFontOnSet);
		else {
			applyColorsTo(id, ColorBBGOnSet, ColorBBGFontOnSet);
		}
  }

function swapOutB (id) {
   if (id == lastParentB) return;
   else {
    applyColorsTo(id, ColorBBG, ColorBBGFont);
	}
}

