

var waitTimer = null;




function Wait_Show()
{	
	var waitPanel = document.getElementById( "waitPanel" );
	CenterObj( waitPanel );
	
	Controls_Hide();

	var opacity = new fx.Opacity( waitPanel, {duration: 200} );
	opacity.hide();
	opacity.toggle();
}


function Wait_Hide()
{
	var panel = document.getElementById( "waitPanel ");
	
	if( panel != null )	
		panel.style = "hidden";
}


function Controls_Hide()
{
	var controls = document.getElementsByTagName( "SELECT" );
	
	for( var index=0; index<controls.length; index++)
	{
		new fx.Opacity( controls[ index ], {duration: 400} ).hide();
	}
}


function Wait_AppendItem( item )
{
	if( item.length > 0 )
	{			
		var waitList = document.getElementById( "wait-list" );
		var div = document.createElement( "DIV" );
		div.innerHTML = item;				
							
		var opacity = new fx.Opacity( div, {duration: 450} );
		opacity.hide();
		
		waitList.appendChild( div );						
		opacity.toggle();			
	}	
}


function Wait_Update( request )
{
	var items = null;
			
	if(( request != null ) && ( request.responseText != "" ))
	{
		eval( "items = new Array(" + request.responseText + ")" );
		
		if( items != null )		
			for( var i=0; i< items.length; i++ )			
				Wait_AppendItem( items[ i ] );
	}
}


function Wait_OnUpdate()
{
	new ajax( "getWaitPanelInfo.aspx", {onComplete: Wait_Update} );
}


