var Browser={init:function(){var A=navigator.userAgent;this.isOpera=!!window.opera;this.isIE=window.ActiveXObject&&!this.Opera;this.isWebKit=/WebKit/.test(A);this.isMac=A.indexOf("Mac")>=0;this.isIE6=this.isIE&&/MSIE [56]/.test(A);this.isGecko=!this.isWebKit&&/Gecko/.test(A)}};Browser.init();function Ajax(B,C){this.onSuccess=B;if(C){this.onFail=C}if(window.XMLHttpRequest){this.xhr=new XMLHttpRequest()}else{try{this.xhr=new ActiveXObject("Msxml2.XMLHTTP")}catch(A){this.xhr=new ActiveXObject("Microsoft.XMLHTTP")}}this.async=true;this.dataType="text"}Ajax.prototype={setXML:function(){this.dataType="xml"},send:function(B,E,H,D){var A="get";var F="application/x-www-form-urlencoded";if(H&&H=="post"){A="post"}if(A=="post"){if(D){F+=""+D}else{F+=";charset=GBK"}}else{if(B.indexOf("?")<0){B=B+"?"}if(E){B=B+"&"+E;E=null}B=B+"&reqTime="+new Date().getTime()}var C=this;this.xhr.open(A.toUpperCase(),B,this.async);this.xhr.onreadystatechange=function(){C.onStateChg.call(C)};if(A=="post"){this.xhr.setRequestHeader("Content-Type",F)}this.xhr.send(E)},post:function(A,C,B){this.send(A,C,"post",B)},get:function(A,B){this.send(A,B)},onStateChg:function(){if(this.xhr.readyState!=4){return }if(this.xhr.status>=200&&this.xhr.status<300){var A;if(this.dataType=="xml"){A=this.xhr.responseXML}else{A=this.xhr.responseText}this.onSuccess.call(this,A)}else{if(this.xhr.status==405){window.onbeforeunload=null;window.location="?module=admin&controller=error&action=ajaxRedirect"}else{if(this.onFail){this.onFail()}}}}};Array.prototype.each=function(C){for(var B=0,A=this.length;B<A;B++){C.call(this,this[B],B)}return this};Array.prototype.contains=function(B){var A=this.length;while(A--){if(this[A]===B){return true}}return false};Array.prototype.remove=function(B){var A=this.length;while(A--){if(this[A]===B){this.splice(A,1)}}return this};Array.prototype.removeAt=function(A){if(A<this.length&&A>=0){this.splice(A,1)}return this};function _extend(B,A){if(B&&A){for(var C in A){B[C]=A[C]}}return B}function Class(F,E){var A=F.constructor==Object?undefined:F.constructor;if(E){var H=function(){E.call(this)}}var D=A||H||new Function();if(E){function C(){}C.prototype=E.prototype;D.prototype=new C()}for(var B in F){D.prototype[B]=F[B]}D.constructor=D;return D}String.prototype.trim=function(){return this.replace(/(^\s+|\s+$)/g,"")};String.prototype.escapeHTML=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")};String.prototype.unescapeHTML=function(){return this.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")};String.prototype.format=function(){var A=arguments.length;var B=this;while(A--){B=B.replace(new RegExp("\\{"+A+"\\}","g"),arguments[A])}return B};String.prototype.startWith=function(A){return this.indexOf(A)==0};String.prototype.contains=function(A){return this.indexOf(A)>=0};var Element=new Class({constructor:function(A){if(!A){return }if(A.constructor==String){A=document.createElement(A)}return G(A)}});Element.prototype={wrapVersion:1,css:function(B){var D=arguments.length;if(D>1&&D%2==0){for(var H=0;H<D;H+=2){var C=arguments[H],A=arguments[H+1];if(typeof C=="string"&&typeof A=="string"){this.style[C]=A}}}else{if(D==1){if(typeof B=="string"){var F=this.currentStyle||document.defaultView.getComputedStyle(this,null);return F[B]}else{for(var E in B){this.style[E]=B[E]}}}}return this},show:function(A){this.style.display=A||"";return this},hide:function(){this.style.display="none";return this},addClass:function(A){var B=this.className.split(/\s+/);B.push(A);this.className=B.join(" ");return this},removeClass:function(B){var C=this.className.split(/\s+/);var A=C.length;while(A--){if(C[A]==B){C.splice(A,1)}}this.className=C.join(" ");return this},append:function(A){this.appendChild(A);return this},setHTML:function(A){this.innerHTML=A;return this},remove:function(){if(this.parentNode){this.parentNode.removeChild(this)}return this},clearEmptyNode:function(){var A=this.childNodes;var B=A.length;while(B--){var C=A[B];if(C.nodeType!=1&&(C.nodeType!=3||C.nodeValue.trim().length==0)){this.removeChild(C)}}return this},getPosition:function(){var C=0,B=0;var A=this;do{C+=A.offsetLeft||0;B+=A.offsetTop||0;A=A.offsetParent}while(A);return{left:C,top:B}},setOpacity:function(A){this.style.visibility=A<0.001?"hidden":"visible";if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(window.ActiveXObject){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=A;return this}};function G(A){if(A.constructor==String){A=document.getElementById(A)}if(!A){return null}var B=Element.prototype;if(A.wrapVersion==B.wrapVersion){return A}for(var C in B){A[C]=B[C]}return A}var Event=new Class({constructor:function(A){A=A||window.event;this.target=A.target||A.srcElement;_extend(this,A);this.keyCode=A.which?A.which:A.keyCode;this.rightClick=(A.which==3)||(A.button==2)}});Event.add=function(B,A,C){if(window.addEventListener){B.addEventListener(A,C,false)}else{B.attachEvent("on"+A,C)}};Event.remove=function(B,A,C){if(window.removeEventListener){B.removeEventListener(A,C,false)}else{B.detachEvent("on"+A,C)}};function insertAfter(C,A){var B=A.parentNode;if(B.lastChild==A){B.appendChild(C)}else{B.insertBefore(C,A.nextSibling)}}(function(){var A={};window.getUniqueId=function(C){var D=C||8;var E="";while(D--){E+=B()}if(!A[E]){A[E]=1;return E}else{return getUniqueId(D)}};var B=function(){var D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";var C=D.length;return D.charAt(Math.floor(Math.random()*C))}})();var ie=/msie/.test(window.navigator.userAgent.toLowerCase());var ie6=/msie 6/.test(window.navigator.userAgent.toLowerCase());var ie7=/msie 7/.test(window.navigator.userAgent.toLowerCase());var moz=/gecko/.test(window.navigator.userAgent.toLowerCase());var opera=/opera/.test(window.navigator.userAgent.toLowerCase());var safari=/safari/.test(window.navigator.userAgent.toLowerCase());var ismac=/mac/.test(window.navigator.userAgent.toLowerCase());var Mask={show:function(){var A;var B=document.body.clientWidth;var D=Math.max(document.documentElement.clientHeight,Math.max(document.body.scrollHeight,document.documentElement.scrollHeight));if(!Mask.uniqueId){Mask.uniqueId=getUniqueId()+"Mark";A=new Element("div");A.id=Mask.uniqueId;A.className="mask-layer";document.body.appendChild(A)}else{A=G(Mask.uniqueId)}A.css({left:0,top:0,position:"absolute",width:B+"px",height:D+"px",overflow:"auto"});if(ie){var C=document.body.className.split(/\s+/);C.push("body-masked");document.body.className=C.join(" ")}},hide:function(){var B=G(Mask.uniqueId);if(!B){return }B.css({left:"-30px",top:"-30px",position:"absolute",width:"1px",height:"1px",overflow:"hidden"});if(ie){var C=document.body.className.split(/\s+/);var A=C.length;while(A--){if(C[A]=="body-masked"){C.splice(A,1)}}document.body.className=C.join(" ")}}};function stopDefault(A){if(A&&A.preventDefault){A.preventDefault()}else{window.event.returnValue=false}return false}function stopBubble(A){var A=A||window.event;if(A.stopPropagation){A.stopPropagation()}else{window.event.cancelBubble=true}}function prev(A){do{A=A.previousSibling}while(A&&A.nodeType!=1);return A}function next(A){do{A=A.nextSibling}while(A&&A.nodeType!=1);return A}var JSON={};JSON.decode=function(str){try{return window.eval("("+str+")")}catch(e){return null}};window.cancelUnload=function(){hadOperate=true};