var Ajaxs=new Array();var AjaxStacks=new Array(0,0,0,0,0,0,0,0,0,0);var attackevasive=1;function Ajax(c,b){for(var a=0;a<AjaxStacks.length&&AjaxStacks[a]!=0;a++){}AjaxStacks[a]=1;var d=new Object();d.loading="Loading...";d.recvType=c?c:"XML";d.waitId=b?$(b):null;d.resultHandle=null;d.sendString="";d.targetUrl="";d.stackId=0;d.stackId=a;d.setLoading=function(e){if(typeof e!=="undefined"&&e!==null){d.loading=e}};d.setRecvType=function(e){d.recvType=e};d.setWaitId=function(e){d.waitId=typeof e=="object"?e:$(e)};d.createXMLHttpRequest=function(){var h=false;if(window.XMLHttpRequest){h=new XMLHttpRequest();if(h.overrideMimeType){h.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){var f=["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 g=0;g<f.length;g++){try{h=new ActiveXObject(f[g]);if(h){return h}}catch(j){}}}}return h};d.XMLHttpRequest=d.createXMLHttpRequest();d.showLoading=function(){if(d.waitId&&(d.XMLHttpRequest.readyState!=4||d.XMLHttpRequest.status!=200)){changedisplay(d.waitId,"");d.waitId.innerHTML='<span><img src="'+IMGDIR+'/loading.gif"> '+d.loading+"</span>"}};d.processHandle=function(){if(d.XMLHttpRequest.readyState==4&&d.XMLHttpRequest.status==200){for(k in Ajaxs){if(Ajaxs[k]==d.targetUrl){Ajaxs[k]=null}}if(d.waitId){changedisplay(d.waitId,"none")}if(d.recvType=="HTML"){d.resultHandle(d.XMLHttpRequest.responseText,d)}else{if(d.recvType=="XML"){d.resultHandle(d.XMLHttpRequest.responseXML.lastChild.firstChild.nodeValue,d)}}AjaxStacks[d.stackId]=0}};d.get=function(g,e){setTimeout(function(){d.showLoading()},500);if(in_array(g,Ajaxs)){return false}else{Ajaxs.push(g)}d.targetUrl=g;d.XMLHttpRequest.onreadystatechange=d.processHandle;d.resultHandle=e;var f=attackevasive&1?(d.stackId+1)*1001:100;if(window.XMLHttpRequest){setTimeout(function(){d.XMLHttpRequest.open("GET",d.targetUrl);d.XMLHttpRequest.send(null)},f)}else{setTimeout(function(){d.XMLHttpRequest.open("GET",g,true);d.XMLHttpRequest.send()},f)}};d.post=function(g,f,e){setTimeout(function(){d.showLoading()},500);if(in_array(g,Ajaxs)){return false}else{Ajaxs.push(g)}d.targetUrl=g;d.sendString=f;d.XMLHttpRequest.onreadystatechange=d.processHandle;d.resultHandle=e;d.XMLHttpRequest.open("POST",g);d.XMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.XMLHttpRequest.send(d.sendString)};return d}function createXMLHttp(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}}throw new Error("XMLHttp object could be created.")}function _sendRequest(b,d,a,c){var e=createXMLHttp();if(!c){c=null}e.open(c?"POST":"GET",b,true);if(c){e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}if(d){e.onreadystatechange=function(){if(e.readyState==4){d(a&&e.responseXML?e.responseXML:e.responseText)}}}if(c===true){c=""}e.send(c)}function ajaxRead(file,fun){var xmlObj=createXMLHttp();xmlObj.onreadystatechange=function(){if(xmlObj.readyState==4){if(xmlObj.status==200){obj=xmlObj.responseXML;eval(fun)}else{alert("\u7487\u8bf2\u5f47\u93c2\u56e6\u6b22\u9351\u6d2a\u654a,\u95bf\u6b12\ue1e4\u9359\u8702\u8d1f ["+xmlObj.status+"]")}}};xmlObj.open("GET",file,true);xmlObj.send(null)}function getRequestBody(d){var c=new Array();for(var b=0;b<d.elements.length;b++){var a=encodeURIComponent(d.elements[b].name);a+="=";a+=encodeURIComponent(d.elements[b].value);c.push(a)}return c.join("&")}function getSpecificNodeValue(d,b,a){try{var f=d.getElementsByTagName(b);if(f[a]!=null&&f[a]!=undefined){if(f[a].childNodes.length>1){return f[a].childNodes[1].nodeValue}else{return f[a].firstChild.nodeValue}}}catch(c){}return""}function getSingleNodeValue(c,a){try{var d=c.getElementsByTagName(a);if(d[0]!=null&&d[0]!=undefined){if(d[0].childNodes.length>1){return d[0].childNodes[1].nodeValue}else{return d[0].firstChild.nodeValue}}}catch(b){}return""}function appendscript(f,d,b){var g=hash(f+d);if(!b&&in_array(g,evalscripts)){return}if(b&&$(g)){$(g).parentNode.removeChild($(g))}evalscripts.push(g);var a=document.createElement("script");a.type="text/javascript";a.id=g;try{if(f){a.src=f}else{if(d){a.text=d}}$("append_parent").appendChild(a)}catch(c){}}function hash(b,d){var d=d?d:32;var e=0;var c=0;var a="";filllen=d-b.length%d;for(c=0;c<filllen;c++){b+="0"}while(e<b.length){a=stringxor(a,b.substr(e,d));e+=d}return a}function stringxor(e,c){var f="";var g="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";var a=Math.max(e.length,c.length);for(var d=0;d<a;d++){var b=e.charCodeAt(d)^c.charCodeAt(d);f+=g.charAt(b%52)}return f}function ajaxmenu(j,d,m,f,a,g,h,l,i){showloading();if(jsmenu.active[0]&&jsmenu.active[0].ctrlkey==d){doane(j);return}else{if(is_ie&&is_ie<7&&document.readyState.toLowerCase()!="complete"){return}}if(isUndefined(m)){m=3000}if(isUndefined(f)){f=""}if(isUndefined(a)){a=1}if(isUndefined(l)){l="popupmenu_popup"}if(isUndefined(i)){i="popupmenu_option"}if(isUndefined(h)){h=1}if(isUndefined(g)){g=m>0?0:3}var c=$(d+"_menu");if(a&&c){showMenu(d,j.type=="click",0,g,m);if(f){setTimeout(f+"("+d+")",m)}doane(j)}else{if(!c){c=document.createElement("div");c.ctrlid=d;c.id=d+"_menu";c.style.display="none";c.className=l;$("append_parent").appendChild(c)}var n=new Ajax();var b=!isUndefined($(d).href)?$(d).href:$(d).attributes.href.value;n.div=c;n.etype=j.type;n.get(b+"&inajax=1&ajaxmenuid="+d+"_menu",function(e){evaled=false;if(e.indexOf("ajaxerror")!=-1){evalscript(e);evaled=true;if(!a&&g!=3&&n.div.id){setTimeout("document.body.removeChild($('"+n.div.id+"'))",m)}}if(!evaled&&(typeof ajaxerror=="undefined"||!ajaxerror)){if(n.div){n.div.innerHTML='<div class="'+i+'">'+e+"</div>"}showMenu(d,n.etype=="click",0,g,m);if(f){setTimeout(f+'("'+d+'")',m)}}if(!evaled){evalscript(e)}ajaxerror=null;showloading("none")});doane(j)}}function showloading(b,a){var b=b?b:"block";var a=a?a:"Loading...";$("ajaxwaitid").innerHTML=a;$("ajaxwaitid").style.display=b;$("ajaxwaitid").style.left=((document.documentElement.clientWidth-$("ajaxwaitid").offsetWidth)/2)+"px";$("ajaxwaitid").style.top=document.documentElement.scrollTop+"px"}var ajaxpostHandle=0;function ajaxget(url,showid,waitid,loading,display,recall){waitid=typeof waitid=="undefined"||waitid===null?showid:waitid;var x=new Ajax();x.setLoading(loading);x.setWaitId(waitid);x.display=typeof display=="undefined"||display==null?"":display;x.showId=$(showid);if(x.showId){x.showId.orgdisplay=typeof x.showId.orgdisplay==="undefined"?x.showId.style.display:x.showId.orgdisplay}if(url.substr(strlen(url)-1)=="#"){url=url.substr(0,strlen(url)-1);x.autogoto=1}var url=url+"&inajax=1&ajaxtarget="+showid;x.get(url,function(s,x){evaled=false;if(s.indexOf("ajaxerror")!=-1){evalscript(s);evaled=true}if(!evaled&&(typeof ajaxerror=="undefined"||!ajaxerror)){if(x.showId){x.showId.style.display=x.showId.orgdisplay;x.showId.style.display=x.display;x.showId.orgdisplay=x.showId.style.display;ajaxinnerhtml(x.showId,s);ajaxupdateevents(x.showId);if(x.autogoto){scroll(0,x.showId.offsetTop)}}}if(!evaled){evalscript(s)}ajaxerror=null;if(recall){eval(recall)}})}function ajaxupdateevents(b,a){a=a?a:"A";var d=b.getElementsByTagName(a);for(k in d){var c=d[k];ajaxupdateevent(c)}}function ajaxupdateevent(b){if(typeof b=="object"&&b.getAttribute){if(b.getAttribute("ajaxtarget")){if(!b.id){b.id=Math.random()}var a=b.getAttribute("ajaxevent")?b.getAttribute("ajaxevent"):"click";var c=b.getAttribute("ajaxurl")?b.getAttribute("ajaxurl"):b.href;_attachEvent(b,a,newfunction("ajaxget",c,b.getAttribute("ajaxtarget"),b.getAttribute("ajaxwaitid"),b.getAttribute("ajaxloading"),b.getAttribute("ajaxdisplay")));if(b.getAttribute("ajaxfunc")){b.getAttribute("ajaxfunc").match(/(\w+)\((.+?)\)/);_attachEvent(b,a,newfunction(RegExp.$1,RegExp.$2))}}}}function setMenuPosition(e,d){var a=$(e);var c=$(e+"_menu");if(isUndefined(d)){d=0}if(a){a.pos=fetchOffset(a);a.X=a.pos.left;a.Y=a.pos.top;if($(InFloat)!=null){var b=InFloat.split("_");if(!floatwinhandle[b[1]+"_1"]){floatwinnojspos=fetchOffset($("floatwinnojs"));floatwinhandle[b[1]+"_1"]=floatwinnojspos.left;floatwinhandle[b[1]+"_2"]=floatwinnojspos.top}a.X=a.X-$(InFloat).scrollLeft-parseInt(floatwinhandle[b[1]+"_1"]);a.Y=a.Y-$(InFloat).scrollTop-parseInt(floatwinhandle[b[1]+"_2"]);InFloat=""}a.w=a.offsetWidth;a.h=a.offsetHeight;c.w=c.offsetWidth;c.h=c.offsetHeight;if(d<3){c.style.left=(a.X+c.w>document.body.clientWidth)&&(a.X+a.w-c.w>=0)?a.X+a.w-c.w+"px":a.X+"px";c.style.top=d==1?a.Y+"px":(d==2||((a.Y+a.h+c.h>document.documentElement.scrollTop+document.documentElement.clientHeight)&&(a.Y-c.h>=0))?(a.Y-c.h)+"px":a.Y+a.h+"px")}else{if(d==3){c.style.left=(document.body.clientWidth-c.clientWidth)/2+document.body.scrollLeft+"px";c.style.top=(document.body.clientHeight-c.clientHeight)/2+document.body.scrollTop+"px"}}if(c.style.clip&&!is_opera){c.style.clip="rect(auto, auto, auto, auto)"}}}function fetchOffset(c){var b=c.offsetLeft;var a=c.offsetTop;while((c=c.offsetParent)!=null){b+=c.offsetLeft;a+=c.offsetTop}return{left:b,top:a}}function newfunction(c){var a=new Array();for(var b=1;b<arguments.length;b++){a.push(arguments[b])}return function(d){doane(d);window[c].apply(window,a);return false}};

