//Version:20100316
window._open=window.open;window.open=function(d,b,c,a){if(arguments.length==3&&typeof(arguments[2])=="string"){return window._open(arguments[0],arguments[1],arguments[2])}else{new TSPopup(b,d,true,true,false,c,a).show()}};var TSPopup=function(j,d,c,a,f,e,b,h){if(j==null){j="__default__instance__"}this.id=j;var g=TSPopup["_"+j];if(!g){g=TSPopup["_"+j]=this}if(typeof(d)=="string"){g.DivMode=false;g.URL=d;g.Layer=null}else{g.DivMode=true;g.Layer=d}g.showTitle=c||false;g.showCurtain=a||false;g.curtainColor=TSPopup.curtainColor;g.curtainOpacity=g.showCurtain?TSPopup.curtainOpacity:0;g.showCurtain=true;g.borderColor=TSPopup.borderColor;g.autoSnapping=f||false;g.autoClose=e||false;g.width=b;g.height=h;return g};TSPopup.showDiv=function(d,c,a){if(typeof(c)=="undefined"){c=true}if(typeof(a)=="undefined"){a=false}var b=document.getElementById(d);if(b.parentNode!=document.body){document.body.appendChild(b)}TSPopup._divHandler=new TSPopup(null,b,false,c,a);TSPopup._divHandler.show()};TSPopup.closeDiv=function(){TSPopup._divHandler.close()};TSPopup.version="1.3.0";TSPopup.file="popup.js";TSPopup.minWidth=200;TSPopup.minHeight=150;TSPopup.maxParent=null;TSPopup.borderColor="#3399FF";TSPopup.curtainColor="#000";TSPopup.curtainOpacity=50;TSPopup.customUI=null;TSPopup.debugMode=false;TSPopup.debug=function(){if(!TSPopup.debugMode){return}var d=arguments[0];for(var b=1;b<arguments.length;b++){d=d.replace("{}",arguments[b])}if(!TSPopup.debugWin){TSPopup.debugWin=window._open("about:blank","debugConsole","height=300,width=500,menubar=no,toolbar=no,titlebar=no,status=no,scrollbars=yes,resizable=yes")}var a=new Date();if(TSPopup.debugWin.document.__lastPrint&&a.getTime()-TSPopup.debugWin.document.__lastPrint.getTime()>1*1000){TSPopup.debugWin.document.body.innerHTML+="<br/>"}var c=(a.getHours()>9?a.getHours():"0"+a.getHours())+":"+(a.getMinutes()>9?a.getMinutes():"0"+a.getMinutes())+":"+(a.getSeconds()>9?a.getSeconds():"0"+a.getSeconds())+"."+(a.getMilliseconds()>99?a.getMilliseconds():"0"+(a.getMilliseconds()>9?a.getMilliseconds():"0"+a.getMilliseconds()));TSPopup.debugWin.document.body.innerHTML+="<strong>["+c+"]</strong> "+d+"<br/>";TSPopup.debugWin.document.__lastPrint=a};TSPopup.printStack=function(d){if(!d){d=20}func=arguments.callee.caller;var b=0;var a=[];while(func!=null&&b++<d){var c=(func.arguments.callee+"").replace(/function\s*|\s*{[\s\S]*/g,"");if(c.charAt(0)=="("){c=func.arguments.callee+"";if(c.length>80){c=c.substring(0,80)+"..."}}a.push(c);func=func.caller}TSPopup.debug("Stack:<br/>"+a.join("<br/>|-"))};TSPopup.prototype.initCurtain=function(){TSPopup.debug("initCurtain");if(!this.curtain){var b=document.createElement("DIV");b.style.position="absolute";b.style.zIndex="100";b.style.top="0px";b.style.left="0px";b.style.width="100px";b.style.height="100px";b.style.display="none";b.style.border="0";b.style.backgroundColor=this.curtainColor;document.all?b.style.filter="alpha(opacity="+this.curtainOpacity+");":b.style.opacity=(this.curtainOpacity/100);document.body.appendChild(b);if(document.all&&([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1]==6)){b.innerHTML='<iframe style="position:absolute;z-index:10;filter:alpha(opacity=0);width:100%;height:100%;" scrolling="no" frameborder="0"></iframe><div style="position:absolute;z-index:50;background-color:#000;filter:alpha(opacity=0);width:100%;height:100%" onclick="this.parentElement.onclick()"></div>'}this.curtain={coverDiv:b,show:function(){if(window._popupHandler){TSPopup.debug("parent cutain color: {}",window._popupHandler.curtain.coverDiv.style.backgroundColor)}this.resize();this.coverDiv.style.display=""},resize:function(){this.coverDiv.style.height=0;this.coverDiv.style.width=0;var d=TSPopup.stage();var e=(d.offsetWidth>d.width?d.offsetWidth-1:d.width)+"px";var c=(d.offsetHeight>d.height?d.offsetHeight-1:d.height)+"px";this.coverDiv.style.height=c;this.coverDiv.style.width=e},hide:function(){this.coverDiv.style.display="none"}}}this.curtain.coverDiv.style.backgroundColor=this.curtainColor;document.all?this.curtain.coverDiv.style.filter="alpha(opacity="+this.curtainOpacity+");":this.curtain.coverDiv.style.opacity=(this.curtainOpacity/100);if(this.autoClose||this.curtainOpacity==0){var a=this;this.curtain.coverDiv.onclick=function(){a.close()}}else{this.curtain.coverDiv.onclick=function(){}}};TSPopup.prototype.initLayer=function(){TSPopup.debug("initLayer");if(!this.Layer&&TSPopup.Layer){this.Layer=TSPopup.Layer;this.Layer.innerHTML=""}else{var b=this.Layer=TSPopup.Layer=document.createElement("DIV");b.id=this.id;b.style.position="absolute";b.style.zIndex="9000";b.style.display="none";b.style.backgroundColor="#fff";document.body.appendChild(b)}if(this.borderColor){this.Layer.style.border="1px solid "+this.borderColor}else{this.Layer.style.border="0px none"}if(this.showTitle){if(TSPopup.customUI){this.Layer.innerHTML=TSPopup.customUI.replace(/#id#/g,this.id)}else{var c=TSPopup.getBaseURL();this.Layer.innerHTML='<div style="height:22px; background: url('+c+'popup_bg.gif) repeat-x;"><img style="float:left; margin:2px 0 0 12px;" src="'+c+'popup_title.gif" width="20" height="18" /><div id="'+this.id+'_title" style="float:left; margin:3px 0px 0px 10px; color:#FFF;"></div><div style="float:right; margin-right:4px;"><img src="'+c+'popup_close.gif" width="31" height="19" onclick="TSPopup[\'_'+this.id+'\'].close();" style="cursor:pointer;"/></div></div>'}try{this.Layer.Title=document.getElementById(this.id+"_title")}catch(d){}}var a=this.Layer.Frame=document.createElement("iframe");a.frameBorder="0";a.allowTransparency=true;if(document.getElementById(this.id+"_content")){document.getElementById(this.id+"_content").appendChild(a)}else{this.Layer.appendChild(a)}};TSPopup.prototype.show=function(){TSPopup.debug("show");if(window._popupHandler){var c=TSPopup.maxParent;if(c==null){c=!this.DivMode}if(c){window._popupHandler.maximize()}}var b=this;document.oncontextmenu=function(){return false};if(this.showCurtain){this.initCurtain();this.curtain.show()}if(this.autoSnapping){var d=TSPopup.getEvent();if(d){this.snappingElement=d.srcElement||d.target}else{this.autoSnapping=false}}if(this.autoSnapping){this.showCurtain&&TSPopup.attachEvent(window,"resize",function(){b.curtain.resize()})}else{TSPopup.attachEvent(window,"resize",function(){b.rePosition()});TSPopup.attachEvent(window,"scroll",function(){if(b._scrollTimer){clearTimeout(b._scrollTimer)}b._scrollTimer=setTimeout(function(){b.rePosition()},200)})}this.isClosed=false;if(this.DivMode){this.fadeOut();this.Layer.style.top="0";this.Layer.style.left="0";this.Layer.style.position="absolute";this.Layer.style.display="";this.autoSnapping?this.snapping():this.rePosition();this.fadeIn()}else{this.initLayer();var a=this.Layer.Frame;TSPopup.attachEvent(a,"load",function(){if(a.contentWindow._popupHandler){return}a.contentWindow._popupHandler=b;b.fadeOut();setTimeout(function(){b.render()},100);b.registerAPI()});this.fadeOut();a.src=this.URL}};TSPopup.prototype.render=function(){TSPopup.debug("render");if(this.isClosed){return}var a=this.Layer;var d=a.Frame;d.width=1;d.height=1;a.style.top="0";a.style.left="0";a.style.display="";var g=50*2;var b=TSPopup.stage();var h=d.contentWindow.document;var c=h.documentElement.scrollWidth;if(this.showTitle){c=TSPopup.minWidth>c?TSPopup.minWidth:c}if(b.width<c+g){d.width=b.width-g}else{if(this.width){d.width=(b.width>this.width+g?this.width:b.width-g)}else{if(h.body.style.width||h.documentElement.style.width){if(h.documentElement.scrollWidth>c){c=h.documentElement.scrollWidth}if(h.body.scrollWidth>c){c=h.body.scrollWidth}d.width=(b.width>c+g?c:b.width-g)}else{d.width=b.width-g}}}a.normalWidth=d.width;var e=h.documentElement.scrollHeight;if(h.body.scrollHeight>e){e=h.body.scrollHeight}if(this.showTitle){e=TSPopup.minHeight>e?TSPopup.minHeight:e}var f=d.offsetTop;if(b.height<f+e+g){d.height=b.height-f-g;h.documentElement.style.overflowX="hidden";a.normalWidth=d.width=parseInt(d.width)+20}else{if(this.height){d.height=(b.height>this.height+f+g?this.height:b.height-f-g)}else{d.height=e}}a.normalHeight=parseInt(d.height)+parseInt(d.offsetTop);this.autoSnapping?this.snapping():this.rePosition();if(a.Title){a.Title.innerHTML=h.title}this.fadeIn()};TSPopup.prototype.fadeOut=function(b,c,a){TSPopup.debug("fadeout");this.Layer.style.zIndex="8990";document.all?this.Layer.style.filter="alpha(opacity=1);":this.Layer.style.opacity=0.01};TSPopup.prototype.fadeIn=function(d,e,c){TSPopup.debug("fadein");if(!d){d=70;e=c=5;document.all?this.Layer.style.filter="alpha(opacity="+d+");":this.Layer.style.opacity=(d/100);this.Layer.style.zIndex="9000"}d=d>100?100:d;var b=this.Layer;document.all?b.style.filter="alpha(opacity="+d+");":b.style.opacity=(d/100);if(d!=100){d+=e;e+=c;var a=this;setTimeout(function(){a.fadeIn(d,e,c)},100)}};TSPopup.prototype.registerAPI=function(){TSPopup.debug("registerAPI");var b=this.Layer.Frame.contentWindow;var a=this;b.close=function(){a.close()};b.document.oncontextmenu=function(){return false}};TSPopup.prototype.snapping=function(){TSPopup.debug("snapping");if(this.showCurtain){this.curtain.resize()}var b=TSPopup.getAbsolutePosition(this.snappingElement);var a=TSPopup.stage();if(a.top+a.height<b.top+b.height+this.Layer.offsetHeight&&b.top-this.Layer.offsetHeight>a.top){this.Layer.style.top=b.top-this.Layer.offsetHeight+"px"}else{this.Layer.style.top=(b.top+b.height)+"px"}if(a.left+a.width<b.left+this.Layer.offsetWidth){this.Layer.style.left=a.left+a.width-this.Layer.offsetWidth-3+"px"}else{this.Layer.style.left=b.left+"px"}};TSPopup.prototype.rePosition=function(){TSPopup.debug("rePosition");if(this.isClosed||!this.Layer){return}if(this.showCurtain){this.curtain.resize()}var b=TSPopup.stage();var a=this.Layer;a.style.top=b.top+(b.height-a.offsetHeight)/2+"px";a.style.left=b.left+(b.width-a.offsetWidth)/2+"px"};TSPopup.prototype.maximize=function(){TSPopup.debug("maximize");var a=this.Layer;a.style.top="0px";a.style.left="0px";var b=TSPopup.stage();var d=parseInt(b.width)-(parseInt(a.offsetWidth)-parseInt(a.Frame.offsetWidth));a.Frame.width=d;var c=parseInt(b.height)-(parseInt(a.offsetHeight)-parseInt(a.Frame.offsetHeight));a.Frame.height=c;this.rePosition()};TSPopup.prototype.normalize=function(){TSPopup.debug("normalize");this.fadeOut();this.Layer.Frame.width=this.Layer.normalWidth;this.Layer.Frame.height=this.Layer.normalHeight;this.rePosition();this.fadeIn()};TSPopup.prototype.close=function(){TSPopup.debug("close");this.isClosed=true;this.Layer.style.display="none";if(this.showCurtain){this.curtain.hide()}window.document.oncontextmenu=null;if(window._popupHandler){var a=TSPopup.maxParent;if(a==null){a=!this.DivMode}if(a){window._popupHandler.normalize()}}if(this.onclose){this.onclose()}};TSPopup.getBaseURL=function(){var scripts=document.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){if(eval("/"+TSPopup.file.replace(".","\\.")+"$/").test(scripts[i].src)){return scripts[i].src.substring(0,scripts[i].src.length-TSPopup.file.length)}}};TSPopup.attachEvent=function(c,a,b){if(document.all){c.attachEvent("on"+a,b)}else{c.addEventListener(a,b,false)}};TSPopup.detachEvent=function(c,a,b){if(document.all){c.detachEvent("on"+a,b)}else{c.removeEventListener(a,b,false)}};TSPopup.stage=function(){var b=false;try{b=document.compatMode=="CSS1Compat"}catch(c){}var a=b?document.documentElement:document.body;return{top:a.scrollTop,left:a.scrollLeft,width:a.clientWidth,height:a.clientHeight,offsetWidth:a.scrollWidth,offsetHeight:a.scrollHeight}};TSPopup.getEvent=function(){if(document.all){return window.event}func=arguments.callee.caller;var a=0;while(func!=null&&a++<100){var b=func.arguments[0];if(b){if((b.constructor==Event||b.constructor==MouseEvent)||(typeof(b)=="object"&&b.preventDefault&&b.stopPropagation)){return b}}func=func.caller}if(a==100){TSPopup.printStack()}return null};TSPopup.getAbsolutePosition=function(c){var e=0,d=0;var b=c.offsetWidth,a=c.offsetHeight;while(c.offsetParent){e+=c.offsetTop;d+=c.offsetLeft;c=c.offsetParent}return{top:e,left:d,width:b,height:a}};TSPopup.makeSwfOpaque=function(){var d=new Array();var b=document.getElementsByTagName("object");for(i=0;i<b.length;i++){d.push(b[i])}var j=document.getElementsByTagName("embed");for(i=0;i<j.length;i++){if(!/object/i.test(j[i].parentNode.tagName)){d.push(j[i])}}for(i=0;i<d.length;i++){var c=d[i];var h=document.createElement("span");c.parentNode.insertBefore(h,c);h.appendChild(c);var e=h.innerHTML;if(!/clsid:d27cdb6e-ae6d-11cf-96b8-444553540000/i.test(e)&&!/clsid:d27cdb6e-ae6d-11cf-96b8-444553540000/i.test(e)&&!/application\/x-shockwave-flash/i.test(e)){continue}var f=/<param\s+name="wmode"\s+value="window".*>/i;e=e.replace(f,'<param name="wmode" value="opaque" />');var a=/wmode="window"/i;e=e.replace(a,'wmode="opaque"');if(!/\s+name="wmode"/i.test(e)){var g=e.indexOf(">");e=e.substring(0,g+1)+'<param name="wmode" value="opaque" />'+e.substring(g+1)}if(/<embed\s+/i.test(e)&&!/\s+wmode="/i.test(e)){e=e.replace(/<embed\s+/i,'<embed wmode="opaque" ')}h.innerHTML=e}};TSPopup.addDOMLoadEvent=(function(){var load_events=[],load_timer,script,done,exec,old_onload,init=function(){done=true;clearInterval(load_timer);while(exec=load_events.shift()){exec()}if(script){script.onreadystatechange=""}};return function(func){if(done){return func()}if(!load_events[0]){if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,false);
/*@cc_on @*/
/*@if (@_win32)
                document.write("<script id=__ie_onload defer src=//0><\/scr"+"ipt>");
                script = document.getElementById("__ie_onload");
                script.onreadystatechange = function() {
                    if (this.readyState == "complete")
                        init(); // call the onload handler
                };
            /*@end @*/
}if(/WebKit/i.test(navigator.userAgent)){load_timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){init()}},10)}old_onload=window.onload;window.onload=function(){init();if(old_onload){old_onload()}}}load_events.push(func)}})();TSPopup.getScrollerWidth=function(){if(TSPopup._scrollerWidth){return TSPopup._scrollerWidth}var a=0;var b=0;var d=document.createElement("div");d.style.position="absolute";d.style.top="-1000px";d.style.left="-1000px";d.style.width="100px";d.style.height="100px";d.style.overflow="hidden";document.body.appendChild(d);a=d.clientWidth;var c=document.createElement("div");c.style.width="200px";c.style.height="200px";d.style.overflow="auto";d.appendChild(c);b=d.clientWidth;document.body.removeChild(d);TSPopup._scrollerWidth=a-b;return TSPopup._scrollerWidth};/*TSPopup.addDOMLoadEvent(TSPopup.makeSwfOpaque);*/
