Dialog = {
	_width : 300,
	_height: 80,

	_getXY : function()
	{
		var region = YAHOO.util.Dom.getRegion("content-main");
		var client = YAHOO.util.Dom.getClientRegion();
		if (region == null)
			region = client;
		
		if(region.bottom > client.bottom) region.bottom = client.bottom;
		
		var x = (region.right + region.left - this._width)/2;
		var y = (region.bottom + region.top - this._height)/2;
		
		return [x, y];
	},
	
	showDialog : function (title, text, iconType)
	{
		var xy = this._getXY();
		
    	var dialog =
        	new YAHOO.widget.SimpleDialog("simpledialog",
                 { width: this._width,
        		   xy : xy,
                   fixedcenter: false,
                   visible: false,
                   draggable: true,
                   modal:true,
                   close: true,
                   text: text,
                   icon: iconType,
                   constraintoviewport: true,
                   buttons: [ { text:"OK", handler:function (){this.hide()}, isDefault:true }]
                 } );

    	dialog.setHeader(title);

	    dialog.render(document.body);
    	dialog.show();
    },

	showConfirmDialog : function (title, text, callback)
	{
    	var xy = this._getXY();
    	var dialog =
        	new YAHOO.widget.SimpleDialog("confirmdialog",
             { width: this._width,
        	   xy : xy,
        	   fixedcenter: false,
               visible: false,
               draggable: true,
               modal:true,
               close: true,
               text: text,
               icon: YAHOO.widget.SimpleDialog.ICON_HELP,
               constraintoviewport: true,
               buttons: [ { text:messages.global.button_yes, handler: callback, isDefault:true },
                          { text:messages.global.button_no,  handler: callback}
                        ]
             } );

	    dialog.setHeader(title);
	
	    dialog.render(document.body);
	    dialog.show();
	    return dialog;
	}
}