	/**** jQuery Dialog ****/
	Dialog = {
		element : '#dialog',
		modal_val : false,
		width_val : null,
		height_val : null,
		pos_val : 'center',
		resize_val : false,
		title_val : 'Clean Station',		
		btn_obj : {
			OK: function() {
				$(this).dialog('close');
			}
		},
		
		init : function( width_val, height_val, title_val ) {
			$(this.element).attr('style', 'text-align:left; display:none;');
			$(this.element).dialog("destroy");
			
			if (width_val != undefined) {			
				this.width_val = width_val;
			}
			
			if (height_val != undefined) {
				this.height_val = height_val;
			}
			
			if (title_val != undefined) {
				this.title_val = this.title_val + ' - ' + title_val;
			}
		},
		
		reset : function() {
			this.title_val = 'Focus CMS';
			this.btn_obj = {
				OK: function() {
					$(this).dialog('close');
				}
			};
		},
		
		open : function(element_val) {
			if (element_val != undefined) {
				this.element = element_val;
			}
			
			$(this.element).dialog({
				modal : this.modal_val,				
				width : this.width_val,
				height : this.height_val,
				resizable : this.resize_val,
				position : this.pos_val,			
				title : this.title_val
			})
			.dialog('open');
			
			Dialog.reset();
			//Dialog.fix_bug();
		},
		
		msg_dialog : function (element_val, btn_val) {
			if (element_val != undefined) {
				this.element = element_val;
			}
			
			if (btn_val != undefined) {
				this.btn_obj = btn_val;
			}
			
			$(this.element).dialog({
				dialogClass : 'msg_dialog',	
				closeOnEscape : false,
				modal : this.modal_val,				
				width : this.width_val,
				height : this.height_val,
				resizable : this.resize_val,
				position : this.pos_val,			
				title : this.title_val,				
				buttons: this.btn_obj				
			})
			.dialog('open');
			
			Dialog.reset();
			//Dialog.fix_bug();
		},
		
		blank_dialog : function( element_val ) {
			if (element_val != undefined) {
				this.element = element_val;
			}
			
			$(this.element).dialog({
				dialogClass : 'focus_blank',	
				modal : this.modal_val,				
				width : this.width_val,
				height : this.height_val,
				resizable : this.resize_val,
				position : this.pos_val,			
				title : this.title_val,
				buttons: {
					
				}
			})
			.dialog('open');
			
			Dialog.reset();
			Dialog.fix_bug();		
		},
		
		fix_bug : function() {
			$(this.element).parent().css('width', '');
			$(this.element).attr('style', '');
		},
		
		close : function() {
			$(this.element).dialog('close');
		}
	};
