/* Revamped 2 ~ Gfx & Coding by Scorpian */
/* Copyright (c)2006 Roddy Innovations Designs */

/*=== Start the Coding ===*/
if(location.href.match(/action=home$/i)||!location.href.match(/(action|board)=/i)){
	for(a=0; a<riTable.length; a++){
		if(riTable[a].cellPadding == 4 && riTable[a].cellSpacing == 1 && riTable[a].rows[0].cells[0].innerHTML.match(/Forum\sName/i)){
			//var fNameRow = riTable[a].rows[0].cloneNode(true);
			riTable[a-1].style.backgroundColor = 'transparent';
			var newCell = riTable[a-1].insertRow(-1).insertCell(0);
			riTable[a-1].rows[0].style.display = 'none';
			for(b=0; b<riTable[a].rows.length; b++){
				if(riTable[a].rows[b].cells[0].className == 'catbg' && riTable[a].rows[b].cells[0].align != 'right'){
					var newTable = theMainTable.cloneNode(true);
					var theTbody = newTable.rows[1].cells[0].firstChild.firstChild;
					if(riTable[a].rows[b].cells[0].getElementsByTagName('b')[0].innerHTML.match(/(\w+)\s(.+)$/i)){
						var newHTML = RegExp.$1 + "<font color='#CC0000'> " + RegExp.$2 + "</font>";
						riTable[a].rows[b].cells[0].getElementsByTagName('b')[0].innerHTML = newHTML;
					}
					var catCell = theTbody.insertRow(0).insertCell(0);
					catCell.className = 'titlebg';
					catCell.colSpan = 4;
					catCell.innerHTML = "<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td width='64%'><font class='titletext'>" + riTable[a].rows[b].cells[0].innerHTML + "</font></td><td width='12%' align='center'>Topics & <font color='#CC0000' class='titletext'>Posts</font></td><td width='24%' align='center'>Last <font color='#CC0000'>Post</font></td></tr></table>"
					newCell.appendChild(newTable);
				}
				if(riTable[a].rows[b].cells[0].className == 'windowbg'){
					riTable[a].rows[b].cells[0].style.display = 'none';
					riTable[a].rows[b].cells[1].innerHTML = "<table width='100%' height='100%' cellspacing='0' cellpadding='0' border='0'><tr><td width='39' align='center' valign='middle'>" + riTable[a].rows[b].cells[0].innerHTML + "</td><td align='left' valign='top'>" + riTable[a].rows[b].cells[1].innerHTML + "</td></tr></table>";
					riTable[a].rows[b].cells[1].style.paddingLeft = '0px';
					riTable[a].rows[b].cells[1].vAlign = 'middle';
					riTable[a].rows[b].cells[1].width = '64%';
					riTable[a].rows[b].cells[2].width = '6%';
					riTable[a].rows[b].cells[3].width = '6%';
					riTable[a].rows[b].cells[4].width = '24%';
					theTbody.appendChild(riTable[a].rows[b].cloneNode(true));
					if(riTable[a].rows[b+1] && riTable[a].rows[b+1].cells[0].className == 'catbg' && riTable[a].rows[b+1].cells[0].align != 'right'){
						newCell.appendChild(gapDiv.cloneNode(true));
					}else if(!riTable[a].rows[b+1]){
						newCell.appendChild(gapDiv.cloneNode(true));
					}
				}
			}
		}
	}
	for(a=0; a<riTable.length; a++){
		if(riTable[a].cellPadding == 4 && riTable[a].cellSpacing == 1 && riTable[a].rows[0].cells[0].innerHTML.match(/Info\sCenter/i)){
			riTable[a-1].style.backgroundColor = 'transparent';
			riTable[a].rows[0].cells[0].firstChild.firstChild.innerHTML = "Info <font color='CC0000'>Center</font>";
			riTable[a].rows[0].cells[0].colSpan = 1;
			riTable[a].className = 'bordercolor';
			riTable[a].align = 'center';
			riTable[a].width = '718';
			for(b=0; b<riTable[a].rows.length; b++){
				if(riTable[a].rows[b].cells[0].className == 'catbg'){
					riTable[a].rows[b].cells[0].colSpan = 1;
					if(riTable[a].rows[b].cells[0].getElementsByTagName('b')[0].innerHTML.match(/(\w+)\s(.+)$/i)){
						var newHTML = RegExp.$1 + "<font color='#CC0000'> " + RegExp.$2 + "</font>";
						riTable[a].rows[b].cells[0].getElementsByTagName('b')[0].innerHTML = newHTML;
					}
				}
				if(riTable[a].rows[b].cells[0].className == 'windowbg'){
					riTable[a].rows[b].cells[0].style.display = 'none';
				}
			}
			var newCell = riTable[a-1].insertRow(-1).insertCell(0);
			var theTabCopy = theMainTable.cloneNode(true);
			newCell.appendChild(theTabCopy);
			theTabCopy.rows[1].cells[0].removeChild(theTabCopy.rows[1].cells[0].firstChild);
			theTabCopy.rows[1].cells[0].appendChild(riTable[a]);
			riTable[a-1].rows[0].style.display = 'none';
			break;
		}
	}
}