/* constants */
var bcms_root = '/BCMSGold/';

/* General Open Window Function... 
Arguments: url, name, width (int), height (int), scrollbars (boolean 0 or 1)--
width, height, and scrollbars values are optional.*/
function openWin(url, name, w, h, s) {
	if (w) { w = "width=" + w; } else { w = "width=300" }
	if (h) { h = "height=" + h; } else { h = "height=400"}
	if (s) { s = "scrollbars=" + s } else { s = "scrollbars=0" }
	messagewindow = window.open(url, name, ""+w+","+h+","+s+",menubar=no,top=50,left=50,resizable=yes");
	messagewindow.focus();
}

/* Swap Image.
imgName	= string; name parameter of target image
state   = boolean (int); either 0 (Off, default state) or 1 (On)
*/
function chgImg(imgName,state) {
	suffix = document.images[imgName].src.substr(document.images[imgName].src.length-3);
	if(document.images) {
		if (state == 1) {
			document.images[imgName].src = bcms_root+"/img/"+imgName+"_hi."+suffix;
		}
		else {
			document.images[imgName].src = bcms_root+"/img/"+imgName+"_off."+suffix;
		}
	}
}

/* Swap object's background color via the style tag. */
function chgBG(obj,color) {
	obj.style.background = color;
}

/* Swap a font's color inside an Object */
function chgFontColor(cellID,fontColor) {
	cell     = cellID;
	newColor = fontColor;
	if ((document.getElementById) || (document.getElementById && !document.all)) {
		document.getElementById(cell).style.color = newColor;
	}
}

/* Swap a className for an object. */
function chgClassName(obj,newclass) {
	obj.className = newclass;
}
