	/**
 * @author Paweł Skrzypiec
 * @desc confirm
 * @version 1.0
 * @example
 * @obs With no arguments, the default is update
 * @license free
 * @param string update container
 * @contribution Paweł Skrzypiec
 *
 */
(function($){  
	
 jQuery.extend({
	 
	 confirm: function(params) {
		
		$('body').append('<div id="confirm-window"></div>');
		
		var _showme = getObject('confirm-window');
		
		var _html = '\
			<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%" id="ui-dialog-table"> \
			<tr> \
				<td><img src="' + baseUrl +'/public/images/icon-error.png" /></td> \
				<td width="10">&nbsp;</td> \
				<td><div>' + params.content + '</div></td> \
			</tr> \
			<tr> \
				<td colspan="3" align="right" valign="bottom"> \
					<a href="javascript: void(null)" id="confirm-no"><img src="' + baseUrl + '/public/images/btt_no.gif" border="0" /></a> \
					<a href="javascript: void(null)" id="confirm-ok"><img src="' + baseUrl + '/public/images/btt_yes.gif" border="0" /></a> \
				</td> \
			</tr> \
			</table>';
		
		_showme.html(_html);
		
		_showme.dialog({
			autoOpen: false,
			width: params.width || 300,
			height: params.height || 100,
			draggable: false, 
			title: params.title || 'Wooloo Confirmation',
			dialogClass: 'flash-message',
			bgiframe: false,
			open: function(){
				_showme.find('#confirm-ok').click(function(){
					params.ok.apply();
					_showme.dialog('close');
					
					return false;
				});
				
				_showme.find('#confirm-no').click(function(){
					
					params.no.apply();
					_showme.dialog('close'); 
					
					return false;
				});
				
				_showme.find('#ui-dialog-table').height(_showme.height());
				_showme.show('fast');
			},
			resizable: false,
			hide: 'fast'
		});
		
		_showme.dialog('open');
		
		_showme.bind('dialogclose', function(){
			
			params.no.apply();
			jQuery(this).dialog('destroy');
			_showme.remove();
			
		});		
		
	}
	
	
 });

})(jQuery);

