// ==UserScript==
// @name          SoftPedia Warn Hack
// @author        Ciuly  
// @namespace     http://www.ciuly.com
// @description   places necessary warn related shortcuts where they are not present
// @include       http://forum.softpedia.com/index.php?showtopic=*
// ==/UserScript==

var table, tables, span, uid, text;

tables = document.body.all.tags("table");

for (var i = 0; i<tables.length; i++){
  table = tables.item(i);
  if (table.className == "ipbtable" & table.getAttribute("cellspacing") == "1"){
    aa = table.all.tags("a");
    if (aa.length == 0) {
      continue;
    }
    text = aa.item(1).getAttribute("href");
    var j = text.indexOf("showuser=");
    if (j>-1){
      uid = text.substr(j+9, text.length);

      span = table.all.tags("tr").item(1).all.tags("span").item(0);
      text = span.innerHTML;
      j = text.indexOf("Warn:");
      if (j == -1)
        span.insertAdjacentHTML("beforeEnd", "Warn: (<a href=\"javascript:PopUp('http://forum.softpedia.com/index.php?act=warn&amp;mid=" + uid + "&amp;CODE=view','Pager','500','450','0','1','1','1')\">??</a>%) <a href='http://forum.softpedia.com/index.php?act=warn&amp;type=minus&amp;mid=" + uid + "&amp;t=&amp;st=0' title='Decrease warn level'><img src='style_images/1/warn_minus.gif' border='0'  alt='-' /></a><img src='style_images/1/warn0.gif' border='0'  alt='-----' /><a href='http://forum.softpedia.com/index.php?act=warn&amp;type=add&amp;mid=" + uid + "&amp;t=&amp;st=0' title='Increase warn level'><img src='style_images/1/warn_add.gif' border='0'  alt='+' /></a>");
    }
  }
}

