/******************************************************************************
Description:
	Embedded resource file for dynamic panels. A dynamic panel has a property
	do show/hide the panel without being rendered. This can assist with more
	dynamic html pages as it reduces having to have a callback to show/hide a
	control by using the visible property.
******************************************************************************/

// shows the panel.
function swc_showPanel(panelID)
{
    var control = swc_getById(panelID);
    
    if ( control != null )
    {
	    control.style.display = "block";
	    control.setAttribute("Displayed", "true");	    
	}
}

// hides the panel.
function swc_hidePanel(panelID)
{
    var control = swc_getById(panelID);
    
    if ( control != null )
    {
	    control.style.display = "none";
	    control.setAttribute("Displayed", "false");	    
	}
}

// toggles the panels visibility. This is a variable argument list.
// parameter: a variable list argument list containing clientID's to 
//   toggle view.
function swc_togglePanelDisplay()
{
	var displayed = "none";
	for (var i = 0; i < swc_togglePanelDisplay.arguments.length; ++i) 
	{
	    var control = swc_getById(swc_togglePanelDisplay.arguments[i]);
	    if ( control != null )
	    {
		    displayed = control.style.display;

		    if ( displayed == "block" || displayed == "" )
		    {
			    swc_hidePanel(swc_togglePanelDisplay.arguments[i]);
		    }
		    else 
		    {
			    swc_showPanel(swc_togglePanelDisplay.arguments[i]);
		    }
		}
	}
}
