function isPopUp(){var a=false;if($("InteractBox")!=null){if($("InteractBox").style.display=="block"){a=true}}return a}function sr_move(f,c,d){if(!d){var d=window.event}if(isPopUp()){if(Prototype.Browser.ie6&&Prototype.Browser.IE){var b=$("pop_box_superrates").offsetLeft+95;var a=$("pop_box_superrates").offsetTop+105;$("pop_sr_"+c).style.left=b+d.x;$("pop_sr_"+c).style.top=a+d.y}else{var b=$("pop_box_superrates").parentNode.offsetLeft;var a=$("pop_box_superrates").parentNode.offsetTop;$("pop_sr_"+c).style.left=(d.clientX-b)+15;$("pop_sr_"+c).style.top=((d.clientY-a)+10+document.body.scrollTop)}if($("pop_sr_"+c).style.display=="none"){if($("pop_sr_"+c).innerHTML.indexOf("DIV")>-1){$("pop_fog_"+c).style.visibility="hidden"}$("pop_sr_"+c).show()}}else{if(Prototype.Browser.ie6&&Prototype.Browser.IE){var b=$("box_superrates").offsetLeft+15;var a=$("box_superrates").offsetTop+5;$("sr_"+c).style.left=b+d.x;$("sr_"+c).style.top=a+d.y}else{$("sr_"+c).style.left=d.clientX+15;$("sr_"+c).style.top=d.clientY+10+document.body.scrollTop}if($("sr_"+c).style.display=="none"){$("sr_"+c).show()}}}var rateOld=0;function sr_over(c,a,b){c.className="hov";sr_move(c,a,b);if(rateOld>0){if(isPopUp()){$("pop_sr_"+rateOld).hide()}else{$("sr_"+rateOld).hide()}}}function sr_out(c,a,b){c.className="";rateOld=a;if(isPopUp()){$("pop_sr_"+rateOld).hide()}else{$("sr_"+rateOld).hide()}}function sr_click(e,c){var b=$("sr_table");var f=$("rate_name");var d=$("sr_value_"+c);var a=$("sr_ratename_"+c);var d=$("sr_value_"+c);if(isPopUp()){b=$("pop_sr_table");f=$("pop_rate_name");d=$("pop_sr_value_"+c);a=$("pop_sr_ratename_"+c)}if(b.getAttribute("saving")==1){return}if(b.getAttribute("visitorkey")==0){document.location="/waynsplash.html?wci=login&url="+encodeURIComponent("waynprofile.html?"+querystring);return}if(b.getAttribute("visitorkey")==b.getAttribute("profilekey")){if(f.innerHTML.indexOf("Waiting for rate")==-1){if($("counter_value_"+c).innerHTML=="(0)"){return}whoRatedMe(b.getAttribute("didhepaid"),c)}return}if(b.getAttribute("privacy")=="F"){ShowInteractBox("superrates_privacy",b.getAttribute("profilekey"));return}if(d.innerHTML.indexOf("Days remain:")>-1){return}if(d.getAttribute("nocredits")==1){srNoCredits(d.getAttribute("cost"))}else{if(isPopUp()){$("InteractBox").close()}b.setAttribute("saving",1);rateMember(c)}}function rateMember(c,g,f){var b=null;if(isPopUp()){b=$("pop_sr_table")}else{b=$("sr_table")}var d=b.getAttribute("profilekey");var e=b.getAttribute("visitorkey");var a=location.protocol+"//"+location.hostname+"/waynprofile.html?wci=boxes&wce=enter&submittype=superrates&rate="+c+"&rk="+d+"&sk="+e;if(isPopUp()){$("pop_superrates_content").hide();$("pop_superrates_loading").show()}else{$("superrates_content").hide();$("superrates_loading").show()}xmlRequest=new Ajax.Request(a,{method:"GET",onSuccess:function(j){var i=j.responseXML;var h=i.firstChild.attributes[0].nodeValue;if(h==0||h==""){alert("Sorry, there was an error. Please try again later.")}else{alertTimeOut=3000;ShowAlert("Super Rate sent successfully");UpdateSuperRatesBox();if(h=="NO_ONE_CAN_RATE_ME"||h=="ONLY_FRIENDS_CAN_RATE_ME"){return}}},onFailure:function(h){return},onException:function(h){return}})}function UpdateSuperRatesBox(){var a=null;try{a=$("sr_table")}catch(b){return}var c="";c=location.protocol+"//"+location.hostname;c=c+"/waynprofile.html?wci=content&wce=getbox&submittype=superrates";c=c+"&member_key="+a.getAttribute("profilekey")+"&member_forename="+a.getAttribute("profilename")+"&element_key="+a.getAttribute("elementkey");new Ajax.Request(c,{method:"get",onSuccess:function(g){var d=g.responseText;var f=(d.indexOf("A["))+2;var e=(d.indexOf("]]></box>"));d=(d.substr(f,e-f));$("sr_xml").innerHTML=d;$("superrates_content").show();$("superrates_loading").hide()},onFailure:function(){}})}function whoRatedMe(c,b){if(c==undefined){var a=$("sr_table");c=a.getAttribute("didhepaid")}document.location="/waynprofile.html?wci=whohassuperrated&rate="+b}function srNoCredits(d){var a=new RegExp("/[a-z]+.html.+");var c=a.exec(document.location);var b="/wayncredits.html?wci=purchase&url="+encodeURIComponent(c);if(d){b+="&cost="+d}document.location=b;$("InteractBox").close();return}function removePest(a,c){var b=a+"&sr_key="+c;ShowInteractBox("superrates_pest",b)}function removePestAction(a,b){strUrl=location.protocol+"//"+location.hostname;strUrl+="/waynprofile.html?wci=whohassuperrated&wce=enter&action=remove"+a+"&sr_key="+b+"&pc="+$("idPestCounter").innerHTML;new Ajax.Request(strUrl,{method:"get",onSuccess:function(e){var c=e.responseText;$("InteractBox").close();try{if(sr_profile){UpdateSuperRatesBox()}}catch(d){document.location="/waynprofile.html?wci=whohassuperrated"}},onFailure:function(){}})};
