/* ---------------------------------------------------------------------------------------------
Author:	Brent McClintock --- bmcclintock@legis.state.pa.us
Date:	08/08/2002
Purpose: collection of functions i use alot with DHTML
Includes:
	1) showField(object_id)
	2) hideField(object_id)
	3) writeHTML(object_id, txtToOutput)
	4) highlight(id,on,colorOn,colorOff)
--------------------------------------------------------------------------------------------- */

//show the field
function showField(id)
{
	var thisObj = document.getElementById(id);
	thisObj.style.visibility = "visible"; 
}
//**********************************************************************************************
//hide the field
function hideField(id)
{
	var thisObj = document.getElementById(id);
	thisObj.style.visibility = "hidden"; 
}
//**********************************************************************************************
//write HTML using the innerHTML WC3 property
function writeHTML(id,mytxt) 
{ 
	var thisObj = document.getElementById(id);
	thisObj.innerHTML = mytxt; 
} 
//**********************************************************************************************
/*
	Highlights the given HTML element with a certain color
	@id: 		ID of structure to be highlighted
	@on: 		a 'light-switch', 1=highlight on, 0=highlight off
	@colorOn:	[OPTIONAL, defaults to 'gray'] color to use as highlight color when turned on
	@colorOff:	[OPTIONAL, defaults to 'transparent'] color to use as highlight color when turned off
*/
function highlight(id,on,colorOn,colorOff)
{
	//default the 'color' variables if they weren't passed
	if(!colorOn) { colorOn = "#DCDCDC"; }
	if(!colorOff){ colorOff = "transparent"; }
	
	var obj = document.getElementById(id);
	
	if(on)
	{ obj.style.backgroundColor = colorOn; }
	else
	{ obj.style.backgroundColor = colorOff; }
}
//**********************************************************************************************
