

/*--------------------------------------------------
 register.js

 Date: 10/19/2006
 Purpose: Registration-related JavaScript functionality
/--------------------------------------------------*/





/***************************************************
 toggleContainer()

 Date: 12/12/2007
 Purpose: Toggle container display based on condition.
 containers parameter can be a string or an array
***************************************************/

function toggleContainer( containers, condition ) {
	var c;
	// Convert containers to an array, if not one already
	containers = Object.isArray( containers ) ? containers : [ containers ];
	// To display or not to display
	containers.each( function( e ){ if( c = $( e ) ) { condition ? c.show() : c.hide(); } } );
}



/*******************************************************************
 clearSelectBox()

 Date: 4/13/2007
 Purpose: Clear a select box's selected values
********************************************************************/	

function clearSelectBox( element ) {
	if( elem = $(element) ) {
		for( i = 0; i < elem.options.length; i++ ) {
			elem.options[i].selected = false;
		}
	}
}



/***************************************************
 confirmChange( confirmButton )

 Date: 10/25/2006
 Purpose: Events after clicking confirm button
***************************************************/

function confirmChange( confirmButton ) {
	if( c = $( confirmButton ) ) {
		c.value = "Please wait...";
		c.disabled = true;
		c.blur();
		document.forms[1].submit();
	}
}







