/*
	msgBox 1.0
	by Chris Lee (leechangju@gmail.com)
	Date: 10/04/2010
*/

var msgBox = {
	setup: function() {
		$("body").append('<div id=\"msgbox\" title=\"Message\"></div>');
	},
	show: function(msg, focusid) {
		$("#dialog").dialog("destroy");
		$("#msgbox").html("<font size=2>" + msg + "</font>");
		$("#msgbox").dialog({
			width: 450,
			height: 200,
			resizable: false,
			modal: true,
			buttons: { "Ok": function() { $(this).dialog("close"); } } ,
    	open: function(event, ui){$('body').css('overflow','hidden');$('.ui-widget-overlay').css('width','100%'); },
    	close: function(event, ui){
    		$('body').css('overflow','auto');
    		$(focusid).focus();
    		$(focusid).select();
    	}
		});
	}
};

jQuery(document).ready(function(){
	msgBox.setup();
})
