var Ajaxs=new Array(),AjaxStacks=new Array(0,0,0,0,0,0,0,0,0,0),ajaxpostHandle=0,evalscripts=new Array(),ajaxpostresult=0;function Ajax(B,C){for(var _=0;_<AjaxStacks.length&&AjaxStacks[_]!=0;_++);AjaxStacks[_]=1;var A=new Object();A.loading="Loading...";A.recvType=B?B:"XML";A.waitId=C?$(C):null;A.resultHandle=null;A.sendString="";A.targetUrl="";A.stackId=0;A.stackId=_;A.setLoading=function($){if(typeof $!=="undefined"&&$!==null)A.loading=$};A.setRecvType=function($){A.recvType=$};A.setWaitId=function(_){A.waitId=typeof _=="object"?_:$(_)};A.createXMLHttpRequest=function(){var A=false;if(window.XMLHttpRequest){A=new XMLHttpRequest();if(A.overrideMimeType)A.overrideMimeType("text/xml")}else if(window.ActiveXObject){var $=["Microsoft.XMLHTTP","MSXML.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.7.0","Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"];for(var C=0,B=$.length;C<B;C++){try{A=new ActiveXObject($[C]);if(A)return A}catch(_){}}}return A};A.XMLHttpRequest=A.createXMLHttpRequest();A.showLoading=function(){if(A.waitId&&(A.XMLHttpRequest.readyState!=4||A.XMLHttpRequest.status!=200)){changedisplay(A.waitId,"");A.waitId.innerHTML="<span><img src=\"image/loading.gif\"> "+A.loading+"</span>"}};A.processHandle=function(){if(A.XMLHttpRequest.readyState==4&&A.XMLHttpRequest.status==200){for(k in Ajaxs)if(Ajaxs[k]==A.targetUrl)Ajaxs[k]=null;if(A.waitId)changedisplay(A.waitId,"none");if(A.recvType=="HTML")A.resultHandle(A.XMLHttpRequest.responseText,A);else if(A.recvType=="XML"){try{A.resultHandle(A.XMLHttpRequest.responseXML.lastChild.firstChild.nodeValue,A)}catch($){A.resultHandle("",A)}}AjaxStacks[A.stackId]=0}};A.get=function(B,$){if(B.indexOf("?")!=-1)B=B+"&inajax=1";else B=B+"?inajax=1";setTimeout(function(){A.showLoading()},500);if(in_array(B,Ajaxs))return false;else Ajaxs.push(B);A.targetUrl=B;A.XMLHttpRequest.onreadystatechange=A.processHandle;A.resultHandle=$;var _=100;if(window.XMLHttpRequest)setTimeout(function(){A.XMLHttpRequest.open("GET",A.targetUrl);A.XMLHttpRequest.send(null)},_);else setTimeout(function(){A.XMLHttpRequest.open("GET",B,true);A.XMLHttpRequest.send()},_)};A.post=function(B,_,$){if(B.indexOf("?")!=-1)B=B+"&inajax=1";else B=B+"?inajax=1";setTimeout(function(){A.showLoading()},500);if(in_array(B,Ajaxs))return false;else Ajaxs.push(B);A.targetUrl=B;A.sendString=_;A.XMLHttpRequest.onreadystatechange=A.processHandle;A.resultHandle=$;A.XMLHttpRequest.open("POST",B);A.XMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");A.XMLHttpRequest.send(A.sendString)};return A}function newfunction(_){var $=new Array();for(var A=1;A<arguments.length;A++)$.push(arguments[A]);return function(A){doane(A);window[_].apply(window,$);return false}}function changedisplay(_,$){if($=="auto")_.style.display=_.style.display==""?"none":"";else _.style.display=$;return false}function evalscript($){if($.indexOf("<script")==-1)return $;var B=/<script[^\>]*?>([^\x00]*?)<\/script>/ig,_=new Array();while(_=B.exec($)){var A=/<script[^\>]*?src=\"([^\>]*?)\"[^\>]*?(reload=\"1\")?(?:charset=\"([\w\-]+?)\")?><\/script>/i,C=new Array();C=A.exec(_[0]);if(C)appendscript(C[1],"",C[2],C[3]);else{A=/<script(.*?)>([^\x00]+?)<\/script>/i;C=A.exec(_[0]);var D=/charset=\"([\w\-]+?)\"/i,E=D.exec(C[1]);appendscript("",C[2],C[1].indexOf("reload=")!=-1,E[1])}}return $}function appendscript(E,A,F,D){var _=hash(E+A);if(!F&&in_array(_,evalscripts))return;if(F&&$(_))$(_).parentNode.removeChild($(_));evalscripts.push(_);var C=document.createElement("script");C.type="text/javascript";C.id=_;C.charset=D;try{if(E)C.src=E;else if(A)C.text=A;$("append_parent").appendChild(C)}catch(B){}}function stripscript($){return $.replace(/<script.*?>.*?<\/script>/ig,"")}function ajaxupdateevents(B,_){_=_?_:"A";var $=B.getElementsByTagName(_);for(k in $){var A=$[k];ajaxupdateevent(A)}}function ajaxupdateevent(_){if(typeof _=="object"&&_.getAttribute)if(_.getAttribute("ajaxtarget")){if(!_.id)_.id=Math.random();var $=_.getAttribute("ajaxevent")?_.getAttribute("ajaxevent"):"click",A=_.getAttribute("ajaxurl")?_.getAttribute("ajaxurl"):_.href;_attachEvent(_,$,newfunction("ajaxget",A,_.getAttribute("ajaxtarget"),_.getAttribute("ajaxwaitid"),_.getAttribute("ajaxloading"),_.getAttribute("ajaxdisplay")));if(_.getAttribute("ajaxfunc")){_.getAttribute("ajaxfunc").match(/(\w+)\((.+?)\)/);_attachEvent(_,$,newfunction(RegExp.$1,RegExp.$2))}}}function ajaxget(B,_,A){A=typeof A=="undefined"||A===null?_:A;var C=new Ajax();C.setLoading();C.setWaitId(A);C.display="";C.showId=$(_);if(C.showId)C.showId.orgdisplay=typeof C.showId.orgdisplay==="undefined"?C.showId.style.display:C.showId.orgdisplay;if(B.substr(strlen(B)-1)=="#"){B=B.substr(0,strlen(B)-1);C.autogoto=1}var B=B+"&inajax=1&ajaxtarget="+_;C.get(B,function($,_){evaled=false;if($.indexOf("ajaxerror")!=-1){evalscript($);evaled=true}if(!evaled)if(_.showId){changedisplay(_.showId,_.showId.orgdisplay);changedisplay(_.showId,_.display);_.showId.orgdisplay=_.showId.style.display;ajaxinnerhtml(_.showId,$);ajaxupdateevents(_.showId);if(_.autogoto)scroll(0,_.showId.offsetTop)}if(!evaled)evalscript($)})}function ajaxpost(D,A,C){showloading();if(ajaxpostHandle!=0)return false;var _="ajaxframe",B=$(_);if(B==null){if(is_ie&&!is_opera)B=document.createElement("<iframe name='"+_+"' id='"+_+"'></iframe>");else{B=document.createElement("iframe");B.name=_;B.id=_}B.style.display="none";$("append_parent").appendChild(B)}$(D).target=_;$(D).action=$(D).action+"&inajax=1";ajaxpostHandle=[D,A,C];if(B.attachEvent){B.detachEvent("onload",ajaxpost_load);B.attachEvent("onload",ajaxpost_load)}else{document.removeEventListener("load",ajaxpost_load,true);B.addEventListener("load",ajaxpost_load,false)}$(D).submit();return false}function ajaxpost_load(){var D=ajaxpostHandle[0],B=ajaxpostHandle[1],C=ajaxpostHandle[2],_="__"+D;showloading("none");if(is_ie)var A=$("ajaxframe").contentWindow.document.XMLDocument.text;else A=$("ajaxframe").contentWindow.document.documentElement.firstChild.nodeValue;evaled=false;if(A.indexOf("ajaxerror")!=-1){evalscript(A);evaled=true}if(A.indexOf("ajaxok")!=-1)ajaxpostresult=1;else ajaxpostresult=0;if(B)setTimeout(B+"('"+D+"',"+ajaxpostresult+")",10);if(!evaled&&$(_)){$(_).style.display="";ajaxinnerhtml($(_),A);evalscript(A)}if(C&&ajaxpostresult)jsmenu["timer"][D]=setTimeout("hideMenu()",C);D.target="ajaxframe";ajaxpostHandle=0}function ajaxmenu(B,_,D,H,E){var F=0,A=3;if(isUndefined(H))H=0;if(isUndefined(D))D=0;if(H>0)A=0;showloading();if(jsmenu["active"][0]&&jsmenu["active"][0].ctrlkey==_){hideMenu();doane(B);return}else if(is_ie&&is_ie<7&&document.readyState.toLowerCase()!="complete")return;if(D){divclass="popupmenu_centerbox";F=-1}else divclass="popupmenu_popup";var C=$(_+"_menu");if(!C){C=document.createElement("div");C.ctrlid=_;C.id=_+"_menu";C.style.display="none";C.className=divclass;$("append_parent").appendChild(C)}var I=new Ajax(),G=!isUndefined($(_).href)?$(_).href:$(_).attributes["href"].value;I.div=C;I.etype=B.type;I.get(G,function($){evaled=false;if($.indexOf("ajaxerror")!=-1)evaled=true;if($.indexOf("hideMenu()")==-1)$="<h1>\u6d88\u606f</h1><a href=\"javascript:hideMenu();\" class=\"float_del\" title=\"\u5173\u95ed\">\u5173\u95ed</a><div class=\"popupmenu_inner\">"+$+"<div>";if(!evaled){if(I.div)I.div.innerHTML=$;showMenu(_,I.etype=="click",F,A,H,0,_,1000,true);if(E)setTimeout(E+"('"+_+"')",10)}evalscript($)});showloading("none");doane(B)}function hash(A,B){var B=B?B:32,_=0,C=0,$="";filllen=B-A.length%B;for(C=0;C<filllen;C++)A+="0";while(_<A.length){$=stringxor($,A.substr(_,B));_+=B}return $}function stringxor(A,$){var B="",C="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",_=Math.max(A.length,$.length);for(var E=0;E<_;E++){var D=A.charCodeAt(E)^$.charCodeAt(E);B+=C.charAt(D%52)}return B}function showloading(A,_){var A=A?A:"block",_=_?_:"Loading...";$("ajaxwaitid").innerHTML=_;$("ajaxwaitid").style.display=A}function ajaxinnerhtml(A,C){if(A.tagName!="TBODY")A.innerHTML=C;else{while(A.firstChild)A.firstChild.parentNode.removeChild(A.firstChild);var F=document.createElement("DIV");F.id=A.id+"_div";F.innerHTML="<table><tbody id=\""+A.id+"_tbody\">"+C+"</tbody></table>";$("append_parent").appendChild(F);var _=F.getElementsByTagName("TR"),D=_.length;for(var E=0;E<D;E++)A.appendChild(_[0]);var B=F.getElementsByTagName("INPUT"),D=B.length;for(E=0;E<D;E++)A.appendChild(B[0]);F.parentNode.removeChild(F)}}function topPosition(){return typeof window.pageYOffset!="undefined"?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop?document.body.scrollTop:0}