/**
 * [AJAX] Threads Rating
 * Showing Rating Script
 * Version 2.6
 * @author mad@Max
 */
function TRate_Call(a){this.id=a;YAHOO.util.Connect.asyncRequest("POST","threadratinginfo.php?threadid="+this.id,{success:function(e){if(e.responseXML){var c=e.responseXML.getElementsByTagName("showrate");if(c.length&&c[0].firstChild&&c[0].firstChild.nodeValue!=""){var d=fetch_object("trsp");if(d!==null){d.parentNode.removeChild(d)}else{var b=document.createElement("div");b.id="trsp";b.style.width="640px";b.style.position="absolute";b.style.zIndex="100";b.innerHTML=c[0].firstChild.nodeValue;document.body.appendChild(b);center_element(b)}}}},failure:vBulletin_AJAX_Error_Handler,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&ajax=1")}function show_rating(c,a,b){this.id=c;this.vote=a;this.page=b;YAHOO.util.Connect.asyncRequest("POST","threadratinginfo.php?do=whorate&threadid="+this.id+"&vote="+this.vote,{success:function(k){if(k.responseXML){var g=k.responseXML.getElementsByTagName("error");if(g.length){alert(g[0].firstChild.nodeValue)}else{var f=k.responseXML.getElementsByTagName("raters");if(f.length&&f[0].firstChild&&f[0].firstChild.nodeValue!=""){var j=fetch_object("raterlist");if(j.firstChild!==null){j.removeChild(j.firstChild)}j.innerHTML=f[0].firstChild.nodeValue;var e=fetch_object("tratep");if(e){var d=fetch_tags(e,"a");for(var h=0;typeof d[h]!="undefined";h++){d[h].onclick=TRate_Events.prototype.click}}}}}},failure:vBulletin_AJAX_Error_Handler,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&page="+this.page+"&ajax=1")}function TRate_Events(){}TRate_Events.prototype.click=function(a){if(matches=this.href.match(/^(.*)threadid=([0-9]+)(.*)vote=([0-9]+)(.*)/)){this.p=(match=this.href.match(/^(.*)page=([0-9]+)/))?match[2]:0;show_rating(matches[2],matches[4],this.p);return false}else{return true}};function delete_rating(c,b,a){this.id=c;this.uid=b;this.vote=a;YAHOO.util.Connect.asyncRequest("POST","threadratinginfo.php?do=removerater&threadid="+this.id+"&u="+this.uid+"&vote="+this.vote,{success:function(f){if(f.responseXML){var e=f.responseXML.getElementsByTagName("error");if(e.length){alert(e[0].firstChild.nodeValue)}else{var d=f.responseXML.getElementsByTagName("updrate");var h=f.responseXML.getElementsByTagName("updhead");if(d.length&&d[0].firstChild&&d[0].firstChild.nodeValue!=""){var g=fetch_object("oneclick_threadrating_current");if(g){g.removeChild(g.firstChild);g.innerHTML=d[0].firstChild.nodeValue}fetch_object("trhead").innerHTML=h[0].firstChild.nodeValue}fetch_object("rater_"+this.uid).parentNode.removeChild(fetch_object("rater_"+this.uid))}}},failure:vBulletin_AJAX_Error_Handler,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&ajax=1")};