/* artDialog 5 | (c) 2009-2012 TangBin | http://code.google.com/p/artdialog/ */ (function(h,k,l){if("BackCompat"===document.compatMode)throw Error("artDialog: Document types require more than xhtml1.0");var m,q=0,p="artDialog"+ +new Date,u=k.VBArray&&!k.XMLHttpRequest,t="createTouch"in document&&!("onmousemove"in document)||/(iPhone|iPad|iPod)/i.test(navigator.userAgent),n=!u&&!t,e=function(a,b,c){a=a||{};if("string"===typeof a||1===a.nodeType)a={content:a,fixed:!t};var d;d=e.defaults;var f=a.follow=1===this.nodeType&&this||a.follow,g;for(g in d)a[g]===l&&(a[g]=d[g]);a.id=f&& f[p+"follow"]||a.id||p+q;if(d=e.list[a.id])return f&&d.follow(f),d.zIndex().focus(),d;if(!n)a.fixed=!1;if(!a.button||!a.button.push)a.button=[];if(b!==l)a.ok=b;a.ok&&a.button.push({id:"ok",value:a.okValue,callback:a.ok,focus:!0});if(c!==l)a.cancel=c;a.cancel&&a.button.push({id:"cancel",value:a.cancelValue,callback:a.cancel});e.defaults.zIndex=a.zIndex;q++;return e.list[a.id]=m?m.constructor(a):new e.fn.constructor(a)};e.version="5.0";e.fn=e.prototype={constructor:function(a){var b;this.closed=!1; this.config=a;this.dom=b=this.dom||this._getDom();a.skin&&b.wrap.addClass(a.skin);b.wrap.css("position",a.fixed?"fixed":"absolute");b.close[!1===a.cancel?"hide":"show"]();b.content.css("padding",a.padding);this.button.apply(this,a.button);this.title(a.title).content(a.content).size(a.width,a.height).time(a.time);a.follow?this.follow(a.follow):this.position();this.zIndex();a.lock&&this.lock();this._addEvent();this[a.visible?"visible":"hidden"]().focus();m=null;a.initialize&&a.initialize.call(this); return this},content:function(a){var b,c,d,f,g=this,e=this.dom.content,j=e[0];this._elemBack&&(this._elemBack(),delete this._elemBack);if("string"===typeof a)e.html(a);else if(a&&1===a.nodeType)f=a.style.display,b=a.previousSibling,c=a.nextSibling,d=a.parentNode,this._elemBack=function(){b&&b.parentNode?b.parentNode.insertBefore(a,b.nextSibling):c&&c.parentNode?c.parentNode.insertBefore(a,c):d&&d.appendChild(a);a.style.display=f;g._elemBack=null},e.html(""),j.appendChild(a),h(a).show();return this.position()}, title:function(a){var b=this.dom,c=b.outer,b=b.title;!1===a?(b.hide().html(""),c.addClass("d-state-noTitle")):(b.show().html(a),c.removeClass("d-state-noTitle"));return this},position:function(){var a=this.dom,b=a.wrap[0],c=a.window,d=a.document,f=this.config.fixed,a=f?0:d.scrollLeft(),d=f?0:d.scrollTop(),f=c.width(),e=c.height(),h=b.offsetHeight,c=(f-b.offsetWidth)/2+a,f=f=(h<4*e/7?0.382*e-h/2:(e-h)/2)+d,b=b.style;b.left=Math.max(c,a)+"px";b.top=Math.max(f,d)+"px";return this},size:function(a,b){var c= this.dom.main[0].style;"number"===typeof a&&(a+="px");"number"===typeof b&&(b+="px");c.width=a;c.height=b;return this},follow:function(a){var b=h(a),c=this.config;if(!a||!a.offsetWidth&&!a.offsetHeight)return this.position(this._left,this._top);var d=c.fixed,e=p+"follow",g=this.dom,s=g.window,j=g.document,g=s.width(),s=s.height(),r=j.scrollLeft(),j=j.scrollTop(),i=b.offset(),b=a.offsetWidth,k=d?i.left-r:i.left,i=d?i.top-j:i.top,o=this.dom.wrap[0],m=o.style,l=o.offsetWidth,o=o.offsetHeight,n=k-(l- b)/2,q=i+a.offsetHeight,r=d?0:r,d=d?0:j;m.left=(ng&&k-l>r?k-l+b:n)+"px";m.top=(q+o>s+d&&i-o>d?i-o:q)+"px";this._follow&&this._follow.removeAttribute(e);this._follow=a;a[e]=c.id;return this},button:function(){for(var a=this.dom.buttons,b=a[0],c=this._listeners=this._listeners||{},d=[].slice.call(arguments),e=0,g,k,j,l,i;eloading..',title:"消息窗口",button:null,ok:null,cancel:null,initialize:null,beforeunload:null,okValue:"确定",cancelValue:"取消",width:"auto",height:"auto",padding:"20px 25px",skin:null,time:null,esc:!0,focus:!0,visible:!0,follow:null,lock:!1,fixed:!1,zIndex:1987};this.artDialog=h.dialog=h.artDialog=e})(this.art||this.jQuery,this);