function GetValue(b,d,c){var a=d;if(!c){c=0}else{a=d+c}var e=b.getElementsByTagName(a)[0];if(e&&e.firstChild){var f=e.firstChild.data;if(f.length>=1000){return f+GetValue(b,d,c+1)}else{return f}}return""}function ProcessAjaxRespond(a){if(a!=null){ajaxDoNotCache=false;postRespond();var d=GetValue(a,"error");var h=GetValue(a,"message");var j=GetValue(a,"login_req");if(d||h){var b,c;if(d){b=d;c="error"}else{b=h;c="info"}if(!AddUserInfo(c,b)){b=b.replace(/<br>/g,"\n");b=b.replace(/&lt;br&gt/g,"\n");alert(b)}}var g=GetValue(a,"location");var e=GetValue(a,"RelocateDelay");if(!e){e=10}if(g){setTimeout('document.location.href = "'+g+'";',e)}var f=GetValue(a,"RefreshPage");if(f){setTimeout("document.location.href = document.location.href;",e)}if(j){showPopup("login_entity_vote");return false}if("1"==GetValue(a,"status")){return true}}return false}function AddUserInfo(c,f){var a="p";if(!byid(a+"MessageBlock")){a=""}var d=byid(a+"MessageBlock");if(d){byid(a+"MessageType").className=c;d.style.display="block";byid(a+"MessageText").innerHTML=f.replace(/\n/g,"<br>");var g=getElementPosition(d);var e=getScrollPosition();if(e.y>100){var b=g.top-5;if(b<0){b=0}setScrollPosition(b)}return true}return false}function preRespond(){if(ajaxCalls<0){ajaxCalls=0}var b=byid("ajaxLoad");if(b){var a=getScrollPosition();b.style.left=""+(a.x+document.documentElement.clientWidth-132)+"px";if(!ajaxCalls){b.style.display="block"}}ajaxCalls++}function postRespond(){ajaxCalls--;var a=byid("ajaxLoad");if(ajaxCalls<=0&&a){a.style.display="none"}}var ajaxCalls=0;var net=new Object();net.READY_STATE_UNINITIALIZED=0;net.READY_STATE_LOADING=1;net.READY_STATE_LOADED=2;net.READY_STATE_INTERACTIVE=3;net.READY_STATE_COMPLETE=4;net.ContentLoader=function(c,h,b,f,d,a,g,e){this.url=b;this.method=h;this.hashKey=c;this.unrequestBrowser=false;this.req=null;this.onload=d;this.onerror=(a)?a:this.defaultError;this.loadXMLDoc(h,b,f,g,e)};net.ContentLoader.prototype={loadXMLDoc:function(a,b,f,m,c,g){if(!a){a="GET"}if(g==null){g=true}if(!m&&a=="POST"){m="application/x-www-form-urlencoded"}if(window.XMLHttpRequest){this.req=new XMLHttpRequest()}else{if(window.ActiveXObject){try{this.req=new ActiveXObject("Microsoft.XMLHTTP")}catch(k){}}else{this.unrequestBrowser=true;return}}if(this.req){if("GET"==this.method&&(!ajaxDoNotCache&&ajaxCache[this.url])){ajaxDoNotCache=false;this.req=ajaxCache[this.url];this.onload.call(this)}else{try{preRespond();this.req.open(a,b,g);if(m){this.req.setRequestHeader("Content-Type",m)}if(c){for(var j in c){this.req.setRequestHeader(j,c[j])}}var l=this;this.req.onreadystatechange=function(){l.onReadyState.call(l)};this.req.send(f)}catch(d){this.onerror.call(this)}}}},onReadyState:function(){var c=this.req;var b=c.readyState;if(b==net.READY_STATE_COMPLETE){var a=c.status;if(a==200||a==0){if("GET"==this.method){ajaxCache[this.url]=this.req}this.onload.call(this)}else{this.onerror.call(this)}}},defaultError:function(){alert("error fetching data!\n\nreadyState:"+this.req.readyState+"\nstatus: "+this.req.status+"\nheaders: "+this.req.getAllResponseHeaders())}};var requestsHash=[];var ajaxCache={};var ajaxDoNotCache=false;function setAjaxRequest(a,b,e,f,g,h,c,j,d){if(!b){alert("Necessary parameters are not specified");return}if(!j){j=requestsHash.length}if(d==null){d=true}requestsHash.push(new net.ContentLoader(j,a,b,e,f,g,h,c,d));return requestsHash[requestsHash.length-1].unrequestBrowser}function encodeForm(d){if(!d||!d.elements){throw"encodeForm: error, argument is not a FORM"}var a=[],c;for(var b=0;b<d.elements.length;b++){c=d.elements[b];if("checkboxradio".indexOf(c.type)>=0){if(c.checked){a[a.length]=getInputValue(c)}}else{if(c.type!="button"&&c.type!="submit"){a[a.length]=getInputValue(c)}}}return a.join("&")}function encodeStatedForm(b,c){if(!b||!b.elements){throw"encodeForm: error, argument is not a FORM"}var a=[];for(i=0;i<c.length;i++){if(b.elements[c[i]]){a[a.length]=getInputValue(b.elements[c[i]])}}return a.join("&")}function getInputValue(c){if(typeof(c.nodeName)=="undefined"){for(var b=0;b<c.length;b++){if(c[b].checked){return(c[b].name?encodeURIComponent(c[b]).name+"=":"")+encodeURIComponent(c[b].value)}}return""}if(c.type=="select-multiple"){var a=[];for(var b=0;b<c.options.length;b++){if(c.options[b].selected){a[a.length]=(c.name?encodeURIComponent(c.name)+"[]=":"")+encodeURIComponent(c.options[b].value)}}return a.join("&")}else{if(c.type=="select-one"){return(c.selectedIndex>=0)?((c.name?encodeURIComponent(c.name)+"=":"")+encodeURIComponent(c.options[c.selectedIndex].value)):""}}if(c.type=="image"){return(c.name?encodeURIComponent(c.name)+"=":"")+encodeURIComponent(c.src)}else{return(c.name?encodeURIComponent(c.name)+"=":"")+encodeURIComponent(c.value)}};
