(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));; (function(){var Ajax=window.Ajax=function(opt){for(var key in opt){if(!opt.hasOwnProperty(key)){continue}if(cnames[key]){opt[cnames[key]]=opt[key]}}opt=extend(copy(Ajax.Setting),opt?opt:{});if(opt.form&&(opt.form.nodeName.toLowerCase()=="form")){opt=extend(opt,parse_form(opt.form,opt.charset))}send(opt)};function empty_fn(){}var cnames={beforeSend:"beforesend",success:"succeed",type:"method"};Ajax.Setting={async:true,url:"",dataType:"text",contentType:"",method:"GET",data:"",form:null,timeout:0,charset:"utf-8",username:"",userpwd:"",headers:{},cache:false,succeed:empty_fn,error:empty_fn,beforesend:empty_fn,complete:empty_fn,context:null,jsonp:"callback",statusCode:{},scriptCharset:""};var CONTENTTYPES={text:"text/plain",xml:"text/xml",json:"application/json"};function parse_form(frm,charset){var data=Ajax.Serialize(frm,charset);var opt={method:(frm.method||"GET").toUpperCase(),url:frm.action,data:data};if(opt.method=="GET"&&data){var index=opt.url.indexOf("?");if(index>=0){opt.url=opt.url.substr(0,index)}opt.url+="?"+data;opt.data=null}return opt}var encode={gb:function(str){return escape(str||"").replace(/\+/igm,"%2B")},utf8:function(str){return encodeURIComponent(str||"").replace(/\+/igm,"%2B")}};function is_function(a){if(!a){return false}return typeof a=="function"}function get_obj(){var b=null;if(window.XMLHttpRequest){b=new XMLHttpRequest();get_obj=function(){return new XMLHttpRequest()}}else{if(window.ActiveXObject){var httplist=["MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp","MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0"];for(var i=httplist.length-1;i>=0;i--){try{get_obj=(function(obj){return function(){return new ActiveXObject(obj)}})(httplist[i]);b=get_obj()}catch(ex){}}}}return b}function response(a,s){var context=s.context||s;s.complete.call(context,this);if(a.status!=200){if(s.statusCode[a.status]){s.statusCode[a.status].call(context,a.status,a)}else{s.error.call(context,a.status,a)}return}var t=s.dataType,args=a.responseText,contentType=(a.getResponseHeader("Content-Type")||"").toLowerCase();if(t=="script"||contentType.indexOf("text/javascript")>=0){try{eval(args)}catch(ex){s.error.call(context,-4,a)}if(s.id&&window[s.id]){window[s.id]=null}return}else{if(t=="xml"||contentType.indexOf("text/xml")>=0){try{var Dom;try{Dom=new ActiveXObject("MSXML2.DomDocument")}catch(ex){Dom=document.implementation.createDocument("","",null)}Dom.loadXML(args);args=Dom}catch(ex){s.error.call(context,-3,a);return}}else{if(t=="json"||contentType.indexOf("application/json")>=0||contentType.indexOf("text/json")>=0){try{if(typeof JSON!="undefined"&&JSON.parse){args=JSON.parse(args)}else{args=(new Function("return "+args+";"))()}}catch(ex){s.error.call(context,-2,a,ex);return}}}}s.succeed.call(context,args,a)}var locat=window.location,protocol=locat.protocol,port=locat.port||(protocol.indexOf("https")>=0?"443":"80"),host=locat.host,origin=locat.origin||parse_url(window.location.href).origin;function parse_url(url){var rmatch=/^((?:.+?)\:)\/\/([\s\S]+?)(?:\:(\d+))?(\/(?:[\s\S]*?))?(\?(?:[\s\S]*?))?(\#(?:[\s\S]*?))?$/.exec(url);if(rmatch){return{hash:rmatch[6],host:rmatch[2],hostname:rmatch[2],href:rmatch[0],origin:rmatch[1]+"//"+rmatch[2]+(rmatch[3]?":"+rmatch[3]:""),pathname:rmatch[4]||"/",port:rmatch[3]||(rmatch[1].indexOf("https")>=0?"443":"80"),protocol:rmatch[1],search:rmatch[5]}}rmatch=/^([\s\S]+?)(\?(?:[\s\S]*?))?(\#(?:[\s\S]*?))?$/.exec(url);if(rmatch){var pathname=rmatch[1];if(!pathname){pathname=locat.pathname}else{if(pathname.substr(0,1)!="/"){var lpath=locat.pathname,rreg=/\/([^\/]+?)\/\.\./;lpath=lpath.substr(0,lpath.lastIndexOf("/")+1);pathname=lpath+pathname;while(rreg.test(pathname)){pathname=pathname.replace(rreg,"")}pathname=pathname.replace(/\.\.\//g,"");pathname=pathname.replace(/\.\//g,"")}}return{hash:rmatch[3],host:host,hostname:host,href:protocol+"//"+host+((port!="80"&&port!="443")?":"+port:"")+pathname+rmatch[2]+rmatch[3],origin:protocol+"//"+host+((port!="80"&&port!="443")?":"+port:""),pathname:pathname,port:port,protocol:protocol,search:rmatch[2]}}return null}function send_crossdomain(s,callback){var script=document.createElement("script"),head=document.head||document.getElementsByTagName("head")[0]||document.documentElement;function dispose(){script.onload=script.onreadystatechange=null;if(script.parentNode){script.parentNode.removeChild(script)}script=null}script.async=true;if(s.scriptCharset){script.charset=s.scriptCharset}script.src=s.url;script.onload=script.onreadystatechange=function(){if(!script.readyState||/loaded|complete/.test(script.readyState)){dispose();if(callback){callback(200)}}};head.insertBefore(script,head.firstChild)}function send(s){var context=s.context||s,a=null,d=null;s.method=s.method.toUpperCase();s.charset=s.charset.toLowerCase();if(s.url&&s.url.slice(-1)=="?"){s.url=s.url.substr(0,s.url.length-1)}s.url=s.url.replace(/#(.*?)$/,"").replace("callback=?","");var URL=parse_url(s.url);if(s.data){d=s.data;if(typeof d=="object"){d=Ajax.SerializeJson(d,s.charset)}}if(s.dataType=="jsonp"){s.originDataType="jsonp";s.id="ajax_"+Math.random().toString().substr(2);s.dataType="script";s.url+=(URL.search?"&":"?")+s.jsonp+"="+s.id;window[s.id]=function(){s.succeed.apply(context,arguments)}}if(origin!=URL.origin&&s.dataType=="script"){send_crossdomain(s,s.originDataType=="jsonp"?null:function(){s.succeed.apply(context,arguments)});return}if(d){if(!s.headers["Content-Type"]){if(!s.contentType){s.headers["Content-Type"]="application/x-www-form-urlencoded"}else{s.headers["Content-Type"]=CONTENTTYPES[s.contentType]||s.contentType}}}if((s.method=="GET"||s.method=="HEAD")&&!s.cache){s.headers["If-Modified-Since"]=0;s.headers["Cache-Control"]="no-cache"}try{a=get_obj();if(s.async){a.onreadystatechange=function(){if(a.readyState==4){response.apply(s,[a,s])}}}if(s.timeout>0){try{a.timeout=s.timeout}catch(ex){}}s.beforesend.call(context,a);if(s.username&&s.username!=""){a.open(s.method,s.url,s.async,s.username,s.userpwd)}else{a.open(s.method,s.url,s.async)}for(var h in s.headers){if(!s.headers.hasOwnProperty(h)){continue}a.setRequestHeader(h,s.headers[h])}a.send(d);if(!s.async&&a.readyState==4){response.apply(s,[a,s])}}catch(ex){s.complete.call(context,a);s.error.call(context,ex.description,a)}}function extend(a){if(arguments.length<2){return null}var arg=null;for(var i=1;i