//////////////////////////////////
//   Auto-List Subforums Code   //
//By Choco of the IFSZ & Ifusion//
//      Do Not Redistribute     //
//////////////////////////////////
//           Edit This          //
start = "Subforums: ";          //Starting text. What should it say before the list?
text = " [{f}] ";               //How should the subforum links be formatted?

//        Don't Edit This       //
var x=document.getElementsByTagName("a");
for(var i in x) {
  if(x[i].href&&x[i].href.match(/showforum/i)&&x[i].parentNode.parentNode&&x[i].parentNode.parentNode.className=="row4") {
    x[i].id=(x[i].href).substring(((x[i].href).indexOf("showforum=")+10),(x[i].href).length);
    $.get(x[i].href,function(_d) {
      cF=_d.split(/\<div id=.navstrip. align=.left.\>/i)[1].split(/\<\/div\>/i)[0];
      /showforum=(\d+)/i.test(cF);
      fin=RegExp.$1;
      _t=document.getElementById(fin);
      if(_d.match(/Forum\<\/th\>/i)) {
        _c_t=_d.split(/Forum\<\/th\>/i)[1].split(/\<td class=.darkrow2./i)[0];
        _n_e=document.createElement("div");
        _n_e.id="_n"+fin;
        _n_e.innerHTML=_c_t;
        document.body.appendChild(_n_e);
        _c_l=_n_e.getElementsByTagName("a");
        _f_l_c=[];
        for(var _li in _c_l) {
          if(_c_l[_li].href&&_c_l[_li].href.match(/showforum=(\d+)/i)) {
            _f_l_c[_f_l_c.length]=[_c_l[_li].href,_c_l[_li].innerHTML];
          }            
        }
        if(_f_l_c.length>0) {
          _p_n_u=document.getElementById(fin).parentNode.parentNode;
          _p_n_u.innerHTML+="<br />"+start;
          for(var _in in _f_l_c) {
            if(_f_l_c[_in][0]!=undefined) 
              _p_n_u.innerHTML+=text.replace(/\{f\}/i,"<a href='"+_f_l_c[_in][0]+"'>"+_f_l_c[_in][1]+"</a>");
          }
        }
      }
    });
  }
}