(function(f,C,t,p){function G(a){0==r.length&&u.show();u.css("zIndex",a.zIndex);r.push(a);v++}function y(a,b){return(new dDialog(f.extend({},dDialog.messageSettings,{content:a,beforeHide:function(){return b()},afterHide:function(){this.remove()}}))).show()}var w=function(){this.init.apply(this,arguments)};w.version="1.0.0";w.settings={title:"\u63d0\u793a",type:"text",skin:"default",position:{left:"center",top:"center"},focus:"mousedown",shadow:4,time:0,noTitle:!1,noBorder:!1,fixed:!1,drag:!1,modal:!1,
animate:300};var z=f("script:last")[0].src.replace(/[^\/]+$/,"");z.match(/^https?/i)||(z=location+z);var D=f.browser.msie,E=f.browser.version,o=D&&7>E,H="ontouchend"in t,I=f(C),n,s,u,A,x=[99E3,1E5],r=[],v=0;f(function(){n=t.documentElement;s=t.body;f("head").append("<style>.dDialog{position:absolute;}.dd_shadow{position:absolute;background:#000;}.dd_mask{position:fixed;top:0;left:0;height:100%;width:100%;background-color:#000;opacity:.2;filter:alpha(opacity=20);_position:absolute;_height:expression(Math.max(document.documentElement.clientHeight,document.documentElement.scrollHeight)+'px');_width:expression(Math.max(document.documentElement.clientWidth,document.documentElement.scrollWidth)+'px');}.dd_drag{cursor:move;user-selec:none;-moz-user-selec:none;-webkit-user-select:none;}.dd_wait{width:100%;height:100%;}.dd_dragMask{display:none;position:fixed;cursor:move;z-index:99999999999;top:0;left:0;height:100%;width:100%;background-color:#000;opacity:0;filter:alpha(opacity=0);_position:absolute;_height:expression(Math.max(document.documentElement.clientHeight,document.documentElement.scrollHeight)+'px');_width:expression(Math.max(document.documentElement.clientWidth,document.documentElement.scrollWidth)+'px');}.dd_content{word-break:break-all;word-wrap:break-word;}.dd_info{padding:20px;}.dd_button{text-align:right;padding:6px 10px;background:#F6F6F6;border-top:1px solid #EBEBEB;}.dd_button button{margin-right:5px;padding:2px 10px;vertical-align: bottom;}</style>");
u=f('<div class="dd_mask" style="display:none"></div>').appendTo("body");A=f('<div class="dd_dragMask"></div>').appendTo("body");o&&"fixed"!==f(s).css("backgroundAttachment")&&f("html").css({backgroundImage:"url(about:blank)",backgroundAttachment:"fixed"});f(t).keydown(function(a){if(27===a.which&&0<v)return a=r[v-1],a.settings.noClose||a.hide(),!1})});w.prototype={init:function(a){var b=this;b.bShow=!1;var d=b.settings=f.extend({},w.settings,a);if(D&&9>E&&d.corner||o)d.animate=!1;if(H)d.fixed=!1;
var c=f('<div class="dd_'+d.skin+'"></div>').appendTo("body"),e=b.$dialog=f('<div style="display:none;'+(d.noBorder?"border:none":"")+'" class="dDialog">'+(!d.noTitle?'<div class="dd_title">\u6807\u9898</div>':"")+'<span title="\u5173\u95ed'+(b.settings.modal?" (Esc)":"")+'" class="dd_close"'+(d.noClose?' style="display:none"':"")+'>\u00d7</span><div class="dd_content"></div></div>').appendTo(c),a=b.$title=e.find(".dd_title");b.$titletext=e.find(".dd_title");b.$content=e.find(".dd_content");var l=
b.$shadow=f('<div style="display:none;" class="dd_shadow"></div>').appendTo(c).css("opacity",0.15);b.setTitle(d.title).setContent(d.content);var i=d.corner;if(i){var g=i.match(/[a-z]+|[A-Z][a-z]+|\d+/g),h=g[0],c=g[1],g=g[2]?parseInt(g[2]):0,j=h.match(/top|bottom/)?"left":"top";b.$corner=f('<div class="dd_corner dd_corner_'+h+'" style="'+h+":-20px;"+("Center"==c?j+":50%;margin-"+j+":-10px;":c+":"+g+"px;")+'"></div>').appendTo(e);var k=j=0,q=e.outerWidth(),B=e.outerHeight(),h=h.substr(0,1),c=c.substr(0,
1),g=g+11;h.match(/[tb]/)&&(k="t"==h?10:-(B+10),"L"==c&&(j=-g),"C"==c&&(j=-(q/2)),"R"==c&&(j=-(q-g)));h.match(/[lr]/)&&(j="l"==h?10:-(q+10),"T"==c&&(k=-g),"C"==c&&(k=-(B/2)),"B"==c&&(k=-(B-g)));b.offsetFix={x:j,y:k}}(c=d.focus)&&e.bind(c+" touchstart",function(){b.setTopLayer()});e.find(".dd_close").bind("click touchend",function(){b.hide();return!1});var c=d.drag,F=d.shadow;c&&(("all"==c?e:a).addClass("dd_drag").bind({"mousedown touchstart":function(a){if("dd_close"!=a.target.className){"touch"==
a.type.substr(0,5)&&(a=a.originalEvent.targetTouches[0]);b.bDrag=!0;var c=e.offset();b.lastDragOffset={x:a.pageX-c.left,y:a.pageY-c.top};A.show();a.preventDefault&&a.preventDefault()}},selectstart:function(){return!1}}),f(t).bind({"mousemove touchmove":function(a){if(b.bDrag){"touch"==a.type.substr(0,5)&&(a=a.originalEvent.targetTouches[0]);var c=n.scrollLeft||s.scrollLeft,g=n.scrollTop||s.scrollTop,f=0,h=0,q=n.clientWidth-e.outerWidth(),j=n.clientHeight-e.outerHeight(),k=b.lastDragOffset,m=a.pageX-
k.x,a=a.pageY-k.y;d.fixed&&!o?(m-=c,a-=g):(f=c,h=g,q+=f,j+=h);m=m<f?f:m>q?q:m;a=a<h?h:a>j?j:a;if(!o||!i)e.css("opacity",0.5),l.hide();e.css({left:m,top:a});l.css({left:m+F,top:a+F});o&&b.changeFixed();return!1}},"mouseup touchend":function(){if(b.bDrag)b.bDrag=!1,e.css("opacity",""),l.show(),A.hide()}}));b.changeFixed().setTopLayer().moveTo();var m;c||I.bind("resize",function(){m&&clearTimeout(m);m=setTimeout(function(){b.moveTo()},100)})},setTitle:function(a){this.$titletext.html(a);return this},
setContent:function(a){if(a!==p){var b=this,d=b.settings,c=d.type;"iframe"==c?(b.bIframeInit=!1,a=f('<div class="dd_wait"></div><iframe frameborder="0" src="'+a+(/\?/.test(a)?"&":"?")+"parenthost="+location.host+'" style="width:100%;height:'+(d.height?d.height-b.$title.outerHeight()+"px":"100%")+';visibility:hidden;"></iframe>')):"ajax"==c?(f.get(a+(-1!=a.indexOf("?")?"&":"?")+"r="+(new Date).getTime(),function(a){b._setContent(a)}),a=f('<div class="dd_wait" style="width:200px;height:100px;"></div>')):
"text"==c&&(a=f('<div class="dd_text"></div>').append(a));b._setContent(a);if("iframe"===c){var e=a.eq(1),l=a.eq(0),i=e[0].contentWindow,g,h=d.iframeCallback;e.load(function(){l&&(l.remove(),l=null,e.css("visibility",""));j();if(g){var a=!0;try{g=eval("("+unescape(g)+")")}catch(c){a=!1}if(a)return k(g)}});var j=function(){try{i.callback=k,i.unloadme=function(){b.hide()},f(i.document).keydown(function(){}),g=i.name}catch(a){}},k=function(a){i.document.write("");b.hide();null!=a&&h&&h.call(b,a)};j()}return b}},
_setContent:function(a){this.$content.html(a);this.updateSize();return this},_updateSize:function(){this.updateSize()},updateSize:function(){var a=this,b=a.$dialog,d=a.$content,c=a.settings,e=c.width,c=c.height;b.add(d).css({width:"",height:""});var f=b.width(),i;if(e){if(isNaN(e)){var g=e[0],e=e[1];g&&f<g&&(i=g);e&&f>e&&(i=e)}else i=e;i&&(b.css("width",i),d.css({width:i}))}i=b.height();var h;c&&(isNaN(c)?(e=c[0],c=c[1],e&&i<e&&(h=e),c&&i>c&&(h=c)):h=c,h&&(b.css("height",h),d.css("height",h-a.$title.outerHeight())));
a.$shadow.css({width:b.outerWidth(),height:b.outerHeight()});setTimeout(function(){a.$dialog&&a.$shadow.css({width:b.outerWidth(),height:b.outerHeight()});o&&a.moveTo()},300)},show:function(a,b){var d=this;a&&d.moveTo(a,b);if(d.$dialog&&!d.bShow){var c=d.settings;if(c.beforeShow&&!1===c.beforeShow.call(d))return d;var e=d.$dialog.add(d.$shadow);c.modal&&G(d);var f=c.animate;f?e.fadeIn(f):e.show();d.updateSize();d.bShow=!0;e=c.time;0<e&&setTimeout(function(){d.hide()},e);c.afterShow&&c.afterShow.call(d)}return d},
hide:function(a){var b=this.settings;if(this.bShow){if(b.beforeHide&&!1===b.beforeHide.call(this))return this;var d=this.$dialog.add(this.$shadow);b.modal&&(r.pop(),v--,0==v?u.hide():u.css("zIndex",r[r.length-1].zIndex));var c=0.5*b.animate;a!=p&&(c=a);c?d.fadeOut(c):d.hide();this.bShow=!1;b.afterHide&&b.afterHide.call(this)}return this},moveTo:function(a,b){var d=this.settings,c=this.$dialog;b!==p&&(a={left:a,top:b});a!==p?d.position=a:a=d.position;var e,f=n.scrollLeft||s.scrollLeft,i=n.scrollTop||
s.scrollTop,g=n.clientWidth,h=n.clientHeight,j=c.outerWidth(),k=c.outerHeight(),c=a.right;e=a.bottom;c=a.left!=p?a.left:"center"!=c?g-j-c:c;e=a.top!=p?a.top:"center"!=e?h-k-e:e;"center"==c&&(c=(g-j)/2);"center"==e&&(e=(h-k)/2);d.fixed&&o&&(c+=f,e+=i);if(f=this.offsetFix)c+=f.x,e+=f.y;f=d.animate&&this.bShow?"animate":"css";d=d.shadow;this.$dialog[f]({left:c,top:e});this.$shadow[f]({left:c+d,top:e+d});o&&this.changeFixed();return this},setTopLayer:function(){var a=this.settings.modal?1:0;if(!this.zIndex||
this.zIndex+3<x[a])this.zIndex=x[a]++,this.$shadow.css("zIndex",x[a]++),this.$dialog.css("zIndex",x[a]++);return this},remove:function(){var a=this.$dialog;if(a)this.hide(),a.parent().html("").remove(),this.$dialog=this.$shadow=null,this.bShow=!1},changeFixed:function(a){var b=this.settings;a!=p?b.fixed=a:a=b.fixed;var d=this.$dialog[0].style,c=this.$shadow[0].style;if(a)if(o){var a=parseInt(d.left)-n.scrollLeft,e=parseInt(d.top)-n.scrollTop;c.position=d.position="absolute";d.setExpression("left",
"(document.documentElement||document.body).scrollLeft+"+a+"+'px'");d.setExpression("top","(document.documentElement||document.body).scrollTop+"+e+"+'px'");c.setExpression("left","(document.documentElement||document.body).scrollLeft+"+(a+b.shadow)+"+'px'");c.setExpression("top","(document.documentElement||document.body).scrollTop+"+(e+b.shadow)+"+'px'")}else c.position=d.position="fixed";else c.position=d.position="absolute",o&&(d.removeExpression("left"),d.removeExpression("top"));return this}};C.dDialog=
w;dDialog.alert=function(a,b){function d(a){if(!c){if(b&&!1==b({type:a}))return!1;c=!0;"hide"!=a&&e.hide();e=null}}var c=!1,e,l=f('<div class="dd_info">'+a+'</div><div class="dd_button"><button class="dd_ok">\u786e\u5b9a</button></div>'),i=l.find("button");e=y(l,function(){return d("hide")});i.focus().click(function(){d("ok")})};dDialog.confirm=function(a,b){function d(a){if(!c){if(b&&!1==b({type:a}))return!1;c=!0;"hide"!=a&&e.hide();e=null}}var c=!1,e,l=f('<div class="dd_info">'+a+'</div><div class="dd_button"><button class="dd_ok">\u786e\u5b9a</button><button class="dd_cancel">\u53d6\u6d88</button></div>'),
i=l.find("button");e=y(l,function(){return d("hide")});i.click(function(){d(this.className.substr(3))}).eq(0).focus()};dDialog.prompt=function(a,b,d){function c(a,c){if(!e){if(d&&!1==d({type:a,data:c}))return!1;e=!0;"hide"!=a&&l.hide();l=null}}var e=!1,l,a=f('<div class="dd_info">'+a+'<br /><br /><input type="text" size="30" value="'+b+'"/></div><div class="dd_button"><button class="dd_ok">\u786e\u5b9a</button><button class="dd_cancel">\u53d6\u6d88</button></div>'),i=a.find("input");a.find("button").click(function(){var a=
this.className.substr(3);c(a,"ok"==a?i.val():"")});a.find("input[type=text]").keypress(function(a){13==a.which&&c("ok",i.val())});l=y(a,function(){return c("hide")});i.focus()};dDialog.messageSettings={type:"html",modal:!0,drag:!0,fixed:!0,animate:!1,width:[0,300]};dDialog.popup=function(a,b,d){b||(b={});d||(d={});var c=new dDialog(f.extend({},dDialog.popupSettings,{content:a,corner:b.corner},d));c.popupTo=function(a,b){var d=f(a);b?e=b:b=e;var g=d.offset(),i=d.outerWidth(),d=d.outerHeight(),h=g.left,
g=g.top;if(b)if(b.left!=p)h+=b.left,g+=b.top;else if(b.match(/^center$/i))h+=i/2,g+=d/2;else{var j=b.match(/[a-z]+|[A-Z][a-z]+|\d+/g),l=j[0].substr(0,1),k=j[1].substr(0,1),j=j[2]?parseInt(j[2]):0;l.match(/[tb]/)?("b"==l&&(g+=d),h="L"==k?h+j:"C"==k?h+i/2:h+(i-j)):("r"==l&&(h+=i),g="T"==k?g+j:"C"==k?g+d/2:g+(d-j))}else h+=i,g+=d;c.moveTo(h,g);return this};var a=b.target,e=b.position;a?c.popupTo(a):e&&e.left&&c.moveTo(e);var l,i,d=b.show,g;if(d&&(g=d.target?d.target:a)){var h=d.delay?d.delay:0;f(g).bind(d.event,
function(){var a=this;h?(clearTimeout(l),l=setTimeout(function(){c.popupTo(a).show()},h)):c.popupTo(a).show()})}if(b=b.hide)if(g=b.target,g="both"==g?c.$dialog.add(a):a){var j=b.delay,k=f(g);k.bind(b.event,function(a){for(var b=a.relatedTarget,d=0;d<k.length;d++)if(a=k[d],a===b||f.contains(a,b))return;clearTimeout(l);j?(clearTimeout(i),i=setTimeout(function(){c.hide()},j)):c.hide()});j&&k.mouseover(function(){clearTimeout(i)})}return c};dDialog.popupSettings={noTitle:!0,noClose:!0};f.fn.dDialog=function(a){var b=
[],d;this.each(function(){d=f(this).hide().children("div");b.push(new dDialog(f.extend(a,{title:d[0].childNodes,content:d[1].childNodes})))});0===b.length&&(b=!1);1===b.length&&(b=b[0]);return b};f.fn.dTip=function(a){var b,d;function c(){g.hide();j=!1}this.each(function(){var a=f(this);a.attr("dtitle",a.attr("title")).removeAttr("title")});var e=f.extend({},{maxWidth:300,delay:200},a),a={content:"",noTitle:!0,noClose:!0,skin:"tip",shadow:3},l=e.delay,i=e.maxWidth,e=e.skin;if(i)a.width=[0,i];if(e)a.skin=
e;var g=new dDialog(a),h,j,k;this.bind({mouseover:function(){c();h=!1},mousemove:function(a){if(!h){var e=f(this);if(j){if(10<Math.abs(a.pageX-b)||10<Math.abs(a.pageY-d))c(),h=!0}else clearTimeout(k),k=setTimeout(function(){g.setContent(e.attr("dtitle")).moveTo(a.pageX,a.pageY+22).show();j=!0;b=a.pageX;d=a.pageY},l)}},mouseout:function(){h||(clearTimeout(k),c())}});return this}})(jQuery,window,document);

