function rthx(a){if(spinner)return false;spinner=new ActivityIndicator("body",{image:"images/spinner_big.gif"});pid=a;b="pid="+pid;new Ajax.Request("xmlhttp.php?action=remove_thankyou",{method:"post",postBody:b,onComplete:rthx_action});return false}function thx(a){if(spinner)return false;spinner=new ActivityIndicator("body",{image:"images/spinner_big.gif"});pid=a;pb="pid="+pid;new Ajax.Request("xmlhttp.php?action=thankyou",{method:"post",postBody:pb,onComplete:thx_action});return false}function rthx_action(a){lin=thx_common(a);if(lin!=null){lin.onclick=new Function("","return thx("+pid+");");lin.href="showthread.php?action=thank&pid="+pid}}function thx_action(a){lin=thx_common(a);if(lin!=null){lin.onclick=new Function("","return rthx("+pid+");");lin.href="showthread.php?action=remove_thank&pid="+pid}}function thx_common(a){try{xml=a.responseXML;remove=xml.getElementsByTagName("del").item(0).firstChild.data=="1";lin=document.getElementById("a"+pid);if(remove){table=document.getElementById("thx"+pid);table.style.display=xml.getElementsByTagName("display").item(0).firstChild.data!=0?"":"none";list=document.getElementById("thx_list"+pid);list.innerHTML=xml.getElementsByTagName("list").item(0).firstChild.data;img=document.getElementById("i"+pid);img.src=xml.getElementsByTagName("image").item(0).firstChild.data}else{lin.innerHTML="";lin.onclick=null;lin.href="";lin=null}}catch(b){alert("an Error had occured please contact administrator");alert(b)}finally{spinner.destroy();spinner=null;return lin}}var pid=-1;var spinner=null

