www.gusucode.com > iWebshop开源PHP商城系统 v2.8源码程序 > iwebshop/lib/web/js/source/artdialog/artDialog.js

    /*!
 * artDialog 4.1.6
 * Date: 2012-07-16 22:57
 * http://code.google.com/p/artdialog/
 * (c) 2009-2012 TangBin, http://www.planeArt.cn
 *
 * This is licensed under the GNU LGPL, version 2.1 or later.
 * For details, see: http://creativecommons.org/licenses/LGPL/2.1/
 */(function(g,h){function n(b){var d=c.expando,e=b===g?0:b[d];e===h&&(b[d]=e=++c.uuid);return e}function p(){if(!c.isReady){try{document.documentElement.doScroll("left")}catch(b){setTimeout(p,1);return}c.ready()}}var c=g.art=function(b,d){return new c.fn.init(b,d)},v=!1,r=[],s,l="opacity"in document.documentElement.style,t=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,m=/[\n\t]/g,q=/alpha\([^)]*\)/i,z=/opacity=([^)]*)/,x=/^([+-]=)?([\d+-.]+)(.*)$/;if(g.$===h)g.$=c;c.fn=c.prototype={constructor:c,ready:function(b){c.bindReady();c.isReady?b.call(document,c):r&&r.push(b);return this},hasClass:function(b){return-1<(" "+this[0].className+" ").replace(m," ").indexOf(" "+b+" ")?!0:!1},addClass:function(b){this.hasClass(b)||(this[0].className+=" "+b);return this},removeClass:function(b){var d=this[0];if(b){if(this.hasClass(b))d.className=d.className.replace(b," ")}else d.className="";return this},css:function(b,d){var e,a=this[0];if("string"===typeof b){if(d===h)return c.css(a,b);"opacity"===b?c.opacity.set(a,d):a.style[b]=d}else for(e in b)"opacity"===e?c.opacity.set(a,b[e]):a.style[e]=b[e];return this},show:function(){return this.css("display","block")},hide:function(){return this.css("display","none")},offset:function(){var b=this[0],d=b.getBoundingClientRect(),c=b.ownerDocument,b=c.body,c=c.documentElement;return{left:d.left+(self.pageXOffset||c.scrollLeft)-(c.clientLeft||b.clientLeft||0),top:d.top+(self.pageYOffset||c.scrollTop)-(c.clientTop||b.clientTop||0)}},html:function(b){var d=this[0];if(b===h)return d.innerHTML;c.cleanData(d.getElementsByTagName("*"));d.innerHTML=b;return this},remove:function(){var b=this[0];c.cleanData(b.getElementsByTagName("*"));c.cleanData([b]);b.parentNode.removeChild(b);return this},bind:function(b,d){c.event.add(this[0],b,d);return this},unbind:function(b,d){c.event.remove(this[0],b,d);return this}};c.fn.init=function(b,d){var e,d=d||document;if(!b)return this;if(b.nodeType)return this[0]=b,this;if("body"===b&&d.body)return this[0]=d.body,this;if("head"===b||"html"===b)return this[0]=d.getElementsByTagName(b)[0],this;if("string"===typeof b&&(e=t.exec(b))&&e[2])return(e=d.getElementById(e[2]))&&e.parentNode&&(this[0]=e),this;if("function"===typeof b)return c(document).ready(b);this[0]=b;return this};c.fn.init.prototype=c.fn;c.noop=function(){};c.isWindow=function(b){return b&&"object"===typeof b&&"setInterval"in b};c.isArray=function(b){return"[object Array]"===Object.prototype.toString.call(b)};c.fn.find=function(b){var d=this[0],e=b.split(".")[1];if(e)if(document.getElementsByClassName)e=d.getElementsByClassName(e);else{for(var a=b=0,f=[],d=(d||document).getElementsByTagName("*"),k=d.length,e=RegExp("(^|\\s)"+e+"(\\s|$)");b<k;b++)e.test(d[b].className)&&(f[a]=d[b],a++);e=f}else e=d.getElementsByTagName(b);return c(e[0])};c.each=function(b,d){var c,a=0,f=b.length;if(f===h)for(c in b){if(!1===d.call(b[c],c,b[c]))break}else for(c=b[0];a<f&&!1!==d.call(c,a,c);c=b[++a]);return b};c.data=function(b,d,e){var a=c.cache,b=n(b);if(d===h)return a[b];a[b]||(a[b]={});e!==h&&(a[b][d]=e);return a[b][d]};c.removeData=function(b,d){var e=!0,a=c.expando,f=c.cache,k=n(b),w=k&&f[k];if(w)if(d){delete w[d];for(var y in w)e=!1;e&&delete c.cache[k]}else delete f[k],b.removeAttribute?b.removeAttribute(a):b[a]=null};c.uuid=0;c.cache={};c.expando="@cache"+ +new Date;c.event={add:function(b,d,e){var i;var a,f=c.event;a=c.data(b,"@events")||c.data(b,"@events",{});i=a[d]=a[d]||{},a=i;(a.listeners=a.listeners||[]).push(e);if(!a.handler)a.elem=b,a.handler=f.handler(a),b.addEventListener?b.addEventListener(d,a.handler,!1):b.attachEvent("on"+d,a.handler)},remove:function(b,d,e){var a,f,k;f=c.event;var w=!0,y=c.data(b,"@events");if(y)if(d){if(f=y[d]){k=f.listeners;if(e)for(a=0;a<k.length;a++)k[a]===e&&k.splice(a--,1);else f.listeners=[];if(0===f.listeners.length){b.removeEventListener?b.removeEventListener(d,f.handler,!1):b.detachEvent("on"+d,f.handler);delete y[d];f=c.data(b,"@events");for(var i in f)w=!1;w&&c.removeData(b,"@events")}}}else for(a in y)f.remove(b,a)},handler:function(b){return function(d){for(var d=c.event.fix(d||g.event),e=0,a=b.listeners,f;f=a[e++];)!1===f.call(b.elem,d)&&(d.preventDefault(),d.stopPropagation())}},fix:function(b){if(b.target)return b;var c={target:b.srcElement||document,preventDefault:function(){b.returnValue=!1},stopPropagation:function(){b.cancelBubble=!0}},e;for(e in b)c[e]=b[e];return c}};c.cleanData=function(b){for(var d=0,e,a=b.length,f=c.event.remove,k=c.removeData;d<a;d++)e=b[d],f(e),k(e)};c.isReady=!1;c.ready=function(){if(!c.isReady){if(!document.body)return setTimeout(c.ready,13);c.isReady=!0;if(r){for(var b,d=0;b=r[d++];)b.call(document,c);r=null}}};c.bindReady=function(){if(!v){v=!0;if("complete"===document.readyState)return c.ready();if(document.addEventListener)document.addEventListener("DOMContentLoaded",s,!1),g.addEventListener("load",c.ready,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",s);g.attachEvent("onload",c.ready);var b=!1;try{b=null==g.frameElement}catch(d){}document.documentElement.doScroll&&b&&p()}}};document.addEventListener?s=function(){document.removeEventListener("DOMContentLoaded",s,!1);c.ready()}:document.attachEvent&&(s=function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",s),c.ready())});c.css="defaultView"in document&&"getComputedStyle"in document.defaultView?function(b,c){return document.defaultView.getComputedStyle(b,!1)[c]}:function(b,d){return("opacity"===d?c.opacity.get(b):b.currentStyle[d])||""};c.opacity={get:function(b){return l?document.defaultView.getComputedStyle(b,!1).opacity:z.test((b.currentStyle?b.currentStyle.filter:b.style.filter)||"")?parseFloat(RegExp.$1)/100+"":1},set:function(b,c){if(l)return b.style.opacity=c;var e=b.style;e.zoom=1;var a="alpha(opacity="+100*c+")",f=e.filter||"";e.filter=q.test(f)?f.replace(q,a):e.filter+" "+a}};c.each(["Left","Top"],function(b,d){var e="scroll"+d;c.fn[e]=function(){var a=this[0],f;return(f=c.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1)?"pageXOffset"in f?f[b?"pageYOffset":"pageXOffset"]:f.document.documentElement[e]||f.document.body[e]:a[e]}});c.each(["Height","Width"],function(b,d){var e=d.toLowerCase();c.fn[e]=function(a){var f=this[0];return!f?null==a?null:this:c.isWindow(f)?f.document.documentElement["client"+d]||f.document.body["client"+d]:9===f.nodeType?Math.max(f.documentElement["client"+d],f.body["scroll"+d],f.documentElement["scroll"+d],f.body["offset"+d],f.documentElement["offset"+d]):null}});c.ajax=function(b){var d=g.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),e=b.url;if(!1===b.cache)var a=+new Date,f=e.replace(/([?&])_=[^&]*/,"$1_="+a),e=f+(f===e?(/\?/.test(e)?"&":"?")+"_="+a:"");d.onreadystatechange=function(){if(4===d.readyState&&200===d.status)b.success&&b.success(d.responseText),d.onreadystatechange=c.noop};d.open("GET",e,1);d.send(null)};c.fn.animate=function(b,d,e,a){"function"===typeof e&&(a=e);var e=e&&c.easing[e]?e:"swing",f=this[0],k,w,y,i,j,u,o={speed:d||400,easing:e,callback:function(){if(null!=k)f.style.overflow="";a&&a()},curAnim:{}};c.each(b,function(a,f){o.curAnim[a]=f});c.each(b,function(a,b){w=new c.fx(f,o,a);y=x.exec(b);i=parseFloat("opacity"===a||f.style&&null!=f.style[a]?c.css(f,a):f[a]);j=parseFloat(y[2]);u=y[3];if("height"===a||"width"===a)j=Math.max(0,j),k=[f.style.overflow,f.style.overflowX,f.style.overflowY];w.custom(i,j,u)});if(null!=k)f.style.overflow="hidden";return this};c.timers=[];c.fx=function(b,c,e){this.elem=b;this.options=c;this.prop=e};c.fx.prototype={custom:function(b,d,e){function a(){return f.step()}var f=this;f.startTime=c.fx.now();f.start=b;f.end=d;f.unit=e;f.now=f.start;f.state=f.pos=0;a.elem=f.elem;a();c.timers.push(a);if(!c.timerId)c.timerId=setInterval(c.fx.tick,13)},step:function(){var b=c.fx.now(),d=!0;if(b>=this.options.speed+this.startTime){this.now=this.end;this.state=this.pos=1;this.update();this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)!0!==this.options.curAnim[e]&&(d=!1);d&&this.options.callback.call(this.elem);return!1}b-=this.startTime;this.state=b/this.options.speed;this.pos=c.easing[this.options.easing](this.state,b,0,1,this.options.speed);this.now=this.start+(this.end-this.start)*this.pos;this.update();return!0},update:function(){"opacity"===this.prop?c.opacity.set(this.elem,this.now):this.elem.style&&null!=this.elem.style[this.prop]?this.elem.style[this.prop]=this.now+this.unit:this.elem[this.prop]=this.now}};c.fx.now=function(){return+new Date};c.easing={linear:function(b,c,e,a){return e+a*b},swing:function(b,c,e,a){return(-Math.cos(b*Math.PI)/2+0.5)*a+e}};c.fx.tick=function(){for(var b=c.timers,d=0;d<b.length;d++)!b[d]()&&b.splice(d--,1);!b.length&&c.fx.stop()};c.fx.stop=function(){clearInterval(c.timerId);c.timerId=null};c.fn.stop=function(){for(var b=c.timers,d=b.length-1;0<=d;d--)b[d].elem===this[0]&&b.splice(d,1);return this};return c})(window);(function(g,h,n){g.noop=g.noop||function(){};var p,c,v,r,s=0,l=g(h),t=g(document),m=g("html");v=document.documentElement;var q=h.VBArray&&!h.XMLHttpRequest,z="createTouch"in document&&!("onmousemove"in v)||/(iPhone|iPad|iPod)/i.test(navigator.userAgent),x="artDialog"+ +new Date,b=function(a,f,c){a=a||{};if("string"===typeof a||1===a.nodeType)a={content:a,fixed:!z};var d;d=b.defaults;var e=a.follow=1===this.nodeType&&this||a.follow,i;for(i in d)a[i]===n&&(a[i]=d[i]);g.each({ok:"yesFn",cancel:"noFn",close:"closeFn",init:"initFn",okVal:"yesText",cancelVal:"noText"},function(f,b){a[f]=a[f]!==n?a[f]:a[b]});"string"===typeof e&&(e=g(e)[0]);a.id=e&&e[x+"follow"]||a.id||x+s;d=b.list[a.id];if(e&&d)return d.follow(e).zIndex().focus();if(d)return d.zIndex().focus();if(z)a.fixed=!1;if(!g.isArray(a.button))a.button=a.button?[a.button]:[];if(f!==n)a.ok=f;if(c!==n)a.cancel=c;a.ok&&a.button.push({name:a.okVal,callback:a.ok,focus:!0});a.cancel&&a.button.push({name:a.cancelVal,callback:a.cancel});b.defaults.zIndex=a.zIndex;s++;return b.list[a.id]=p?p._init(a):new b.fn._init(a)};b.fn=b.prototype={version:"4.1.6",closed:!0,_init:function(a){var f,b=a.icon,c=b&&(q?{png:"icons/"+b+".png"}:{backgroundImage:"url('"+a.path+"/skins/icons/"+b+".png')"});this.closed=!1;this.config=a;this.DOM=f=this.DOM||this._getDOM();f.wrap.addClass(a.skin);f.close[!1===a.cancel?"hide":"show"]();f.icon[0].style.display=b?"":"none";f.iconBg.css(c||{background:"none"});f.se.css("cursor",a.resize?"se-resize":"auto");f.title.css("cursor",a.drag?"move":"auto");f.content.css("padding",a.padding);this[a.show?"show":"hide"](!0);this.button(a.button).title(a.title).content(a.content,!0).size(a.width,a.height).time(a.time);a.follow?this.follow(a.follow):this.position(a.left,a.top);this.zIndex().focus();a.lock&&this.lock();this._addEvent();this._ie6PngFix();p=null;a.init&&a.init.call(this,h);return this},content:function(a,b){var c,d,e,i,j=this,u=j.DOM,o=u.wrap[0],g=o.offsetWidth,t=o.offsetHeight,h=parseInt(o.style.left),q=parseInt(o.style.top),m=o.style.width,u=u.content,l=u[0];j._elemBack&&j._elemBack();o.style.width="auto";if(a===n)return l;if("string"===typeof a)u.html(a);else if(a&&1===a.nodeType)i=a.style.display,c=a.previousSibling,d=a.nextSibling,e=a.parentNode,j._elemBack=function(){c&&c.parentNode?c.parentNode.insertBefore(a,c.nextSibling):d&&d.parentNode?d.parentNode.insertBefore(a,d):e&&e.appendChild(a);a.style.display=i;j._elemBack=null},u.html(""),l.appendChild(a),a.style.display="block";if(!b){j.config.follow?j.follow(j.config.follow):(g=o.offsetWidth-g,t=o.offsetHeight-t,q-=t/2,o.style.left=Math.max(h-g/2,0)+"px",o.style.top=Math.max(q,0)+"px");if(m&&"auto"!==m)o.style.width=o.offsetWidth+"px";j._autoPositionType()}j._ie6SelectFix();j._runScript(l);return j},title:function(a){var b=this.DOM,c=b.wrap,b=b.title;if(a===n)return b[0];!1===a?(b.hide().html(""),c.addClass("aui_state_noTitle")):(b.show().html(a||""),c.removeClass("aui_state_noTitle"));return this},position:function(a,b){var c=this.config,d=this.DOM.wrap[0],e=q?!1:c.fixed,c=q&&this.config.fixed,i=t.scrollLeft(),j=t.scrollTop(),g=e?0:i,e=e?0:j,o=l.width(),h=l.height(),m=d.offsetWidth,p=d.offsetHeight,d=d.style;if(a||0===a)if(this._left=-1!==a.toString().indexOf("%")?a:null,a=this._toNumber(a,o-m),"number"===typeof a)a=c?a+=i:a+g,d.left=Math.max(a,g)+"px";else if("string"===typeof a)d.left=a;if(b||0===b)if(this._top=-1!==b.toString().indexOf("%")?b:null,b=this._toNumber(b,h-p),"number"===typeof b)b=c?b+=j:b+e,d.top=Math.max(b,e)+"px";else if("string"===typeof b)d.top=b;if(a!==n&&b!==n)this._follow=null,this._autoPositionType();return this},size:function(a,b){var c,d,e=this.DOM;d=e.wrap;var i=e.main,g=d[0].style,e=i[0].style;if(a)if(this._width=-1!==a.toString().indexOf("%")?a:null,c=l.width()-d[0].offsetWidth+i[0].offsetWidth,a=c=this._toNumber(a,c),"number"===typeof a)g.width="auto",e.width=Math.max(this.config.minWidth,a)+"px",g.width=d[0].offsetWidth+"px";else if("string"===typeof a)e.width=a,"auto"===a&&d.css("width","auto");if(b)if(this._height=-1!==b.toString().indexOf("%")?b:null,d=l.height()-d[0].offsetHeight+i[0].offsetHeight,b=d=this._toNumber(b,d),"number"===typeof b)e.height=Math.max(this.config.minHeight,b)+"px";else if("string"===typeof b)e.height=b;this._ie6SelectFix();return this},follow:function(a){var b,c=this.config;if("string"===typeof a||a&&1===a.nodeType)b=g(a),a=b[0];if(!a||!a.offsetWidth&&!a.offsetHeight)return this.position(this._left,this._top);var d=x+"follow",e=l.width(),i=l.height(),j=t.scrollLeft(),u=t.scrollTop(),o=b.offset();b=a.offsetWidth;var h=q?!1:c.fixed,m=h?o.left-j:o.left,o=h?o.top-u:o.top,n=this.DOM.wrap[0],p=n.style,r=n.offsetWidth,n=n.offsetHeight,s=m-(r-b)/2,z=o+a.offsetHeight,j=h?0:j,u=h?0:u;p.left=(s<j?m:s+r>e&&m-r>j?m-r+b:s)+"px";p.top=(z+n>i+u&&o-n>u?o-n:z)+"px";this._follow&&this._follow.removeAttribute(d);this._follow=a;a[d]=c.id;this._autoPositionType();return this},button:function(){var a=this,b=arguments,c=a.DOM.buttons,d=c[0],e=a._listeners=a._listeners||{},i=g.isArray(b[0])?b[0]:[].slice.call(b);if(b[0]===n)return d;g.each(i,function(b,c){var f=c.name,k=!e[f],i=!k?e[f].elem:document.createElement("button");e[f]||(e[f]={});if(c.callback)e[f].callback=c.callback;if(c.className)i.className=c.className;if(c.focus)a._focus&&a._focus.removeClass("aui_state_highlight"),a._focus=g(i).addClass("aui_state_highlight"),a.focus();i.setAttribute("type","button");i[x+"callback"]=f;i.disabled=!!c.disabled;if(k)i.innerHTML=f,e[f].elem=i,d.appendChild(i)});c[0].style.display=i.length?"":"none";a._ie6SelectFix();return a},show:function(a){this.DOM.wrap.show();!a&&this._lockMaskWrap&&this._lockMaskWrap.show();return this},hide:function(a){this.DOM.wrap.hide();!a&&this._lockMaskWrap&&this._lockMaskWrap.hide();return this},close:function(){if(this.closed)return this;var a=this.DOM,c=a.wrap,d=b.list,e=this.config.close,g=this.config.follow;this.time();if("function"===typeof e&&!1===e.call(this,h))return this;this.unlock();this._elemBack&&this._elemBack();c[0].className=c[0].style.cssText="";a.title.html("");a.content.html("");a.buttons.html("");if(b.focus===this)b.focus=null;g&&g.removeAttribute(x+"follow");delete d[this.config.id];this._removeEvent();this.hide(!0)._setAbsolute();for(var i in this)this.hasOwnProperty(i)&&"DOM"!==i&&delete this[i];p?c.remove():p=this;return this},time:function(a){var b=this,c=b.config.cancelVal,d=b._timer;d&&clearTimeout(d);if(a)b._timer=setTimeout(function(){b._click(c)},1E3*a);return b},focus:function(){try{var a=this._focus&&this._focus[0]||this.DOM.close[0];a&&a.focus()}catch(b){}return this},zIndex:function(){var a=this.DOM.wrap,c=b.focus,d=b.defaults.zIndex++;a.css("zIndex",d);this._lockMask&&this._lockMask.css("zIndex",d-1);c&&c.DOM.wrap.removeClass("aui_state_focus");b.focus=this;a.addClass("aui_state_focus");return this},lock:function(){if(this._lock)return this;var a=this,c=b.defaults.zIndex-1,d=a.DOM.wrap,e=a.config,h=t.width(),i=t.height(),j=a._lockMaskWrap||g(document.body.appendChild(document.createElement("div"))),m=a._lockMask||g(j[0].appendChild(document.createElement("div"))),h=z?"width:"+h+"px;height:"+i+"px":"width:100%;height:100%",i=q?"position:absolute;left:expression((document).documentElement.scrollLeft);top:expression((document).documentElement.scrollTop);width:expression((document).documentElement.clientWidth);height:expression((document).documentElement.clientHeight)":"";a.zIndex();d.addClass("aui_state_lock");j[0].style.cssText=h+";position:fixed;z-index:"+c+";top:0;left:0;overflow:hidden;"+i;m[0].style.cssText="height:100%;background:"+e.background+";filter:alpha(opacity=0);opacity:0";q&&m.html('<iframe src="about:blank" style="width:100%;height:100%;position:absolute;top:0;left:0;z-index:-1;filter:alpha(opacity=0)"></iframe>');m.stop();m.bind("click",function(){a._reset()}).bind("dblclick",function(){a._click(a.config.cancelVal)});0===e.duration?m.css({opacity:e.opacity}):m.animate({opacity:e.opacity},e.duration);a._lockMaskWrap=j;a._lockMask=m;a._lock=!0;return a},unlock:function(){var a=this._lockMaskWrap,b=this._lockMask;if(!this._lock)return this;var c=a[0].style,d=function(){q&&(c.removeExpression("width"),c.removeExpression("height"),c.removeExpression("left"),c.removeExpression("top"));c.cssText="display:none";p&&a.remove()};b.stop().unbind();this.DOM.wrap.removeClass("aui_state_lock");this.config.duration?b.animate({opacity:0},this.config.duration,d):d();this._lock=!1;return this},_getDOM:function(){var a=document.createElement("div"),c=document.body;a.style.cssText="position:absolute;left:0;top:0";a.innerHTML=b._templates;c.insertBefore(a,c.firstChild);for(var c=0,d={wrap:g(a)},e=a.getElementsByTagName("*"),h=e.length;c<h;c++)(a=e[c].className.split("aui_")[1])&&(d[a]=g(e[c]));return d},_toNumber:function(a,b){if(!a&&0!==a||"number"===typeof a)return a;var c=a.length-1;a.lastIndexOf("px")===c?a=parseInt(a):a.lastIndexOf("%")===c&&(a=parseInt(b*a.split("%")[0]/100));return a},_ie6PngFix:q?function(){for(var a=0,c,d,e=b.defaults.path+"/skins/",g=this.DOM.wrap[0].getElementsByTagName("*");a<g.length;a++)if(c=g[a],d=c.currentStyle.png)d=e+d,c=c.runtimeStyle,c.backgroundImage="none",c.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d+"',sizingMethod='crop')"}:g.noop,_ie6SelectFix:q?function(){var a=this.DOM.wrap,b=a[0],c=x+"iframeMask",d=a[c],e=b.offsetWidth,i=b.offsetHeight,e=e+"px",i=i+"px";d?(d.style.width=e,d.style.height=i):(d=b.appendChild(document.createElement("iframe")),a[c]=d,d.src="about:blank",d.style.cssText="position:absolute;z-index:-1;left:0;top:0;filter:alpha(opacity=0);width:"+e+";height:"+i)}:g.noop,_runScript:function(a){for(var b,c=b=0,a=a.getElementsByTagName("script"),d=a.length,e=[];b<d;b++)if("text/dialog"===a[b].type)e[c]=a[b].innerHTML,c++;e.length&&(e=e.join(""),b=new Function(e),b.call(this))},_autoPositionType:function(){this[this.config.fixed?"_setFixed":"_setAbsolute"]()},_setFixed:function(){q&&g(function(){"fixed"!==m.css("backgroundAttachment")&&"fixed"!==g("body").css("backgroundAttachment")&&m.css({zoom:1,backgroundImage:"url(about:blank)",backgroundAttachment:"fixed"})});return function(){var a=this.DOM.wrap,b=a[0].style;if(q){var c=parseInt(a.css("left")),a=parseInt(a.css("top")),d=t.scrollLeft(),e=t.scrollTop();this._setAbsolute();b.setExpression("left","eval((document.documentElement).scrollLeft + "+(c-d)+') + "px"');b.setExpression("top","eval((document.documentElement).scrollTop + "+(a-e)+') + "px"')}else b.position="fixed"}}(),_setAbsolute:function(){var a=this.DOM.wrap[0].style;q&&(a.removeExpression("left"),a.removeExpression("top"));a.position="absolute"},_click:function(a){a=this._listeners[a]&&this._listeners[a].callback;return"function"!==typeof a||!1!==a.call(this,h)?this.close():this},_reset:function(a){var b=this._winSize||l.width()*l.height(),c=this._follow,d=this._width,e=this._height,i=this._left,g=this._top;if(a&&(a=this._winSize=l.width()*l.height(),b===a))return;(d||e)&&this.size(d,e);c?this.follow(c):(i||g)&&this.position(i,g)},_addEvent:function(){var a,b=this,c=b.config,d="CollectGarbage"in h,e=b.DOM;b._winResize=function(){a&&clearTimeout(a);a=setTimeout(function(){b._reset(d)},40)};l.bind("resize",b._winResize);e.wrap.bind("click",function(a){a=a.target;if(a.disabled)return!1;if(a===e.close[0])return b._click(c.cancelVal),!1;(a=a[x+"callback"])&&b._click(a);b._ie6SelectFix()}).bind("mousedown",function(){b.zIndex()})},_removeEvent:function(){this.DOM.wrap.unbind();l.unbind("resize",this._winResize)}};b.fn._init.prototype=b.fn;g.fn.dialog=g.fn.artDialog=function(){var a=arguments;this[this.live?"live":"bind"]("click",function(){b.apply(this,a);return!1});return this};b.focus=null;b.get=function(a){return a===n?b.list:b.list[a]};b.list={};t.bind("keydown",function(a){var c=a.target.nodeName,d=/^INPUT|TEXTAREA$/,e=b.focus,a=a.keyCode;e&&e.config.esc&&!d.test(c)&&27===a&&e._click(e.config.cancelVal)});r=h._artDialog_path||function(a,b,d){for(b in a)a[b].src&&-1!==a[b].src.indexOf("artDialog")&&(d=a[b]);c=d||a[a.length-1];d=c.src.replace(/\\/g,"/");return 0>d.lastIndexOf("/")?".":d.substring(0,d.lastIndexOf("/"))}(document.getElementsByTagName("script"));if(v=c.src.split("skin=")[1]){var d=document.createElement("link");d.rel="stylesheet";d.href=r+"/skins/"+v+".css?"+b.fn.version;c.parentNode.insertBefore(d,c)}l.bind("load",function(){setTimeout(function(){s||b({left:"-9999em",time:9,fixed:!1,lock:!1,focus:!1})},150)});try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e){}b._templates='<div class="aui_outer"><table class="aui_border"><tbody><tr><td class="aui_nw"></td><td class="aui_n"></td><td class="aui_ne"></td></tr><tr><td class="aui_w"></td><td class="aui_c"><div class="aui_inner"><table class="aui_dialog"><tbody><tr><td colspan="2" class="aui_header"><div class="aui_titleBar"><div class="aui_title"></div><a class="aui_close" href="javascript:/*artDialog*/;">\u00d7</a></div></td></tr><tr><td class="aui_icon"><div class="aui_iconBg"></div></td><td class="aui_main"><div class="aui_content"></div></td></tr><tr><td colspan="2" class="aui_footer"><div class="aui_buttons"></div></td></tr></tbody></table></div></td><td class="aui_e"></td></tr><tr><td class="aui_sw"></td><td class="aui_s"></td><td class="aui_se"></td></tr></tbody></table></div>';b.defaults={content:'<div class="aui_loading"><span>loading..</span></div>',title:"\u6d88\u606f",button:null,ok:null,cancel:null,init:null,close:null,okVal:"\u786e\u5b9a",cancelVal:"\u53d6\u6d88",width:"auto",height:"auto",minWidth:96,minHeight:32,padding:"20px 25px",skin:"",icon:null,time:null,esc:!0,focus:!0,show:!0,follow:null,path:r,lock:!1,background:"#000",opacity:0.7,duration:300,fixed:!1,left:"50%",top:"38.2%",zIndex:1987,resize:!0,drag:!0};h.artDialog=g.dialog=g.artDialog=b})(this.art||this.jQuery&&(this.art=jQuery),this);(function(g){var h,n,p=g(window),c=g(document),v=document.documentElement,r=!("minWidth"in v.style),s="onlosecapture"in v,l="setCapture"in v;artDialog.dragEvent=function(){var c=this,g=function(g){var h=c[g];c[g]=function(){return h.apply(c,arguments)}};g("start");g("move");g("end")};artDialog.dragEvent.prototype={onstart:g.noop,start:function(g){c.bind("mousemove",this.move).bind("mouseup",this.end);this._sClientX=g.clientX;this._sClientY=g.clientY;this.onstart(g.clientX,g.clientY);return!1},onmove:g.noop,move:function(c){this._mClientX=c.clientX;this._mClientY=c.clientY;this.onmove(c.clientX-this._sClientX,c.clientY-this._sClientY);return!1},onend:g.noop,end:function(g){c.unbind("mousemove",this.move).unbind("mouseup",this.end);this.onend(g.clientX,g.clientY);return!1}};n=function(g){var m,q,n,x,b,d,e=artDialog.focus,a=e.DOM,f=a.wrap,k=a.title,w=a.main,v="getSelection"in window?function(){window.getSelection().removeAllRanges()}:function(){try{document.selection.empty()}catch(a){}};h.onstart=function(){d?(q=w[0].offsetWidth,n=w[0].offsetHeight):(x=f[0].offsetLeft,b=f[0].offsetTop);c.bind("dblclick",h.end);!r&&s?k.bind("losecapture",h.end):p.bind("blur",h.end);l&&k[0].setCapture();f.addClass("aui_state_drag");e.focus()};h.onmove=function(a,c){if(d){var g=f[0].style,h=w[0].style,k=a+q,l=c+n;g.width="auto";h.width=Math.max(0,k)+"px";g.width=f[0].offsetWidth+"px";h.height=Math.max(0,l)+"px"}else h=f[0].style,g=Math.max(m.minX,Math.min(m.maxX,a+x)),k=Math.max(m.minY,Math.min(m.maxY,c+b)),h.left=g+"px",h.top=k+"px";v();e._ie6SelectFix()};h.onend=function(){c.unbind("dblclick",h.end);!r&&s?k.unbind("losecapture",h.end):p.unbind("blur",h.end);l&&k[0].releaseCapture();r&&!e.closed&&e._autoPositionType();f.removeClass("aui_state_drag")};d=g.target===a.se[0]?!0:!1;m=function(){var a=e.DOM.wrap[0],b="fixed"===a.style.position,d=a.offsetWidth,a=a.offsetHeight,f=p.width(),g=p.height(),h=b?0:c.scrollLeft(),b=b?0:c.scrollTop();return{minX:h,minY:b,maxX:f-d+h,maxY:g-a+b}}();h.start(g)};c.bind("mousedown",function(c){var g=artDialog.focus;if(g){var l=c.target,p=g.config,g=g.DOM;if(!1!==p.drag&&l===g.title[0]||!1!==p.resize&&l===g.se[0])return h=h||new artDialog.dragEvent,n(c),!1}})})(this.art||this.jQuery&&(this.art=jQuery));