/*! * 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));