/*! * 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=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;de&&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('');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;cd.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='';b.defaults={content:'
loading..
',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));