(function(a){var c={},d={buttons:null,title:null,titleAlign:"center",buttonAlign:"center",bodyAlign:"center",buttonNoBorder:true,buttonBorderRadius:true,autoClose:0,onOpen:null,onClose:null,replaceAlert:false,bgWhite:false},b=0;a.MWIN=(function(){var m={};function n(K,M){if(arguments.length<2){return null}var L=null;for(var O=1;O0){A(M,N,R.pop(),L)}m[Q][N]=null;return}else{var K=-1;for(var P=0;P

';f(Q,"blocker"+(U.bgWhite===true?" white":""));K=q(Q);V=q(K);N=y(V);O=x(K);N.innerHTML=J((U.icon?'':"")+(P||U.content||""));K.style.alpha="0";K.style.opacity="0";K.style.filter="alpha(opacity=0)";Q.style.display="block";var L=new l(T,Q,V,N,O,U);L.args=arguments;c[T]=L;r(O,L);if(U.title===null){V.style.display="none";f(N,"dlg-body-notitle")}else{V.style.display="block";V.innerHTML=J(U.title)}if(U.width){if(typeof U.width=="number"){U.width=U.width+"px"}K.style.width=U.width}if(U.height){if(typeof U.height=="number"){U.height=(U.height-V.offsetHeight-O.offsetHeight)+"px"}N.style.height=U.height}if(U.autoClose&&typeof U.autoClose=="number"){window.setTimeout(function(){h(T,null)},U.autoClose)}F(V,U.titleAlign);F(N,U.bodyAlign);F(O,U.buttonAlign);if(w(U.onOpen)){U.onOpen.call(L)}if(typeof U.autoFix=="number"){L.fix(U.autoFix)}K.style.alpha="100%";K.style.opacity="1";K.style.filter="alpha(opacity=100%)";return L}function J(K){return'
'+K+"
"}function F(L,K){E(L,"align-left align-center align-right");f(L,"align-"+K)}function h(M,O){var N=o(M);if(!N){return}var K=c[M];if(K){if(O){if(w(O.callback)){if(O.callback.call(M,O.data)===false){return}}}if(w(K.options.onClose)){if(K.options.onClose.call(K,O)===false){return}}var L=K.buttonset;if(L){z(L,"click")}}N.parentNode.removeChild(N);c[M]=null}function s(L,K,M){B(document,L,function(O){O=O||event;if(!O){return}var Q=O.keyCode||O.witch;if(!Q){return}if(Q!=K){return}var R=x(document.body);if(!u(R,"blocker")){return}var N=c[R.id];if(!N){return}var S=N.callbacks;if(!S){return}for(var P=0;P0&&M.substr(U-1,1)!="\\"){P=M.substr(U+1);M=M.substr(0,U)}M=M.replace(/\\\./g,".");V.push({title:M,callback:typeof R=="string"?null:R,className:P,data:null,isDefault:false,isCancel:false,index:V.length})}}if(V.length==0){N.style.display="none"}else{N.style.display="block";var S="",M,Q=-1,O=[];for(var T=0;T'+M.title+""}N.innerHTML=J(S);if(Q>=0){N.getElementsByTagName("button")[Q].focus()}B(N,"click",function(X){var Y=p(X,W);if(!Y){return}h(W,Y)});L.callbacks=V}}}}function p(K,M){K=t(K||event);if(K&&K.nodeName&&K.nodeName.toLowerCase()!="button"){return null}var N=K.getAttribute("data-value");if(N===undefined){return null}var L;if(!c[M]||!(L=c[M]["callbacks"])){return null}N=parseInt(N);if(!L[N]){return null}return L[N]}function o(K){var L=document.getElementById(K);if(!L){if(c[K]){c[K]=null}return null}return L}function G(){var Q=null,M="",O=arguments.length,K,P={},L=0;if(O==0){return}for(var N=0;N',n(P,{title:Q||P.title,buttons:[{title:P.buttonText||"确定",callback:function(){if(w(M)){return M.call(this,document.getElementById(K).value)}}},{isCancel:true,title:P.buttonTextCancel||"取消",callback:P.onCancel,className:"btn-grey"}]}))}D.title=function(K){H("prompt",K)};function v(L,M){var K=c[L];if(!K){return}K.body.innerHTML=J(M)}function H(L,M){var K=c[L];if(!K){return}K.title.innerHTML=J(M)}s("keydown",13,"isDefault");s("keyup",27,"isCancel");return{any:k,open:k,close:h,tips:G,alert:g,confirm:i,html:v,prompt:D,title:H,options:function(K,L){if(L===undefined){return d[K]}d[K]=L;if(K=="replaceAlert"){if(L===true){window.alert=g}else{window.alert=e}}return this}}}());if(typeof jQuery!="undefined"){jQuery.dialog=a.MWIN}if(typeof Ajax!="undefined"){Ajax.postJson=function(h,f,e,g){g=g||{};if(g.tips){MWIN.tips(g.tips)}Ajax({url:h,data:f,method:"POST",dataType:"json",opts:g,complete:g.complete||function(){if(g.tips){MWIN.close("tips")}},error:g.error||function(){if(this.opts.errorAutoClose){MWIN.tips(this.opts.errorMessage||"请求失败,系统异常。",this.opts.errorAutoClose)}else{MWIN.alert(this.opts.errorMessage||"请求失败,系统异常。")}},succeed:function(i){if(!i.error){if(typeof e=="function"){e(i.data)}}else{if(this.opts.errorAutoClose){MWIN.tips(i.message,this.opts.errorAutoClose)}else{MWIN.alert(i.message)}}}})}}}(window));;