(function($){
$.pdialog = {
_op:{height:300, width:580, minH:40, minW:50, total:20, max:false, mask:false, resizable:true, drawable:true, maxable:true,minable:true,fresh:true},
_current:null,
_zIndex:42,
getCurrent:function(){
return this._current;
},
reload:function(url, options){
var op = $.extend({data:{}, dialogId:"", callback:null}, options);
var dialog = (op.dialogId && $("body").data(op.dialogId)) || this._current;
if (dialog){
var jDContent = dialog.find(".dialogContent");
jDContent.ajaxUrl({
type:"POST", url:url, data:op.data, callback:function(response){
jDContent.find("[layoutH]").layoutH(jDContent);
$(".pageContent", dialog).width($(dialog).width()-14);
$(":button.close", dialog).click(function(){
$.pdialog.close(dialog);
return false;
});
if ($.isFunction(op.callback)) op.callback(response);
}
});
}
},
/**
* 切换当前层
* @param {Object} dialog
*/
switchDialog:function(dialog) {
var index = $(dialog).css("zIndex");
$.pdialog.attachShadow(dialog);
if($.pdialog._current) {
var cindex = $($.pdialog._current).css("zIndex");
$($.pdialog._current).css("zIndex", index);
$(dialog).css("zIndex", cindex);
$("div.shadow").css("zIndex", cindex - 1);
$.pdialog._current = dialog;
}
$.taskBar.switchTask(dialog.data("id"));
},