// JavaScript Document
/*
Report To Admin v1.2
Copyright © 2005-2006 Bradley Nelson a.k.a. CCWorld
All Rights Reserved

Do not repost without permission.
For use on Proboards Boards only.
This Header must remain intact at all times.
*/

var reportLink = "Report to Admin";
var reportSubject = "Reporting User: ";
var reportBody = "I am reporting the following user for actions in the following thread.";
var reportTo = "admin";

var tds = document.getElementsByTagName("td");
var i; var recentPostId; var recentName; var recentPro; var pageLink; var cRptLink;
function URLencode(sStr) {
return escape(sStr).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27');}
if(location.href.match(/action=display/i) && document.cookie.match(/user\=([\w\d]+?)\;/i)){
pageLink = location.href.split(/#/i)[0]
for(i=0; i<tds.length; i++){
if(tds.item(i).align == "right" && tds.item(i).firstChild.nodeName.match(/font/i)){
if(tds.item(i).lastChild.firstChild.nodeName.match(/img/i) && tds.item(i).lastChild.firstChild.alt.match(/IP:/i)){
tds.item(i).firstChild.replaceChild(document.createTextNode(" - "), tds.item(i).firstChild.lastChild);
cRptLink = document.createElement("a");
cRptLink.href = "/index.cgi?action=pmsend&to="+reportTo+"&subject="+URLencode(reportSubject+recentName)+"&message="+URLencode(reportBody +"\n\n[ur"+"l="+recentPro+"]"+recentName+"[/ur"+"l] for [u"+"rl="+pageLink+"#"+recentPostId+"] this thread[/u"+"rl].")
cRptLink.appendChild(document.createTextNode(reportLink));
tds.item(i).firstChild.appendChild(cRptLink);
tds.item(i).firstChild.appendChild(document.createTextNode(" "));}}
else if(tds.item(i).width == "20%" && tds.item(i).firstChild.nodeName.match(/a/i)){
if(tds.item(i).firstChild.name.match(/^\d+$/i)){
recentPostId = tds.item(i).firstChild.name;
if (tds.item(i).getElementsByTagName("a").length >= 2){
if(tds.item(i).firstChild.nextSibling.firstChild.firstChild.nodeName.match(/font/i)){
recentName = tds.item(i).firstChild.nextSibling.firstChild.firstChild.firstChild.data;
} else {
recentName = tds.item(i).firstChild.nextSibling.firstChild.firstChild.data;}
recentPro = tds.item(i).firstChild.nextSibling.firstChild.href;
} else {
recentPro = "#";
recentName = "A Guest";
}}}}}

