/*! * artdialog 4.1.7 * date: 2013-03-03 08:04 * 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(e,t){function h(e,t,n){t=t||document,n=n||"*";var r=0,i=0,s=[],o=t.getelementsbytagname(n),u=o.length,a=new regexp("(^|\\s)"+e+"(\\s|$)");for(;r)[^>]*$|#([\w\-]+)$)/,a=/[\n\t]/g,f=/alpha\([^)]*\)/i,l=/opacity=([^)]*)/,c=/^([+-]=)?([\d+-.]+)(.*)$/;return e.$===t&&(e.$=n),n.fn=n.prototype={constructor:n,ready:function(e){return n.bindready(),n.isready?e.call(document,n):i&&i.push(e),this},hasclass:function(e){var t=" "+e+" ";return(" "+this[0].classname+" ").replace(a," ").indexof(t)>-1?!0:!1},addclass:function(e){return this.hasclass(e)||(this[0].classname+=" "+e),this},removeclass:function(e){var t=this[0];return e?this.hasclass(e)&&(t.classname=t.classname.replace(e," ")):t.classname="",this},css:function(e,r){var i,s=this[0],o=arguments[0];if(typeof e=="string"){if(r===t)return n.css(s,e);e==="opacity"?n.opacity.set(s,r):s.style[e]=r}else for(i in o)i==="opacity"?n.opacity.set(s,o[i]):s.style[i]=o[i];return this},show:function(){return this.css("display","block")},hide:function(){return this.css("display","none")},offset:function(){var e=this[0],t=e.getboundingclientrect(),n=e.ownerdocument,r=n.body,i=n.documentelement,s=i.clienttop||r.clienttop||0,o=i.clientleft||r.clientleft||0,u=t.top+(self.pageyoffset||i.scrolltop)-s,a=t.left+(self.pagexoffset||i.scrollleft)-o;return{left:a,top:u}},html:function(e){var r=this[0];return e===t?r.innerhtml:(n.cleandata(r.getelementsbytagname("*")),r.innerhtml=e,this)},remove:function(){var e=this[0];return n.cleandata(e.getelementsbytagname("*")),n.cleandata([e]),e.parentnode.removechild(e),this},bind:function(e,t){return n.event.add(this[0],e,t),this},unbind:function(e,t){return n.event.remove(this[0],e,t),this}},n.fn.init=function(e,t){var r,i;t=t||document;if(!e)return this;if(e.nodetype)return this[0]=e,this;if(e==="body"&&t.body)return this[0]=t.body,this;if(e==="head"||e==="html")return this[0]=t.getelementsbytagname(e)[0],this;if(typeof e=="string"){r=u.exec(e);if(r&&r[2])return i=t.getelementbyid(r[2]),i&&i.parentnode&&(this[0]=i),this}return typeof e=="function"?n(document).ready(e):(this[0]=e,this)},n.fn.init.prototype=n.fn,n.noop=function(){},n.iswindow=function(e){return e&&typeof e=="object"&&"setinterval"in e},n.isarray=function(e){return object.prototype.tostring.call(e)==="[object array]"},n.fn.find=function(e){var t,r=this[0],i=e.split(".")[1];return i?document.getelementsbyclassname?t=r.getelementsbyclassname(i):t=h(i,r):t=r.getelementsbytagname(e),n(t[0])},n.each=function(e,n){var r,i=0,s=e.length,o=s===t;if(o){for(r in e)if(n.call(e[r],r,e[r])===!1)break}else for(var u=e[0];i=e.options.speed+e.starttime){e.now=e.end,e.state=e.pos=1,e.update(),e.options.curanim[e.prop]=!0;for(var i in e.options.curanim)e.options.curanim[i]!==!0&&(r=!1);return r&&e.options.callback.call(e.elem),!1}var s=t-e.starttime;return e.state=s/e.options.speed,e.pos=n.easing[e.options.easing](e.state,s,0,1,e.options.speed),e.now=e.start+(e.end-e.start)*e.pos,e.update(),!0},update:function(){var e=this;e.prop==="opacity"?n.opacity.set(e.elem,e.now):e.elem.style&&e.elem.style[e.prop]!=null?e.elem.style[e.prop]=e.now+e.unit:e.elem[e.prop]=e.now}},n.fx.now=function(){return+(new date)},n.easing={linear:function(e,t,n,r){return n+r*e},swing:function(e,t,n,r){return(-math.cos(e*math.pi)/2+.5)*r+n}},n.fx.tick=function(){var e=n.timers;for(var t=0;t=0;t--)e[t].elem===this[0]&&e.splice(t,1);return this},n})(window),function(e,t,n){e.noop=e.noop||function(){};var r,i,s,o,u=0,a=e(t),f=e(document),l=e("html"),c=document.documentelement,h=t.vbarray&&!t.xmlhttprequest,p="createtouch"in document&&!("onmousemove"in c)||/(iphone|ipad|ipod)/i.test(navigator.useragent),d="artdialog"+ +(new date),v=function(t,i,s){t=t||{};if(typeof t=="string"||t.nodetype===1)t={content:t,fixed:!p};var o,a=v.defaults,f=t.follow=this.nodetype===1&&this||t.follow;for(var l in a)t[l]===n&&(t[l]=a[l]);return e.each({ok:"yesfn",cancel:"nofn",close:"closefn",init:"initfn",okval:"yestext",cancelval:"notext"},function(e,r){t[e]=t[e]!==n?t[e]:t[r]}),typeof f=="string"&&(f=e(f)[0]),t.id=f&&f[d+"follow"]||t.id||d+u,o=v.list[t.id],f&&o?o.follow(f).zindex().focus():o?o.zindex().focus():(p&&(t.fixed=!1),e.isarray(t.button)||(t.button=t.button?[t.button]:[]),i!==n&&(t.ok=i),s!==n&&(t.cancel=s),t.ok&&t.button.push({name:t.okval,callback:t.ok,focus:!0}),t.cancel&&t.button.push({name:t.cancelval,callback:t.cancel}),v.defaults.zindex=t.zindex,u++,v.list[t.id]=r?r._init(t):new v.fn._init(t))};v.fn=v.prototype={version:"4.1.7",closed:!0,_init:function(e){var n=this,i,s=e.icon,o=s&&(h?{png:"icons/"+s+".png"}:{backgroundimage:"url('"+e.path+"/skins/icons/"+s+".png')"});return n.closed=!1,n.config=e,n.dom=i=n.dom||n._getdom(),i.wrap.addclass(e.skin),i.close[e.cancel===!1?"hide":"show"](),i.icon[0].style.display=s?"":"none",i.iconbg.css(o||{background:"none"}),i.se.css("cursor",e.resize?"se-resize":"auto"),i.title.css("cursor",e.drag?"move":"auto"),i.content.css("padding",e.padding),n[e.show?"show":"hide"](!0),n.button(e.button).title(e.title).content(e.content,!0).size(e.width,e.height).time(e.time),e.follow?n.follow(e.follow):n.position(e.left,e.top),n.zindex().focus(),e.lock&&n.lock(),n._addevent(),n._ie6pngfix(),r=null,e.init&&e.init.call(n,t),n},content:function(e){var t,r,i,s,o=this,u=o.dom,a=u.wrap[0],f=a.offsetwidth,l=a.offsetheight,c=parseint(a.style.left),h=parseint(a.style.top),p=a.style.width,d=u.content,v=d[0];return o._elemback&&o._elemback(),a.style.width="auto",e===n?v:(typeof e=="string"?d.html(e):e&&e.nodetype===1&&(s=e.style.display,t=e.previoussibling,r=e.nextsibling,i=e.parentnode,o._elemback=function(){t&&t.parentnode?t.parentnode.insertbefore(e,t.nextsibling):r&&r.parentnode?r.parentnode.insertbefore(e,r):i&&i.appendchild(e),e.style.display=s,o._elemback=null},d.html(""),v.appendchild(e),e.style.display="block"),arguments[1]||(o.config.follow?o.follow(o.config.follow):(f=a.offsetwidth-f,l=a.offsetheight-l,c-=f/2,h-=l/2,a.style.left=math.max(c,0)+"px",a.style.top=math.max(h,0)+"px"),p&&p!=="auto"&&(a.style.width=a.offsetwidth+"px"),o._autopositiontype()),o._ie6selectfix(),o._runscript(v),o)},title:function(e){var t=this.dom,r=t.wrap,i=t.title,s="aui_state_notitle";return e===n?i[0]:(e===!1?(i.hide().html(""),r.addclass(s)):(i.show().html(e||""),r.removeclass(s)),this)},position:function(e,t){var r=this,i=r.config,s=r.dom.wrap[0],o=h?!1:i.fixed,u=h&&r.config.fixed,l=f.scrollleft(),c=f.scrolltop(),p=o?0:l,d=o?0:c,v=a.width(),m=a.height(),g=s.offsetwidth,y=s.offsetheight,b=s.style;if(e||e===0)r._left=e.tostring().indexof("%")!==-1?e:null,e=r._tonumber(e,v-g),typeof e=="number"?(e=u?e+=l:e+p,b.left=math.max(e,p)+"px"):typeof e=="string"&&(b.left=e);if(t||t===0)r._top=t.tostring().indexof("%")!==-1?t:null,t=r._tonumber(t,m-y),typeof t=="number"?(t=u?t+=c:t+d,b.top=math.max(t,d)+"px"):typeof t=="string"&&(b.top=t);return e!==n&&t!==n&&(r._follow=null,r._autopositiontype()),r},size:function(e,t){var n,r,i,s,o=this,u=o.config,f=o.dom,l=f.wrap,c=f.main,h=l[0].style,p=c[0].style;return e&&(o._width=e.tostring().indexof("%")!==-1?e:null,n=a.width()-l[0].offsetwidth+c[0].offsetwidth,i=o._tonumber(e,n),e=i,typeof e=="number"?(h.width="auto",p.width=math.max(o.config.minwidth,e)+"px",h.width=l[0].offsetwidth+"px"):typeof e=="string"&&(p.width=e,e==="auto"&&l.css("width","auto"))),t&&(o._height=t.tostring().indexof("%")!==-1?t:null,r=a.height()-l[0].offsetheight+c[0].offsetheight,s=o._tonumber(t,r),t=s,typeof t=="number"?p.height=math.max(o.config.minheight,t)+"px":typeof t=="string"&&(p.height=t)),o._ie6selectfix(),o},follow:function(t){var n,r=this,i=r.config;if(typeof t=="string"||t&&t.nodetype===1)n=e(t),t=n[0];if(!t||!t.offsetwidth&&!t.offsetheight)return r.position(r._left,r._top);var s=d+"follow",o=a.width(),u=a.height(),l=f.scrollleft(),c=f.scrolltop(),p=n.offset(),v=t.offsetwidth,m=t.offsetheight,g=h?!1:i.fixed,y=g?p.left-l:p.left,b=g?p.top-c:p.top,w=r.dom.wrap[0],e=w.style,s=w.offsetwidth,x=w.offsetheight,t=y-(s-v)/2,n=b+m,c=g?0:l,k=g?0:c;return t=to&&y-s>c?y-s+v:t,n=n+x>u+k&&b-x>k?b-x:n,e.left=t+"px",e.top=n+"px",r._follow&&r._follow.removeattribute(s),r._follow=t,t[s]=i.id,r._autopositiontype(),r},button:function(){var t=this,r=arguments,i=t.dom,s=i.buttons,o=s[0],u="aui_state_highlight",a=t._listeners=t._listeners||{},f=e.isarray(r[0])?r[0]:[].slice.call(r);return r[0]===n?o:(e.each(f,function(n,r){var i=r.name,s=!a[i],f=s?document.createelement("button"):a[i].elem;a[i]||(a[i]={}),r.callback&&(a[i].callback=r.callback),r.classname&&(f.classname=r.classname),r.focus&&(t._focus&&t._focus.removeclass(u),t._focus=e(f).addclass(u),t.focus()),f.setattribute("type","button"),f[d+"callback"]=i,f.disabled=!!r.disabled,s&&(f.innerhtml=i,a[i].elem=f,o.appendchild(f))}),s[0].style.display=f.length?"":"none",t._ie6selectfix(),t)},show:function(){return this.dom.wrap.show(),!arguments[0]&&this._lockmaskwrap&&this._lockmaskwrap.show(),this},hide:function(){return this.dom.wrap.hide(),!arguments[0]&&this._lockmaskwrap&&this._lockmaskwrap.hide(),this},close:function(){if(this.closed)return this;var e=this,n=e.dom,i=n.wrap,s=v.list,o=e.config.close,u=e.config.follow;e.time();if(typeof o=="function"&&o.call(e,t)===!1)return e;e.unlock(),e._elemback&&e._elemback(),i[0].classname=i[0].style.csstext="",n.title.html(""),n.content.html(""),n.buttons.html(""),v.focus===e&&(v.focus=null),u&&u.removeattribute(d+"follow"),delete s[e.config.id],e._removeevent(),e.hide(!0)._setabsolute();for(var a in e)e.hasownproperty(a)&&a!=="dom"&&delete e[a];return r?i.remove():r=e,e},time:function(e){var t=this,n=t.config.cancelval,r=t._timer;return r&&cleartimeout(r),e&&(t._timer=settimeout(function(){t._click(n)},1e3*e)),t},focus:function(){try{if(this.config.focus){var e=this._focus&&this._focus[0]||this.dom.close[0];e&&e.focus()}}catch(t){}return this},zindex:function(){var e=this,t=e.dom,n=t.wrap,r=v.focus,i=v.defaults.zindex++;return n.css("zindex",i),e._lockmask&&e._lockmask.css("zindex",i-1),r&&r.dom.wrap.removeclass("aui_state_focus"),v.focus=e,n.addclass("aui_state_focus"),e},lock:function(){if(this._lock)return this;var t=this,n=v.defaults.zindex-1,r=t.dom.wrap,i=t.config,s=f.width(),o=f.height(),u=t._lockmaskwrap||e(document.body.appendchild(document.createelement("div"))),a=t._lockmask||e(u[0].appendchild(document.createelement("div"))),l="(document).documentelement",c=p?"width:"+s+"px;height:"+o+"px":"width:100%;height:100%",d=h?"position:absolute;left:expression("+l+".scrollleft);top:expression("+l+".scrolltop);width:expression("+l+".clientwidth);height:expression("+l+".clientheight)":"";return t.zindex(),r.addclass("aui_state_lock"),u[0].style.csstext=c+";position:fixed;z-index:"+n+";top:0;left:0;overflow:hidden;"+d,a[0].style.csstext="height:100%;background:"+i.background+";filter:alpha(opacity=0);opacity:0",h&&a.html(''),a.stop(),a.bind("click",function(){t._reset()}).bind("dblclick",function(){t._click(t.config.cancelval)}),i.duration===0?a.css({opacity:i.opacity}):a.animate({opacity:i.opacity},i.duration),t._lockmaskwrap=u,t._lockmask=a,t._lock=!0,t},unlock:function(){var e=this,t=e._lockmaskwrap,n=e._lockmask;if(!e._lock)return e;var i=t[0].style,s=function(){h&&(i.removeexpression("width"),i.removeexpression("height"),i.removeexpression("left"),i.removeexpression("top")),i.csstext="display:none",r&&t.remove()};return n.stop().unbind(),e.dom.wrap.removeclass("aui_state_lock"),e.config.duration?n.animate({opacity:0},e.config.duration,s):s(),e._lock=!1,e},_getdom:function(){var t=document.createelement("div"),n=document.body;t.style.csstext="position:absolute;left:0;top:0",t.innerhtml=v._templates,n.insertbefore(t,n.firstchild);var r,i=0,s={wrap:e(t)},o=t.getelementsbytagname("*"),u=o.length;for(;i
',v.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:o,lock:!1,background:"#000",opacity:.7,duration:300,fixed:!1,left:"50%",top:"38.2%",zindex:1987,resize:!0,drag:!0},t.artdialog=e.dialog=e.artdialog=v}(this.art||this.jquery&&(this.art=jquery),this),function(e){var t,n,r=e(window),i=e(document),s=document.documentelement,o=!("minwidth"in s.style),u="onlosecapture"in s,a="setcapture"in s;artdialog.dragevent=function(){var e=this,t=function(t){var n=e[t];e[t]=function(){return n.apply(e,arguments)}};t("start"),t("move"),t("end")},artdialog.dragevent.prototype={onstart:e.noop,start:function(e){return i.bind("mousemove",this.move).bind("mouseup",this.end),this._sclientx=e.clientx,this._sclienty=e.clienty,this.onstart(e.clientx,e.clienty),!1},onmove:e.noop,move:function(e){return this._mclientx=e.clientx,this._mclienty=e.clienty,this.onmove(e.clientx-this._sclientx,e.clienty-this._sclienty),!1},onend:e.noop,end:function(e){return i.unbind("mousemove",this.move).unbind("mouseup",this.end),this.onend(e.clientx,e.clienty),!1}},n=function(e){var n,s,f,l,c,h,p=artdialog.focus,d=p.dom,v=d.wrap,m=d.title,g=d.main,y="getselection"in window?function(){window.getselection().removeallranges()}:function(){try{document.selection.empty()}catch(e){}};t.onstart=function(e,n){h?(s=g[0].offsetwidth,f=g[0].offsetheight):(l=v[0].offsetleft,c=v[0].offsettop),i.bind("dblclick",t.end),!o&&u?m.bind("losecapture",t.end):r.bind("blur",t.end),a&&m[0].setcapture(),v.addclass("aui_state_drag"),p.focus()},t.onmove=function(e,t){if(h){var r=v[0].style,i=g[0].style,o=e+s,u=t+f;r.width="auto",i.width=math.max(0,o)+"px",r.width=v[0].offsetwidth+"px",i.height=math.max(0,u)+"px"}else{var i=v[0].style,a=math.max(n.minx,math.min(n.maxx,e+l)),d=math.max(n.miny,math.min(n.maxy,t+c));i.left=a+"px",i.top=d+"px"}y(),p._ie6selectfix()},t.onend=function(e,n){i.unbind("dblclick",t.end),!o&&u?m.unbind("losecapture",t.end):r.unbind("blur",t.end),a&&m[0].releasecapture(),o&&!p.closed&&p._autopositiontype(),v.removeclass("aui_state_drag")},h=e.target===d.se[0]?!0:!1,n=function(){var e,t,n=p.dom.wrap[0],s=n.style.position==="fixed",o=n.offsetwidth,u=n.offsetheight,a=r.width(),f=r.height(),l=s?0:i.scrollleft(),c=s?0:i.scrolltop(),e=a-o+l;return t=f-u+c,{minx:l,miny:c,maxx:e,maxy:t}}(),t.start(e)},i.bind("mousedown",function(e){var r=artdialog.focus;if(!r)return;var i=e.target,s=r.config,o=r.dom;if(s.drag!==!1&&i===o.title[0]||s.resize!==!1&&i===o.se[0])return t=t||new artdialog.dragevent,n(e),!1})}(this.art||this.jquery&&(this.art=jquery))