var openwin = { //打开模态窗口 openwebform: function(src, width, height, isshowscroll, ismodal) { var sfeasures = "location:no;status:no;help:no;dialogwidth:" + width + "px;dialogheight:" + height + "px;scroll:" + isshowscroll + ";"; if (ismodal) { return window.showmodaldialog(src, "", sfeasures); } else { var isshowbars = isshowscroll ? 'yes' : 'no'; return window.open(src, '孤狼部落', 'height=' + height + ',width=' + width + ',top=0,left=0,toolbar=yes,menubar=yes,scrollbars=' + isshowbars + ', resizable=yes,location=yes, status=yes'); } }, closewebform: function(val) { window.returnvalue = val; window.opener = null; window.open('', '_self'); window.close(); }, inidiv: function(divid, formid, wid, heih, title) { var tl = "新增"; if (title != undefined) tl = title; $('#' + divid).dialog({ autoopen: false, width: wid, height: heih, resizable: false, modal: true, title: tl }).parent().appendto("#" + formid); $(document).bind("keydown", function(event) { if (event.keycode == 13 && event.srcelement.type != 'button' && event.srcelement.type != 'submit' && event.srcelement.type != 'reset' && event.srcelement.type != 'textarea' && event.srcelement.type != '' && event.srcelement.type != 'image' && event.srcelement.type != 'file') { event.keycode = 9; } }) $('#' + divid).dialog('open'); }, closediv: function(divid) { $('#' + divid).dialog('close'); }, showdiv: function(divid, title, width, height) { displayfloatingdiv(divid, title, width, height); }, hiddendiv: function(divid) { hiddenfloatingdiv(divid); }, openincurpage: function(tourl) { window.document.location.href = tourl; }, openallscreenpage: function(tourl) { openwin.openwebform(tourl, window.screen.width, window.screen.height, true, false); } }