/* Author: Valerio Battaglia (vabatta)
* Description: Function to create dialog box. You can have a dialog box open at once.
* Version: 1.0a
*
* Params:
* title - Title of the dialog box (HTML format)
* content - Content of the dialog box (HTML format)
* draggable - Set draggable to dialog box, available: true, false (default: false)
* overlay - Set the overlay of the page, available: true, false (default: true)
* closeButton - Enable or disable the close button, available: true, false (default: false)
* buttonsAlign - Align of the buttons, available: left, center, right (default: center)
* buttons - Set buttons in the action bar (JSON format)
* name - Text of the button (JSON format)
* action - Function to bind to the button
* position - Set the initial position of the dialog box (JSON format)
* zone - Zone of the dialog box, available: left, center, right (default: center)
* offsetY - Top offset pixels
* offsetX - Left offset pixels
*
* Goal for next versions:
* Add style param to set custom css to the dialog box controls
* Add possibility to resize window
*/
(function($) {
$.Dialog = function(params) {
if(!$.DialogOpened) {
$.DialogOpened = true;
} else {
return false;
}
params = $.extend({'position':{'zone':'center'},'overlay':true}, params);
var buttonsHTML = '