/* EFFECTS */

/** chg(rowobj, state)
 * General rollover for grid rows, white to light blue.
 * rowobj = obj; TR object
 * state = number; 1 (on) or 0 (off)
 * returns nothing
 **/
function chgRowBg(rowobj, state) {
	oncolor = '#ddddff';
	offcolor = 'white';
	rowTD = rowobj.getElementsByTagName('td');
	
	if (state==1) {
		for (i=0; i<rowTD.length; i++) {
			rowTD[i].style.background = oncolor ;
		}
	} else {
		for (i=0; i<rowTD.length; i++) {
			rowTD[i].style.background = offcolor ;
		}
	}
}

/** chgIconImg(iconobj, state)
 * Simple rollover for action icons. Assumes all icons have images for both states.
 * iconobj = object; icon image
 * state = number; 1 (on) or 0 (off)
 * returns nothing
 **/
function chgIconImg(iconobj, state) {
	if (state==1) {
		newimg = iconobj.src.replace(".png", "_hover.png");
		iconobj.src = newimg;
	} else {
		newimg = iconobj.src.replace("_hover.png", ".png");
		iconobj.src = newimg;
	}
}

/** toggleVisibility(objId)
 * Shows/Hides a specific object, referenced by id.
 * objId = str; id of target object
 * returns nothing
 **/
function toggleVisibility(objId) {
	if (document.getElementById(objId)) {
		obj = document.getElementById(objId);
		if (obj.style.visibility) {
			obj.style.visibility = (obj.style.visibility=='hidden') ? 'visible' : 'hidden' ;
			obj.style.display = (obj.style.display=='block') ? 'none' : 'block' ;
		}
	}
}
