function openDialog(title, url, width, height, options) { var opt = { type: 2, maxmin: false, title: title, shade: [0.1, '#000'], area: [width, height], content: [url, 'yes'], }; $.extend(opt, options); var index = top.layer.open(opt); } function closeDialog(windowName) { var index; if(windowName){ index = top.layer.getFrameIndex(windowName); }else{ index = top.layer.getFrameIndex(window.name); } window.setTimeout(function(){ top.layer.close(index) }, 0); } function closeAllDialog(){ top.layer.closeAll(); } if(top.layer){ //寮瑰嚭鎻愮ず window.alert = function (msg,fu){ top.layer.alert(msg, function(index){ if(typeof(fu) != 'undefined'){ fu(); } top.layer.close(index); }); }; // 寮瑰嚭纭妗 window.confirm = function(msg,fu){ top.layer.confirm(msg, function(index){ if(typeof(fu) != 'undefined'){ fu(); } top.layer.close(index); }); }; }