var Prototype={Version:"1.5.0_rc1",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)",emptyFunction:function(){},K:function(A){return A}};var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};Object.extend=function(A,C){for(var B in C){A[B]=C[B]}return A};Function.prototype.bind=function(){var A=this,C=$A(arguments),B=C.shift();return function(){return A.apply(B,C.concat($A(arguments)))}};var Try={these:function(){var C;for(var B=0;B<arguments.length;B++){var A=arguments[B];try{C=A();break}catch(D){}}return C}};var $A=function(C){if(!C){return[]}if(C.toArray){return C.toArray()}else{var B=[];for(var A=0;A<C.length;A++){B.push(C[A])}return B}};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],include:function(A){for(var B=0;B<this.responders.length;B++){if(responders[B]==A){return true}}return false},_each:function(B){for(var A=0;A<this.responders.length;A++){B(this.responders[A])}},each:function(B){var A=0;try{this._each(function(D){B(D,A++)})}catch(C){}},register:function(A){if(!this.include(A)){this.responders.push(A)}},unregister:function(A){this.responders=this.responders.without(A)},dispatch:function(D,B,C,A){this.each(function(E){if(E[D]&&typeof E[D]=="function"){try{E[D].apply(E,[B,C,A])}catch(F){}}})}};Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",parameters:"",onFailure:function(B){}};Object.extend(this.options,A||{})},responseIsSuccess:function(){return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300)},responseIsFailure:function(){return !this.responseIsSuccess()}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(B,A){this.transport=Ajax.getTransport();this.setOptions(A);this.request(B)},request:function(B){var C=this.options.parameters||"";if(C.length>0){C+="&_="}if(this.options.method!="get"&&this.options.method!="post"){C+=(C.length>0?"&":"")+"_method="+this.options.method;this.options.method="post"}try{this.url=B;if(this.options.method=="get"&&C.length>0){this.url+=(this.url.match(/\?/)?"&":"?")+C}Ajax.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){setTimeout(function(){this.respondToReadyState(1)}.bind(this),10)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();var A=this.options.postBody?this.options.postBody:C;this.transport.send(this.options.method=="post"?A:null);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(D){this.dispatchException(D)}},setRequestHeaders:function(){var B=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version,"Accept","text/javascript, text/html, application/xml, text/xml, */*"];if(this.options.method=="post"){B.push("Content-type",this.options.contentType);if(this.transport.overrideMimeType){B.push("Connection","close")}}if(this.options.requestHeaders){B.push.apply(B,this.options.requestHeaders)}for(var A=0;A<B.length;A+=2){this.transport.setRequestHeader(B[A],B[A+1])}},onStateChange:function(){var A=this.transport.readyState;if(A!=1){this.respondToReadyState(this.transport.readyState)}},header:function(A){try{return this.transport.getResponseHeader(A)}catch(B){}},evalJSON:function(){try{return eval("("+this.header("X-JSON")+")")}catch(e){}},evalResponse:function(){try{return eval(this.transport.responseText)}catch(e){this.dispatchException(e)}},respondToReadyState:function(A){var C=Ajax.Request.Events[A];var E=this.transport,B=this.evalJSON();if(C=="Complete"){try{(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(E,B)}catch(D){this.dispatchException(D)}if((this.header("Content-type")||"").match(/^text\/javascript/i)){this.evalResponse()}}try{(this.options["on"+C]||Prototype.emptyFunction)(E,B);Ajax.Responders.dispatch("on"+C,this,E,B)}catch(D){this.dispatchException(D)}if(C=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A)}});function $(){var A=arguments[0];if(typeof A=="string"){A=document.getElementById(A)}return A}document.getElementsByClassName=function(C,A){var B=($(A)||document.body).getElementsByTagName("*");return $A(B).inject([],function(D,E){if(E.className.match(new RegExp("(^|\\s)"+C+"(\\s|$)"))){D.push(Element.extend(E))}return D})};function ajaxRequest(C,B,D){if(D!=false){D=true}if(C&&C.indexOf("http")==-1){C="http://"+window.location.hostname+":"+window.location.port+C}var A={method:"post",asynchronous:D};if(B){A=Object.extend(A,B)}var E;if(A.onFailure){E=A.onFailure}A.onFailure=function(F){if(E){E(F)}else{}};new Ajax.Request(C,A)}function ajaxUpdate(url,updateId,options){var succUpdate=function(t){if(options.onSuccess){if(typeof (options.onSuccess)=="function"){options.onSuccess(t)}else{if(typeof (options.onSuccess)=="string"){eval(options.onSuccess+"(t);")}}}else{if(options.successBefore){if(!options.successBefore(t)){flashAreaImage($(updateId));return }}$(updateId).innerHTML=t.responseText;if(options.successAfter){if(!options.successAfter(t)){flashAreaImage($(updateId));return }}}flashAreaImage($(updateId))};var failUpdate=function(t){$(updateId).innerHTML="加载数据失败！";if(options.onFailure){if(typeof (options.onFailure)=="function"){options.onFailure(t)}else{if(typeof (options.onFailure)=="string"){eval(options.onFailure+"(t);")}}}};var flashAreaImage=function(obj){if(!obj){return }try{if(wjwxAutoFormatImg){wjwxAutoFormatImg.changeAreaObj(obj)}}catch(ex){}};if(options&&typeof (options)=="string"){var param=options;options={postBody:param}}var myoptions={loading:true};if(options){myoptions=Object.extend(myoptions,options)}if(myoptions.loading){$(updateId).innerHTML="<img src='/pages/common/image/ajax-loader.gif' border='0'/>正在加载..."}myoptions.onSuccess=succUpdate;ajaxRequest(url,myoptions)}function ajaxBoxUpdate(C){if(!$(C)||!$(C).url){alert("请指定要请求的地址属性url.");return }var B={};var A=$(C).url;if($(C)){B=Object.extend(B,$(C))}ajaxUpdate(A,C,B)};
