/*
 * Compressed by JSA(www.xidea.org)
 */
if(!window.Prototype)alert("\u9700\u8981prototype\u5e93\u652f\u6301");if(typeof(window.HTMLElement)!="undefined"&&!window.opera){HTMLElement.prototype.__defineGetter__("outerHTML",function(){var _=this.attributes,$="<"+this.tagName,A=0;for(;A<_.length;A++)if(_[A].specified)$+=" "+_[A].name+"=\""+_[A].value+"\"";if(!this.canHaveChildren)return $+" />";return $+">"+this.innerHTML+"</"+this.tagName+">"});HTMLElement.prototype.__defineSetter__("outerHTML",function(_){var $=document.createElement("DIV");$.innerHTML=_;for(var A=0;A<$.childNodes.length;A++)this.parentNode.insertBefore($.childNodes[A],this);this.parentNode.removeChild(this)});HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){return!/^(area|base|basefont|col|frame|hr|img|br|input|isindex|link|meta|param)$/.test(this.tagName.toLowerCase())})}Object.extend(String.prototype,{ltrim:function(){return this.replace(/(^\s*)/g,"")},rtrim:function(){return this.replace(/(\s*$)/g,"")},trim:function(){return this.ltrim(this.rtrim())}});Object.extend(Array.prototype,{remove:function($){var A=false;for(var B=0;B<this.length;B++)if(this[B]==$){A=true;for(var _=B;_<this.length;_++)this[_]=this[_+1];this.length=this.length-1;break}return A},$toString:function($){var _="";for(var A=0;A<this.length;A++)if(A==0)_=this[A];else _+=$+this[A];return _},isExist:function($){for(var _=0;_<this.length;_++)if($==this[_])return true;return false},empty:function(){return this.length==0}});Date.prototype.format=function($){if($){$=$.replace("yyyy",this.getFullYear());$=$.replace("mm",this.getMonth()+1);$=$.replace("dd",this.getDate());$=$.replace("h",this.getHours());$=$.replace("m",this.getMinutes());$=$.replace("s",this.getSeconds())}return $};var mercury={};mercury.Guid=function(){var _=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],$="";for(var A=0;A<32;A++){if(A!=0&&A%8==0)$+="-";$+=_[Math.floor(Math.random()*36)]}return $};mercury.apply=function(B,_,$){if($)mercury.apply(B,$);if(B&&_&&typeof _=="object")for(var A in _)B[A]=_[A];return B};var __init__=function(){var idSeed=0,ua=navigator.userAgent.toLowerCase(),isStrict=document.compatMode=="CSS1Compat",isOpera=ua.indexOf("opera")>-1,isSafari=(/webkit|khtml/).test(ua),isIE=ua.indexOf("msie")>-1,IEVersion=parseInt(navigator.appVersion.split("MSIE")[1]),isIE7=ua.indexOf("msie 7")>-1,isIE6=ua.indexOf("msie 6")>-1,isIE55=/msie 5\.[56789]/i.test(ua),isFirefox=ua.indexOf("firefox")>-1,isFirefox3=ua.indexOf("firefox/3.0")>-1,isGecko=!isSafari&&ua.indexOf("gecko")>-1,isBorderBox=isIE&&!isStrict,isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),isVista=(isWindows&&ua.indexOf("nt 6.0")!=-1&&ua.indexOf("clr 3.0.04506")!=-1),isWin98=(isWindows&&ua.indexOf("win98")!=-1),isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),isLinux=(ua.indexOf("linux")!=-1),isSecure=window.location.href.toLowerCase().indexOf("https")===0;mercury.apply(mercury,{isIE:isIE,isIE7:isIE7,isIE55:isIE55,isIE6:isIE6,isFirefox:isFirefox,isFirefox3:isFirefox3,IEVersion:IEVersion,isVista:isVista,isWin98:isWin98,isPageLoaded:false,namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+" == \"undefined\"){"+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}},extend:function(){var _={};for(var $=0;$<arguments.length;$++)Object.extend(_,arguments[$]);return _},onReady:function($){if(this.isFunction($)){var _="DOMContentLoaded";if(this.isIE)Event.observe(document,"readystatechange",function(){if(document.readyState=="complete")$()},false);else Event.observe(document,"DOMContentLoaded",$,false)}},createEl:function(A,D){var B={id:mercury.dom.id(),parentNode:null,type:null};Object.extend(B,D);var _=document.createElement(A);if(B.id)_.id=B.id;if(B.type)_.type=B.type;var C=$(B.parentNode);if(C)C.appendChild(_);return $M(_)},writeObjectTagStr:function(A,E,D,B,_){var C="<OBJECT title='"+_+"'   ID='"+A+"' width='0' height='0'"+"\tCLASSID='"+E+"'  "+"\tCODEBASE='"+D+"#version="+B+"'></OBJECT>";document.writeln(C);return $(A)},$import:function($,_){if(_=="css")document.write("<"+"link href=\""+$+"\" rel=\"stylesheet\" type=\"text/css\"></"+"link>");else document.write("<"+"script src=\""+$+"\" ></"+"script>")},isFunction:function($){return(typeof($)=="function")},debugJson:function(A,_){if(_==undefined||_==false)alert(Object.toJSON(A));else if(A){var $="";for(p in A)$+=p+"\n";alert($)}},evalJSON:function(A){var $=null;if(A!=undefined){A+="";try{$=A.replace(/\\/g,"/");$=$.replace(/\r|\n|\t|\f\v/g,"");$=$.evalJSON()}catch(_){}}return $},getClientSize:function(){if(document.body)return[document.body.clientWidth,document.documentElement.clientHeight];else return[0,0]},filter:function(A,B,C){try{A=$M(A);if(A){var $=A.getContent();$=$.toLowerCase();B=B.toLowerCase();if(this.isFunction(C))C($.indexOf(B)!=-1)}}catch(_){alert(_.description)}},purge:function($){var _=$.attributes;if(_){var B=_.length;for(var C=0;C<B;C+=1){var A=_[C].name;if(typeof $[A]==="function")$[A]=null}}_=$.childNodes;if(_){B=_.length;for(C=0;C<B;C+=1)this.purge($.childNodes[C])}},__safeRemove:function(_){if(_){var $="__tempdiv__",A=$M($);if(!A){A=this.createEl("DIV",{id:$,parentNode:document.body});A.hide()}A.control().appendChild(_.control());A.setContent("")}},removeEl:function($){$=$M($);if($&&$.parent())if(mercury.isIE)this.__safeRemove($);else Element.remove($.control())},isBodyHasScroll:function(){return(document.documentElement.scrollHeight-document.documentElement.clientHeight>0)},isActiveXExist:function($){var A=false;try{new ActiveXObject($);A=true}catch(_){A=false}return A},onSafeLoad:function($){if(this.isFunction($))if(this.isPageLoaded)$();else Event.observe(window,"load",$,false)},getWindowSize:function(){return{x:document.documentElement.clientWidth,y:document.documentElement.clientHeight}}})}();Event.observe(window,"load",function(){mercury.isPageLoaded=true},false);mercury.namespace("mercury.dom","mercury.lib","mercury.ui");var ____domId=0;mercury.dom.id=function(){return"mercury_dom_"+(++____domId)};mercury.lib.Rect=Class.create();mercury.lib.Rect.prototype={initialize:function(){if(arguments.length==1){this.left=arguments[0].left;this.top=arguments[0].top;this.width=arguments[0].width;this.height=arguments[0].height}else if(arguments.length==2){this.left=arguments[0].x;this.top=arguments[0].y;this.width=arguments[1].x;this.height=arguments[1].y}else if(arguments.length==3){this.left=arguments[0].x;this.top=arguments[0].y;this.width=arguments[1];this.height=arguments[2]}else if(arguments.length==4){this.left=arguments[0];this.top=arguments[1];this.width=arguments[2];this.height=arguments[3]}return this},right:function(){return this.left+this.width},bottom:function(){return this.top+this.height},origin:function(){return new mercury.lib.Pointint(this.left,this.top)},center:function(){return new mercury.lib.Point(this.left+this.width/2,this.top+this.height/2)},size:function(){return new mercury.lib.Point(this.width,this.height)},area:function(){return this.width*this.height},offset:function(){var $=mercury.lib.Point.newPoint(arguments);this.left+=$.x;this.top+=$.y;return this},resize:function(){var $=mercury.lib.Point.newPoint(arguments);this.width=$.x;this.height=$.y;return this},inflat:function(){var $=mercury.lib.Point.newPoint(arguments);this.offset(-$.x,-$.y);this.width+=$.x+$.x;this.height+=$.y+$.y;return this},intersection:function(_){var A=Math.min(this.right(),_.right()),$=Math.min(this.bottom(),_.bottom());this.left=Math.max(this.left,_.left);this.top=Math.max(this.top,_.top);this.width=Math.max(0,A-this.left);this.height=Math.max(0,$-this.top);return this},isInBound:function(){var $=mercury.lib.Point.newPoint(arguments);return(($.x>this.left)&&($.x<(this.left+this.width))&&($.y>this.top)&&($.y<(this.top+this.height)))}};mercury.lib.Point=Class.create();mercury.lib.Point.prototype={initialize:function(){if(arguments.length==1)this.make(arguments[0].x,arguments[0].y);else if(arguments.length==2)this.make(arguments[0],arguments[1]);else this.make(0,0)},make:function(_,$){this.x=_;this.y=$;return this},offset:function(){var $=mercury.lib.Point.newPoint(arguments);this.x+=$.x;this.y+=$.y;return this}};mercury.lib.Point.newPoint=function($){if($.length==0)return new mercury.lib.Point();else if($.length==1)return new mercury.lib.Point($[0]);else if($.length==2)return new mercury.lib.Point($[0],$[1]);else return new mercury.lib.Point()};mercury.lib.Point.newSize=mercury.lib.Point.newPoint;mercury.lib.Point.MousePoint=function($){if($.clientX)return new mercury.lib.Point($.clientX+document.documentElement.scrollLeft,$.clientY+document.documentElement.scrollTop);else return new mercury.lib.Point($.pageX,$.pageY)};mercury.dom.MDom=Class.create();mercury.dom.MDom.prototype={initialize:function(_){this.bind($(_))},bind:function($){this.bindElem=$},append:function($){if(($ instanceof mercury.dom.MDom)&&this.bindElem)this.bindElem.appendChild($.control())},clear:function(){if(this.bindElem)this.setContent("")},visible:function($){if($==true)Element.show(this.bindElem);else Element.hide(this.bindElem)},setVisible:function($){if(this.bindElem)if($)this.bindElem.style.visibility="visible";else this.bindElem.style.visibility="hidden"},show:function(){this.visible(true)},hide:function(){this.visible(false)},opcity:function($){Element.setStyle(this.bindElem,{"opacity":$/100,"filter":"alpha(opacity="+$+")"})},control:function(){return this.bindElem},isValid:function(){return typeof(this.bindElem)!="undefined"},origin:function(){var _=new mercury.lib.Point(0,0),$=this.bindElem;while($!=null&&$!=window){_.offset($.offsetLeft,$.offsetTop);$=$.offsetParent}return _},size:function(){return new mercury.lib.Point(this.bindElem.offsetWidth,this.bindElem.offsetHeight)},rect:function(){return new mercury.Rect(this.origin(),this.size())},setPosition:function($){Element.setStyle(this.bindElem,{"position":"absolute","left":$.x+"px","top":$.y+"px"})},setFloat:function($){Element.setStyle(this.bindElem,{"float":$})},setSize:function($){Element.setStyle(this.bindElem,{"width":$.x+"px","height":$.y+"px"})},setRect:function($){Element.setStyle(this.bindElem,{"position":"absolute","left":$.left+"px","top":$.top+"px","width":$.width+"px","height":$.height+"px"})},isInBound:function(){var _=this.rect(),A=-1,$=-1;_.inflat(A,$);return _.isInBound(mercury.lib.Point.newPoint(arguments))},isVisible:function(){return!(this.bindElem.style.display=="none")},alignCenter:function($){var B=this.size(),A=(document.body.clientWidth-B.x)/2+document.documentElement.scrollLeft,_=(document.documentElement.clientHeight-B.y)/2+document.documentElement.scrollTop;if(_<0)_=200;this.setPosition(new mercury.lib.Point(A,_))},clear:function(){if(this.bindElem)this.bindElem.innerHTML=""},setContent:function($){if(this.bindElem)if(this.bindElem.tagName.toLowerCase()=="input")this.bindElem.value=$;else this.bindElem.innerHTML=$},appendContent:function(_){var $=this.getContent();this.setContent($+_)},getContent:function(){if(this.bindElem)return this.bindElem.innerHTML;return""},disabled:function(_){if(this.bindElem){var $=this.bindElem.getAttribute("disableCls");if(!this.bindElem.disabled)this.bindElem.setAttribute("enableCls",this.bindElem.className);this.bindElem.disabled=true;if(_)this.bindElem.className=_;else if($)this.bindElem.className=$}},enabled:function(_){if(this.bindElem){var $=this.bindElem.getAttribute("enableCls");this.bindElem.disabled=false;if(_)this.bindElem.className=_;else if($)this.bindElem.className=$}},parent:function(){if(this.bindElem)return $M(this.bindElem.parentNode);return null},cloneNode:function($){if(this.bindElem)return $M(this.bindElem.cloneNode($));return null},setId:function($){if(this.bindElem)this.bindElem.id=$},setTitle:function($){if(this.bindElem){$=$==undefined?"":$;this.bindElem.title=$;this.bindElem.alt=$}},setTop:function($){if(this.bindElem)this.bindElem.style.top=$+"px"},setClassName:function($){if(this.bindElem)this.bindElem.className=$},addClass:function(_){if(this.bindElem){var $=this.bindElem.className;if($!=null)if($.indexOf(_)==-1){$+=" "+_;this.setClassName($)}}},getBorderWidth:function($){var _="";if(this.bindElem)switch($){case"l":_=this.bindElem.style.borderLeft;break;case"r":_=this.bindElem.style.borderRight;break;case"t":_=this.bindElem.style.borderTop;break;case"b":_=this.bindElem.style.borderBottom;break}if(_=="")_=0;else _=parseInt(_);return _},getPaddingWidth:function($){var _="";if(this.bindElem)switch($){case"l":_=this.bindElem.style.paddingLeft;break;case"r":_=this.bindElem.style.paddingRight;break;case"t":_=this.bindElem.style.paddingTop;break;case"b":_=this.bindElem.style.paddingBottom;break}if(_=="")_=0;else _=parseInt(_);return _},removeClass:function(A){if(this.bindElem){var _=this.bindElem.className;if(_&&_.indexOf(A)==-1)return;var $=_.split(" ");if($){$.remove(A);this.setClassName($.$toString(" "))}}},setWidth:function($){if(this.bindElem&&$>0)this.bindElem.style.width=$+"px";else if(typeof($)=="string")this.bindElem.style.width=$},setHeight:function($){if(this.bindElem&&$>0)this.bindElem.style.height=$+"px"},setColor:function($){if(this.bindElem)this.bindElem.style.color=$},setBgColor:function($){if(this.bindElem)this.bindElem.style.backgroundColor=$},setFontSize:function($){if(this.bindElem)this.bindElem.style.fontSize=$},on:function(_,$){Event.observe(this.bindElem,_,$,false)},un:function(_,$){Event.stopObserving(this.bindElem,_,$,false)},getCheckBoxValues:function(_){var $=[];if(this.bindElem){var C=this.bindElem.getElementsByTagName("INPUT"),B=C.length;for(var E=0;E<B;E++){var A=C[E];if(A.type.toLowerCase()=="checkbox"&&A.checked){var D=false;if(_)_.each(function($){if($==A.id)D=true});if(!D)$.push(A.value)}}}return $},setSrc:function($){if(this.bindElem)this.bindElem.src=$},getLoadingEl:function(_,C){if(!C)C="";_=$M(_);var B=function($){$.hide();var C=this.size(),B=this.origin(),A=(C.x-$.size().x)/2+B.x,_=(C.y-$.size().y)/2+B.y;$.setPosition({x:A,y:_})}.bind(this);if(!_){if(!this.__loadingEl){var $="defaultLoadingImg",A=$M($);if(!A){A=mercury.createEl("SPAN",{parentNode:this.bindElem,id:$});A.control().innerHTML="<IMG SRC=\"images/indicator.gif\"/>"+C;A.control().style.zIndex="11000";A.size({x:16,y:16});B(A)}this.__loadingEl=A}else B(this.__loadingEl)}else{if(this.__loadingEl!=_&&this.__loadingEl)mercury.removeEl(this.__loadingEl);this.__loadingEl=_;B(this.__loadingEl)}return this.__loadingEl},setLink:function(_,$){if(this.bindElem)if(this.bindElem.tagName.toLowerCase()=="a"){this.bindElem.href=_;if($)this.bindElem.target=taget}else this.bindElem.onclick=this.____bindLinkEvent(_)},____bindLinkEvent:function($){return function(){window.location.href=$}}};var $M=function(_){if(!_)return null;if(_ instanceof mercury.dom.MDom)return _;if($(_))return new mercury.dom.MDom(_);else return null};mercury.debugMode=false;mercury.ui.debug=function(A,C,$){if(!mercury.debugMode)return;if(!mercury.isPageLoaded){setTimeout(mercury.ui.debug.bind(this,A,"\u5ef6\u8fdf\u663e\u793a\u8c03\u8bd5\u4fe1\u606f",C));return}if(!$)$="";if(C==undefined)C=true;A="<br/>"+A+"  ("+$+")";var E="__debugdiv__",D="__cleardebugbtn_",_=$M(E),B=$M(D);if(!B)B=mercury.createEl("input",{parentNode:document.body,id:D,type:"button"});B.setContent("\u6e05\u7406\u8c03\u8bd5\u4fe1\u606f");B.control().onclick=function(){_.setContent("")};if(!_)_=mercury.createEl("DIV",{parentNode:document.body,id:E});_.control().style.cssText="position:absolute;left:0px;top:400px;z-index:100;width:400px;height:300px;overflow:scroll;px;background-color:black;color:#fff";if(C)_.appendContent(A);else _.setContent(A);return};mercury.ui.AutoPutCenter=Class.create();mercury.ui.AutoPutCenter.prototype={initialize:function($){this.el=$M($);if(this.el){this.__resizeFoo=function(){this.el.control().style.zIndex=100001;this.el.alignCenter()}.bind(this);this.__resizeFoo();Event.observe(window,"resize",this.__resizeFoo,false)}},destory:function(){if(this.__resizeFoo){Event.stopObserving(window,"resize",this.__resizeFoo,false);this.el=null;this.__resizeFoo=null}}};mercury.ui.MaskMgr=Class.create();mercury.ui.MaskMgr.prototype={options:{toMaskElem:"",maskCn:"default-mask"},initialize:function(){this.__readyRelease=false;this._masks=[];this._toMasks=[];this.__f__=this.__onWindowResize.bind(this);Event.observe(window,"resize",this.__f__,false)},addElem:function($,_){if(!mercury.isPageLoaded){setTimeout(this.addElem.bind(this,$,_),500);return}else if(this.__readyRelease)return;$=$M($);if($){this.__createMask($,_);this._toMasks.push($)}},__onWindowResize:function(){if(this._toMasks&&this._masks)this._masks.each(function($,_){this.__updateMask($M($),this._toMasks[_])}.bind(this))},__createMask:function(A,D){Object.extend(this.options,D);var $="100000";if(A.control().style.zIndex)$=parseInt(A.control().style.zIndex)+1;var C=A.size(),_=(A.control()==document.body)?document.body:A.parentNode(),B=mercury.createEl("DIV",{id:"__mask__"+mercury.dom.id(),parentNode:_});B.control().style.zIndex=$;B.control().innerHTML="";B.setClassName(this.options.maskCn);this.__updateMask(B,A);this._masks.push(B)},__updateMask:function(_,$){if(_&&$){var B=$.size(),A=$.origin();if($.control()==document.body)if(!mercury.isBodyHasScroll())B.y=mercury.getWindowSize().y;else B.y=document.documentElement.scrollHeight;_.setSize(B);_.setPosition(A);if(!mercury.isIE6)_.control().style.position="fixed"}},release:function(){if(this._masks){var $=this._masks.length;for(var _=0;_<$;_++){mercury.removeEl(this._masks[_]);this._masks.pop()}Event.stopObserving(window,"resize",this.__f__,false);this._toMasks=[]}this.__readyRelease=true}};mercury.ui.SimpleHTMLTemplate=Class.create();mercury.ui.SimpleHTMLTemplate.prototype={initialize:function($){this.template=$M($);if(this.template)this.template.hide();this.templateId=this.template.control().id||"";this.template.control().setAttribute("createby",this.templateId);this.insertPoint=this.template.cloneNode(true);this.rows=[]},__createListId:function(){return"__list__"+mercury.dom.id()},isCreatedByTemplate:function(_){if(_){var $=_.getAttribute("createby");if(_.id&&$&&_.id!=$)return($==this.templateId);else return false}},createRow:function(){if(this.template){var $=new mercury.ui.Row(this,this.__createListId());this.rows.push($);return $}return null},clearBox:function($){if(this.template){var $=$M($),B=this.template.control().tagName,A=$||this.template.parent(),_=A.control().getElementsByTagName(B);if(_)for(var C=_.length-1;C>=0;C--)if(this.isCreatedByTemplate(_[C]))mercury.removeEl(_[C])}},removeInsertPoint:function(){if(this.insertPoint&&this.insertPoint.parent()){mercury.removeEl(this.insertPoint);this.insertPoint=null}},destory:function(){this.template.setId(this.templateId);this.template.hide();this.removeInsertPoint();rows=null}};mercury.ui.Row=Class.create();mercury.ui.Row.prototype={initialize:function(_,$){this.simpleTemplate=_;this.id=$;if(this.simpleTemplate){this.simpleTemplate.template.setId($);this._insertStr=this.simpleTemplate.template.control().outerHTML}},setValue:function(A,_){if(this._insertStr){this._insertStr=unescape(this._insertStr);var $=RegExp(A,"g");this._insertStr=this._insertStr.replace($,_)}},render:function(_){this.setValue("{id}",this.id);var A=new Insertion.Before(this.simpleTemplate.template.control(),this._insertStr),$=$M(this.id);_=$M(_);if(_){_.append($);_.show()}if($)$.show();return $}};mercury.lib.Page=Class.create();mercury.lib.Page.prototype={initialize:function(){},getPageWidth:function(){return document.body.clientWidth},getPageHeight:function(){return window.screen.availHeight},getX:function(){},getY:function(){return document.body.clientHeight},getScrollHeight:function(){return document.documentElement.scrollTop}};mercury.lib.page=new mercury.lib.Page();mercury.lib.Request={QueryString:function($){var A=window.location.search,_=new RegExp(""+$+"=([^&?]*)","ig");return((A.match(_))?(A.match(_)[0].substr($.length+1)):null)}};Object.extend(String.prototype,{formatFilePath2:function(){return this.replace(/\\/g,"\\\\")}});Object.extend(String.prototype,{formatFilePath:function(){return this.replace(/\//g,"\\")}});mercury.lib.FileMgr=Class.create();mercury.lib.FileMgr.prototype={initialize:function($){this.fileInputObj=$M($);if(this.fileInputObj)this.hide()},hide:function(){if(this.fileInputObj)this.fileInputObj.hide()},getFile:function($){if(this.fileInputObj){this.fileInputObj.control().onchange=function(){if($){var A="";try{A=(this.fileInputObj.control().value)}catch(_){alert(_.description)}$(A)}this.reCreate()}.bind(this);this.fileInputObj.control().click()}},reCreate:function(){if(this.fileInputObj){var A=this.fileInputObj.control().parentNode||document.body;Element.remove(this.fileInputObj.control());var $=this.fileInputObj.control().id,_=document.createElement("input");_.type="file";_.style.cssText="";this.fileInputObj=$M(_);this.fileInputObj.control().id=$;this.fileInputObj.hide();A.appendChild(_)}}};mercury.ui.Shadow=Class.create();mercury.ui.Shadow.prototype={initialize:function($){this.config={color:"#ccc",shadowWidth:2};Object.extend(this.config,$)},show:function(_){_=$M(_);if(_){var $=_.control().style.zIndex;$=parseInt($);this.__shadowEl=mercury.createEl("DIV",{parentNode:document.body});this.__shadowEl.control().style.zIndex=$-1;this.__shadowEl.setSize(_.size());var A=_.origin(),B={x:A.x+this.config.shadowWidth,y:A.y+this.config.shadowWidth};this.__shadowEl.setPosition(B)}},destory:function(){mercury.removeEl(this.__shadowEl)}};mercury.ui.IBasicDialog=Class.create();mercury.ui.IBasicDialog.prototype={initialize:function(){},onInit:function(){},onClose:function(){},onShow:function(){}};mercury.ui.BasicDialog=Class.create();mercury.ui.BasicDialog.prototype=mercury.extend(mercury.ui.IBasicDialog.prototype,{initialize:function($){this.config={isMode:true,dialogEl:null,titleEl:null,titleTextEl:"",titleText:"",autoPos:true,maskEl:document.body,closeEl:"",canDrag:true,isShowShadow:true,isFixed:true,width:-1,height:-1,msgEl:null,parentHandler:document.body};Object.extend(this.config,$);this.onInit()},setTitle:function(_){var $=$M(this.config.titleTextEl);if($)$.setContent(_)},show:function(E,C){Object.extend(this.config,C);var B=$M(this.config.msgEl),A=$M(this.config.dialogEl),_=$M(this.config.titleEl);if(A.isVisible()){if(B)B.setContent(E);return}if(A){if(this.config.width!=-1)A.setWidth(this.config.width);if(this.config.height!=-1)A.setHeight(this.config.height);A.show();A.alignCenter();if(this.config.isMode&&!this.__maskMgr){this.__maskMgr=new mercury.ui.MaskMgr();this.__maskMgr.addElem(document.body)}if(B)B.setContent(E)}this.__bindEvent();if(this.config.canDrag&&A&&_)this.__dragger=new mercury.ui.DragEl(_,A);var D=$(this.config.closeEl);if(this.config.isShowShadow){this.__shadow=new mercury.ui.Shadow();this.__shadow.show(A)}if(!mercury.isIE6&&this.config.isFixed)A.control().style.position="fixed";this.onShow()},close:function(){if(this.config.autoPos&&this.__autoCenter)this.__autoCenter.destory();var $=$M(this.config.dialogEl);if($)$.hide();if(this.__maskMgr)this.__maskMgr.release();if(mercury.isFunction)this.onClose();if(this.__shadow)this.__shadow.destory();this.__shadow=null;this.__maskMgr=null},__bindEvent:function(){var _=$(this.config.closeEl);if(_)_.onclick=this.close.bind(this)}});mercury.ui.MessageBox=Class.create();mercury.ui.MessageBox.prototype=mercury.extend(mercury.ui.BasicDialog.prototype,{btns:{YES:"yesBtn",NO:"noBtn",CANCEL:"closeBtn"},btnText:{YES:"\u662f",NO:"\u5426",CANCEL:"\u5173\u95ed"},onInit:function(){Object.extend(this.config,{dialogEl:"msgDialogEl",msgEl:"infoEl",buttonBarEl:"buttonBarEl",height:"auto",isFixed:false,width:364,isMode:false});Event.observe(this.btns.YES,"click",this.close.bind(this));Event.observe(this.btns.NO,"click",this.close.bind(this));Event.observe(this.btns.CANCEL,"click",this.close.bind(this))},___changeBtnText:function($){if($){var B=$M(this.btns.YES),A=$M(this.btns.NO),_=$M(this.btns.CANCEL);if(B)B.setContent($.YES);if(A)A.setContent($.NO);if(_)_.setContent($.CANCEL)}},__focusBtn:function($){var $=$M($);if($)$.control().focus()},clickHandler:function($){},alert:function($){this.___changeBtnText(mercury.extend(this.btnText,{CANCEL:"\u786e\u5b9a"}));this.showDialog($);this.__focusBtn(this.btns.CANCEL)},confirm:function($,_){this.___changeBtnText(mercury.extend(this.btnText,{YES:"\u786e\u5b9a",NO:"\u53d6\u6d88"}));this.showDialog($,0,_)},showDialog:function(G,F,_,J,K,C,A){if(F==undefined)F=1;if(C==undefined)C=false;if(K==undefined)K=true;this.show(G,{isMode:J});this.___changeBtnText(mercury.extend(this.btnText,A));var B=$M(this.btns.YES),H=$M(this.btns.NO),I=$M(this.btns.CANCEL),D=$M(this.config.buttonBarEl);if(D)D.show();switch(F){case 0:if(B){B.show();B.control().focus()}if(H)H.show();if(I)I.hide();break;case 1:if(B)B.hide();if(H)H.hide();if(I){I.show();if(K)I.enabled();else I.disabled();I.control().focus()}break;case 2:if(B)B.hide();if(H)H.hide();if(I)I.hide();if(D)D.hide();break}if(mercury.isFunction(_))this.__bindEvents(_);var E=$(this.config.msgEl);if(((new String(G)).length+1)*14>this.config.width)E.parentNode.style.textAlign="left";else E.parentNode.style.textAlign="center"},__bindEvents:function(_){var C=$(this.btns.YES),B=$(this.btns.NO),A=$(this.btns.CANCEL);if(C)C.onclick=_.bind(this,"yes");if(B)B.onclick=_.bind(this,"no");if(A)A.onclick=_.bind(this,"close")}});mercury.ui.ProgressDialog=Class.create();mercury.ui.ProgressDialog.prototype=mercury.extend(mercury.ui.BasicDialog.prototype,{__updateProgress:function($,C,_){var A=$M(C),B=$M(_);if(A)A.setWidth($+"%");if(B)B.setContent($+"%")}});mercury.lib.EscMgr=Class.create();mercury.lib.EscMgr.prototype={initialize:function($){this._callback=$;this._register()},_register:function(){this.__temp=this._execute.bind(this);Event.observe(document,"keydown",this.__temp,false)},_execute:function(_){var $=(window.event||_);if($.keyCode==Event.KEY_ESC)this._callback()},release:function(){Event.stopObserving(document,"keydown",this.__temp,false)},setCallback:function($){this._callback=$}};mercury.lib.Processor=Class.create();mercury.lib.Processor.prototype={initialize:function($){this.el=$M($);this.hide();Event.observe(window,"resize",function(){if(this.el)this.el.alignCenter()}.bind(this))},config:{exec:null,msg:"\u6b63\u5728\u5904\u7406...",processWidth:150,processHeight:16,isMode:false,autoPos:true,masks:[document.body]},isValid:function(){return this.el},show:function(A){try{Object.extend(this.config,A);if(this.el){this.el.setSize(new mercury.lib.Point(this.config.processWidth,this.config.processHeight));this.el.show();this.__autoCenter=new mercury.ui.AutoPutCenter(this.el);this.el.setContent(this.config.msg);this.el.control().style.visibility="visible"}if(mercury.isFunction(this.config.exec))setTimeout(function(){this.config.exec();this.hide()}.bind(this),2);if(this.config.isMode){this.__maskMgr=new mercury.ui.MaskMgr();if(this.config.masks)for(var B=0;B<this.config.masks.length;B++)this.__maskMgr.addElem($(this.config.masks[B]))}}catch(_){}},hide:function(){if(this.el){this.el.setContent("");this.el.hide();this.el.control().style.visibility="hidden"}if(this.__maskMgr)this.__maskMgr.release();if(this.__autoCenter)this.__autoCenter.destory()}};var Cookies={};Cookies.set=function(A,F){var E=arguments,_=arguments.length,$=(_>2)?E[2]:null,D=(_>3)?E[3]:"/",C=(_>4)?E[4]:null,B=(_>5)?E[5]:false;document.cookie=A+"="+escape(F)+(($==null)?"":("; expires="+$.toGMTString()))+((D==null)?"":("; path="+D))+((C==null)?"":("; domain="+C))+((B==true)?"; secure":"")};Cookies.get=function(A){var _=A+"=",$=_.length,B=document.cookie.length,D=0,C=0;while(D<B){C=D+$;if(document.cookie.substring(D,C)==_)return Cookies.getCookieVal(C);D=document.cookie.indexOf(" ",D)+1;if(D==0)break}return null};Cookies.clear=function(_){if(Cookies.get(_)){var $=new Date();$.setTime($.getTime()-100000);document.cookie=_+"=a; expires="+$.toGMTString();alert(document.cookie)}};Cookies.getCookieVal=function(_){var $=document.cookie.indexOf(";",_);if($==-1)$=document.cookie.length;return unescape(document.cookie.substring(_,$))};mercury.lib.AsyncManager=Class.create();mercury.lib.AsyncManager.prototype={initialize:function($){this.list=$;mercury.lib.AsyncManager.__all__.push(this)},each:function($){if($){this.__iter=0;this.__exec($)}},sync:function($){if(this.list){var _=this.list.length;for(var A=0;A<_;A++)if(mercury.isFunction($))$(this.list[A],A);if(mercury.isFunction(this.__finishCallback))this.__finishCallback()}},__exec:function($){this.stop();if(this.list.length>0){var _=this.list[this.__iter];$(_,this.__iter);if(this.__iter<this.list.length-1){this.__iter++;this.__timer=setTimeout(this.__exec.bind(this,$),0.0001)}else if(mercury.isFunction(this.__finishCallback)){this.stop();this.__finishCallback()}}else if(mercury.isFunction(this.__finishCallback)){this.stop();this.__finishCallback()}},stop:function(){if(this.__timer)clearTimeout(this.__timer)},finish:function($){this.__finishCallback=$}};mercury.lib.AsyncManager.__all__=[];Event.observe(window,"unload",function(){mercury.lib.AsyncManager.stopAll()},false);mercury.lib.AsyncManager.stopAll=function(){if(mercury.lib.AsyncManager.__all__){mercury.lib.AsyncManager.__all__.each(function($){if($){$.stop();$=null}});mercury.lib.AsyncManager.__all__=[]}};mercury.lib.FileMgr2=Class.create();mercury.lib.FileMgr2.prototype={initialize:function($,_){this.__toggerEl=$M($);if(this.__toggerEl){this.__createFileInputObj();this.__fileInputObj.control().onchange=function(){if(mercury.isFunction(_))_(this.__fileInputObj.control().value)}.bind(this);if(mercury.isFirefox){this.__toggerEl.control().onmouseover=this.__reSetPos.bind(this);this.__reSetPos()}else if(mercury.isIE){this.__fileOuterBox.hide();this.__toggerEl.control().onclick=function(){this.__fileInputObj.control().click()}.bind(this)}}else return},__reSetPos:function(){this.__fileOuterBox.show();var $=this.__toggerEl.size();this.__fileOuterBox.setSize($);var _=this.__toggerEl.origin();this.__fileOuterBox.setPosition(_)},__createFileInputObj:function(){var A="____mercuryFileInput____"+mercury.dom.id(),_="__outerFileBox__"+mercury.dom.id(),B=$(_);if(!B){B=document.createElement("DIV");document.body.appendChild(B)}if(!$(A))B.innerHTML="<INPUT TYPE='file' id='"+A+"'/>";$(A).style.cssText="margin-left:-600px;font-size:50px;text-align:right";B.id=_;B.style.cssText=this.__boxCss;B.style.overflow="hidden";this.__fileInputObj=$M(A);this.__fileOuterBox=$M(B)},destory:function(){if(this.__fileOuterBox&&this.__fileOuterBox.control.parentNode)mercury.removeEl(this.__fileOuterBox)},__boxCss:"-moz-opacity: 0.0;opacity:0.0;filter: alpha(opacity=0);z-index:1000000"};mercury.lib.FileMgr2.createFileSelector=function($,_){var A=new mercury.lib.FileMgr2($,_)};mercury.ui.DomListMgr=Class.create();mercury.ui.DomListMgr.prototype={initialize:function($){this.__templateEl=$},createList:function(A){var _={eachCallback:null,finish:null,props:[],sync:false,renderedBox:null,dataList:null};Object.extend(_,A);if(_.dataList){var $=new mercury.lib.AsyncManager(_.dataList);$.finish(function(){if(mercury.isFunction(_.finish))_.finish()}.bind(this));if(_.sync)$.sync(this.__iter.bind(this,_));else $.each(this.__iter.bind(this,_))}},__iter:function(I,B,A){var G=null;if(B){var J=new mercury.ui.SimpleHTMLTemplate(this.__templateEl),D=J.createRow();for(var H in B){if(mercury.isFunction(B[H]))continue;D.setValue("{"+H+"}",B[H])}var C={};if(I.props)for(var E=0;E<I.props.length;E++){var $=I.props[E],_=$+mercury.dom.id();D.setValue("{"+$+"}",_);C[$]=_}G=D.render(I.renderedBox);J.destory();if(mercury.isFunction(I.eachCallback)){for(H in C){if(C[H]==null&&mercury.isFunction(C[H]))continue;var F=C[H];C[H]=$M(F)}I.eachCallback(G,C,B,A)}}return G},createRow:function(_){var $={data:null,renderedBox:null};Object.extend($,_);return this.__iter($,$.data,0)},__getDomObj:function(A){if(A)for(var _ in A)if(typeof(A[_])=="string")A[_]=$(A[_]);return A}};mercury.ui.Popmenu=Class.create();mercury.ui.Popmenu.prototype={initialize:function(_,A){try{_=$M(_);this.__menuEl=$M(A);if(_){_.on("contextmenu",function($){$=window.event||$;var _=mercury.lib.Point.MousePoint($);if(this.__menuEl){this.__menuEl.setPosition(_);this.__menuEl.show()}return false}.bind(this));Event.observe(document.body,"click",function(){this.hide()}.bind(this))}}catch($){alert($.description)}},hide:function(){if(this.__menuEl)this.__menuEl.hide()}};mercury.ui.Seperator=Class.create();mercury.ui.Seperator.prototype={initialize:function(_,B){var A={arrowState:0,useCookie:false,floatSide:"L"};Object.extend(A,B);if(A.useCookie){var $=this.getCookieVal();if($)A.arrowState=$}this.__currentState=A.arrowState;this.__arrowEl=$M(_);this.__currentState;if(this.__arrowEl)this.__arrowEl.on("click",this.changeState.bind(this));this.setFloat(A.floatSide)},getState:function(){return this.__currentState},changeState:function(){if(this.__currentState==0)this.__currentState=1;else this.__currentState=0;if(mercury.isFunction(this.__changeCallback))this.__changeCallback(this.__currentState);this.save2cookie()},onChange:function($){this.__changeCallback=$},load:function(){if(this.__arrowEl)this.__arrowEl.show();if(mercury.isFunction(this.__changeCallback))this.__changeCallback(this.__currentState)},save2cookie:function(){Cookies.set("mercury.ui.Seperator",this.__currentState+"")},getCookieVal:function(){return parseInt(Cookies.get("mercury.ui.Seperator"))},setFloat:function($){if(this.__arrowEl){$=$.toUpperCase();if($=="L")$="left";else if($=="R")$="right";this.__arrowEl.setFloat($)}}};mercury.ui.SimpleToolTip=Class.create();mercury.ui.SimpleToolTip.prototype={initialize:function($){this.tipEl=$M($);if(this.tipEl)Event.observe(this.tipEl.control(),"click",this.hide.bind(this));this.hide()},show:function(A,C){C=window.event||C;var A=$M(A);if(A){var _=A.size(),B=A.origin(),$={x:B.x,y:B.y+_.y},D=mercury.lib.Point.MousePoint(C);if(this.tipEl){this.tipEl.show();this.tipEl.setPosition(D)}}},hide:function(){if(this.tipEl)this.tipEl.hide()},updateContent:function($){if($ instanceof mercury.dom.MDom){this.tipEl.clear();this.tipEl.control().appendChild($.control())}else if(typeof $=="string"){if(this.tipEl)this.tipEl.setContent($)}else if(typeof $=="object"){$M($).show();this.tipEl.control().appendChild($)}}};mercury.lib.CacheMgr=Class.create();mercury.lib.CacheMgr.prototype={initialize:function(){this.__caches={}},add:function(_,$){this.__caches[_]=$},get:function($){return this.__caches[$]},remove:function($){this.__caches[$]=null;delete this.__caches[$]},empty:function(){var _=true;if(this.__caches)for(var $ in this.__caches)_=false;return _},clear:function(){this.__caches=null;delete this.__caches},each:function($){if(this.__caches)for(var _ in this.__caches)if(mercury.isFunction($))$(this.get(_))}};mercury.lib.TabPanel=Class.create();mercury.lib.TabPanel.prototype={initialize:function($){this.__tabPages=[];this.__currentActiveTabPage=null;this.config={panelEl:"",cls:"",tabHeadBoxEl:"",tabBodyBoxEl:"",tabPageHeadCls:"tabpagehead",tabBodyBoxCls:"tabpanelbody",tabHeadBoxCls:"tabpanelhead",activeTabPageCls:"activetabpagehead",tabPageHeadTempEl:"",tebPageBodyTempEl:"",showPagesOptEl:"",showPagesBoxEl:"",tipPagesTempEl:"",overTipPageCls:"",outTipPageCls:"",autoShowTabHead:true};Object.extend(this.config,$);this.config.panelEl=$M(this.config.panelEl);this.config.tabPageHeadTempEl=$M(this.config.tabPageHeadTempEl);this.config.tebPageBodyTempEl=$M(this.config.tebPageBodyTempEl);this.config.tabHeadBoxEl=$M(this.config.tabHeadBoxEl);this.config.tabBodyBoxEl=$M(this.config.tabBodyBoxEl);this.config.showPagesOptEl=$M(this.config.showPagesOptEl);this.config.showPagesBoxEl=$M(this.config.showPagesBoxEl);this.config.tipPagesTempEl=$M(this.config.tipPagesTempEl);this.config.showPagesOptEl.on("click",function($){this.showAllTabPageTip();var C=document.getElementsByTagName("iframe"),A=C.length,_=function(){this.hideAllTabPageTip();Event.stopObserving(document.body,"click",_);for(var $=0;$<A;$++)Event.stopObserving(C[$].contentWindow.document.body,"click",_)}.bind(this);Event.observe(document.body,"click",_);for(var B=0;B<A;B++)Event.observe(C[B].contentWindow.document.body,"click",_);if(mercury.isIE)window.event.cancelBubble=true;else $.stopPropagation()}.bind(this))},addTabPage:function(A){var _={title:"mercurytab",content:"hello mercury tabpanel",isActive:true,onActive:null,onClose:null,canclosed:false};Object.extend(_,A);var B=this.createTabPageHead({title:_.title}),$=this.createTabPageBody();$.setContent(_.content);tabPage={head:B,body:$,onActive:_.onActive,canclosed:_.canclosed,index:this.__tabPages.length};if(tabPage.canclosed&&B.closeEl){B.closeEl.show();B.closeEl.on("click",function($){this.removeTabPage($);if(mercury.isFunction(_.onClose))_.onClose()}.bind(this,tabPage))}else if(B.closeEl)B.closeEl.hide();B.el.on("click",function($){this.setActiveTabPage($)}.bind(this,tabPage));if(_.isActive||this.__tabPages.length==0)this.setActiveTabPage(tabPage);this.__tabPages.push(tabPage);this.__autoCheckTabHead();return tabPage},__autoCheckTabHead:function(){if(this.config.autoShowTabHead){if(this.__tabPages.length==0||this.__tabPages.length==1){if(this.config.tabHeadBoxEl)this.config.tabHeadBoxEl.hide();if(this.config.showPagesOptEl)this.config.showPagesOptEl.hide()}else{if(this.config.tabHeadBoxEl)this.config.tabHeadBoxEl.show();if(this.config.showPagesOptEl)this.config.showPagesOptEl.show()}}else{if(this.config.tabHeadBoxEl)this.config.tabHeadBoxEl.show();if(this.config.showPagesOptEl)this.config.showPagesOptEl.show()}},checkTabPageHeadScroll:function(){},hideAllTabPageTip:function(){this.config.showPagesBoxEl.hide()},showAllTabPageTip:function(A){this.config.showPagesBoxEl.control().position="absolute";this.config.showPagesBoxEl.show();var D=this.config.panelEl.origin(),$=this.config.panelEl.size(),_=this.config.showPagesBoxEl.size(),C=D.x+$.x-_.x,F={x:C,y:D.y+30};this.config.showPagesBoxEl.setPosition(F);var B=new mercury.ui.SimpleHTMLTemplate(this.config.tipPagesTempEl);B.clearBox();for(var E=0;E<this.__tabPages.length;E++)this.__createTipRow(this.__tabPages[E])},__createTipRow:function(A){var _=new mercury.ui.SimpleHTMLTemplate(this.config.tipPagesTempEl),B=_.createRow(),$=B.render();_.destory();$.setContent(A.head.title);$.on("mouseover",function($){$.removeClass(this.config.outTipPageCls);$.addClass(this.config.overTipPageCls)}.bind(this,$));$.on("mouseout",function($){$.removeClass(this.config.overTipPageCls);$.addClass(this.config.outTipPageCls)}.bind(this,$));$.on("click",function($){this.setActiveTabPage($)}.bind(this,A));return $},setActiveTabPage:function(C){if(C&&C!=this.__currentActiveTabPage){if(this.__currentActiveTabPage){var B=this.__currentActiveTabPage.head.el,A=this.__currentActiveTabPage.body;B.removeClass(this.config.activeTabPageCls);A.hide()}B=C.head.el,A=C.body;B.addClass(this.config.activeTabPageCls);A.show();this.__currentActiveTabPage=C;if(mercury.isFunction(C.onActive))C.onActive();var $=B.size().x,_=this.config.panelEl.size().x,D=parseInt(_/$);this.config.tabHeadBoxEl.control().scrollLeft=$*(C.index-D/2)}},setActiveTabPageByIdx:function($){if($>=this.__tabPages.length)$=this.__tabPages.length-1;var _=this.__tabPages[$];this.setActiveTabPage(_)},createTabPageHead:function(C){var A={title:"tab page",closeCls:"closetab"};Object.extend(A,C);var B=new mercury.ui.SimpleHTMLTemplate(this.config.tabPageHeadTempEl.control()),F=B.createRow(),_="tabtitle__"+mercury.dom.id(),E="closeTab__"+mercury.dom.id();F.setValue("{tabTitleEl}",_);F.setValue("{closeTabEl}",E);var $=F.render();B.destory();_=$M(_);_.setContent(A.title);var D={el:$,closeEl:$M(E),titleEl:_,title:A.title};return D},createTabPageBody:function(){var _=new mercury.ui.SimpleHTMLTemplate(this.config.tebPageBodyTempEl.control()),A=_.createRow(),$=A.render();_.destory();$.hide();return $},removeTabPage:function(A){if(A){var _=A.head.el,$=A.body;mercury.removeEl(_);mercury.removeEl($);this.__tabPages.remove(A);if(this.__currentActiveTabPage==A)if(this.__tabPages.length>0)this.setActiveTabPageByIdx(A.index-1)}this.__autoCheckTabHead()},updateTabTitle:function(C,A){if(C){var $=this.__getTabPageByIdx(C.index);if($){C.head.title=A;var B=C.head,_=B.titleEl;_.setContent(A);this.__tabPages[C.index]=C}}if(mercury.isFunction(this.__onTabTitleUpdated))this.__onTabTitleUpdated(C)},__onTabTitleUpdated:function($){},__getTabPageByIdx:function($){return this.__tabPages[$]},removeTabPageByIdx:function($){if($<this.__tabPages.length)this.removeTabPage(this.__tabPages[$])}};mercury.ui.DragEl=Class.create();mercury.ui.DragEl.prototype={initialize:function(_,$){this.__toggerEl=$M(_);this.__dragEl=$M($);if(!this.__dragEl)this.__dragEl=this.__toggerEl;this._targetMove=this._drag.bind(this);this._targetEnd=this._dragEnd.bind(this);if(this.__toggerEl){this._cursor=this.__toggerEl.control().style.cursor;this.__toggerEl.control().onmousedown=function($){$=window.event||$;this.__toggerEl.control().style.cursor="move";this._startMousePos=mercury.lib.Point.MousePoint($);this._targetMovePos=this.__dragEl.origin();Event.observe(document,"mousemove",this._targetMove,false);Event.observe(document,"mouseup",this._targetEnd,false);return false}.bind(this)}},_drag:function($){$=window.event||$;var C=mercury.lib.Point.MousePoint($),_=this._startMousePos.x-C.x,B=this._startMousePos.y-C.y,A={x:this._targetMovePos.x-_,y:this._targetMovePos.y-B};this.__dragEl.setPosition(A);return false},_dragEnd:function($){Event.stopObserving(document,"mousemove",this._targetMove,false);Event.stopObserving(document,"mouseup",this._targetEnd,false);this.__toggerEl.control().style.cursor=this._cursor;return false}};mercury.lib.closeWin=function(){if(mercury.isIE7){top.window.opener=top;top.window.open("","_self","");top.window.close()}else if(mercury.isIE){window.opener=null;window.close()}else if(mercury.isFirefox){top.window.opener=top;top.window.open("","_parent","");top.window.close()}};mercury.lib.formatLongStr=function(C,A,$){if(C){var B=C.length;if($>B)$=B;if(B>A&&$+A+3<B){var _=C.substring(0,A),D=C.substring(B-$,B);C=_+"..."+D}}return C};mercury.lib.getFileSizeString=function($,_){var A=$;$=parseInt($);if(_==undefined)_="B";switch(_.toUpperCase()){case"B":break;case"K":$=$*1024;break;case"M":$=$*1024*1024;break;case"G":$=$*1024*1024*1024;break}if($!=null)if($<1024)A=$+"B";else if($<1024*1024)A=($/1024).toFixed(2)+"KB";else if($<1024*1024*1024)A=($/(1024*1024)).toFixed(2)+"MB";else if($<1024*1024*1024*1024)A=($/(1024*1024*1024)).toFixed(2)+"GB";return A};mercury.lib.formatFilePath=function($){return $.replace(/\\/g,"\\\\")};mercury.lib.formatFilePath2=function($){if($)return $.replace(/\//g,"\\");return null};mercury.lib.formatFilePath3=function($){return $.replace(/\\\\/g,"\\")};mercury.lib.parseDate=function(_){if(typeof _=="string"){var $=_.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) *$/);if($&&$.length>3)return new Date(parseInt($[1]),parseInt($[2])-1,parseInt($[3]));$=_.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2}) *$/);if($&&$.length>6)return new Date(parseInt($[1]),parseInt($[2])-1,parseInt($[3]),parseInt($[4]),parseInt($[5]),parseInt($[6]));$=_.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2})\.(\d{1,9}) *$/);if($&&$.length>7)return new Date(parseInt($[1]),parseInt($[2])-1,parseInt($[3]),parseInt($[4]),parseInt($[5]),parseInt($[6]),parseInt($[7]))}return null};mercury.lib.getFormatDate=function(_,A){var I,G,J,D,$,E,L,B,C,C,K,H,F;if(!A)A="yyyy-mm-dd hh:ii:ss";I=_.getFullYear().toString();L=I.substring(2,4);G=(_.getMonth()+1).toString();G.length==1?B="0"+G:B=G;J=_.getDate().toString();J.length==1?C="0"+J:C=J;D=_.getHours().toString();D.length==1?K="0"+D:K=D;$=_.getMinutes().toString();$.length==1?H="0"+$:H=$;E=_.getSeconds().toString();E.length==1?F="0"+E:F=E;return A.replace("yyyy",I).replace("mm",B).replace("dd",C).replace("yy",L).replace("m",G).replace("d",J).replace("hh",K).replace("ii",H).replace("ss",F).replace("h",D).replace("i",$).replace("s",E)};mercury.lib.formString=function(D){if(arguments.length==0)return"";if(arguments.length==1)return String(D);var $="";for(var G=0;G<D.length-1;)if(D.charAt(G)=="{"&&D.charAt(G+1)!="{"){var _=0,A=G+1;for(var E=A;E<=D.length-2;++E){var C=D.charAt(E);if(C<"0"||C>"9")break}if(E>A)if(D.charAt(E)=="}"&&D.charAt(E+1)!="}"){for(var F=E-1;F>=A;F--)_+=(D.charCodeAt(F)-48)*Math.pow(10,E-1-F);var B=arguments[_+1];$+=B;G+=E-A+2;continue}$+=D.charAt(G);G++}else{if((D.charAt(G)=="{"&&D.charAt(G+1)=="{")||(D.charAt(G)=="}"&&D.charAt(G+1)=="}"))G++;$+=D.charAt(G);G++}$+=D.substr(G);return $};mercury.lib.diffDateStr=function(_,C){var B={YEAR:"\u5e74",DAY:"\u5929",HOUR:"\u5c0f\u65f6",MIN:"\u5206\u949f",BEFORE:"\u524d",AFTER:"\u540e",FEW:"\u521a\u624d",PASS:"\u4e4b\u524d"},E=new Date().getTime(),H=(_||E),G=(E>H)?B.BEFORE:B.AFTER,$=Math.abs(E-H)/(1000*60),A,I,J,D,F;I=Math.floor(($/(365*24*60)));J=Math.floor(($/(24*60)));D=Math.floor(($/60));if(I>0){J-=I*365;A=I+B.YEAR+J+B.DAY}else if(I==0&&J>0){D-=J*24;A=J+B.DAY+D+B.HOUR}else if(I==0&&J==0&&D>0)A=D+B.HOUR;else if(I==0&&J==0&&D==0&&$>0){if(Math.floor($)>0)A=Math.floor($)+B.MIN;else return B.FEW}else if(C)return C;else return B.PASS;A+=G;return A};mercury.lib.ClipboardMgr=Class.create();mercury.lib.ClipboardMgr.prototype={initialize:function(){},setData:function(_){var $=false;if(mercury.isIE)$=this.__copyWhenIE(_);else $=this.__copyWhenFirefox(_);return $},__copyWhenIE:function(_){var A=true;try{A=window.clipboardData.setData("Text",_)}catch($){A=false}return A},__copyWhenFirefox:function(C){var E=true;try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var $=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(!$)return;var _=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!_)return;_.addDataFlavor("text/unicode");var B=new Object(),D=new Object(),B=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString),G=C;B.data=G;_.setTransferData("text/unicode",B,G.length*2);var F=Components.interfaces.nsIClipboard;if(!$)return false;$.setData(_,null,F.kGlobalClipboard)}catch(A){E=false}return E}}