YAHOO.namespace("example.container");

function showErrors( bIsCCError ) {
	
	var sErrorText = document.getElementById( 'reg_error' ).innerHTML;
	// Define various event handlers for Dialog
	var handleOK = function() {
		this.hide();
		hideWaitingImage( );
	};

	showWaitingImage( '', true );
	
	// Instantiate the Dialog
	YAHOO.example.container.simpledialog1 = new YAHOO.widget.SimpleDialog(	 "simpledialog1", 
																			 { width: "350px",	
																			   x: ( ( document.body.clientWidth / 2 ) - 175 ),
																			   y: ( document.body.clientHeight / 2 ),
																			   fixedcenter: false,
																			   zIndex: 9999,
																			   visible: true,
																			   draggable: true,
																			   close: false,
																			   text: sErrorText,
																			   icon: YAHOO.widget.SimpleDialog.ICON_WARN,
																			   constraintoviewport: true,
																			   buttons: [ { text:"OK", handler:handleOK, isDefault:true } ]
																						 
																			 } );
	YAHOO.example.container.simpledialog1.setHeader("There was a problem");
	
	YAHOO.example.container.simpledialog1.cfg.queueProperty('zIndex', 9999);
	YAHOO.example.container.simpledialog1.bringToTop( );
	
	// Render the Dialog
	YAHOO.example.container.simpledialog1.render(document.body);
	
	var oCardNumber = document.getElementById( 'card_number' );
	var oSecurityCode = document.getElementById( 'security_code' );
	if( bIsCCError )
	{		
		if( typeof( oCardNumber ) == 'object' )
		{
			oCardNumber.className += ' registration-error';
		}			
		if( typeof( oSecurityCode ) == 'object' )
		{
			oSecurityCode.className += ' registration-error';
		}			
	}
}