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

if(location.href.match(/board=/i) && !location.href.match(/action=/i)){
	function mouseOverHighlightCell(tcell){ tcell.style.backgroundColor = "444444"; }
	function mouseOutHighlightCell(tcell){ tcell.style.backgroundColor = "494949"; }
	for(a=0; a<riTable.length; a++){
		if(riTable[a].rows[0].cells[0].className == 'titlebg' && riTable[a].rows[0].cells[0].innerHTML.match(/Sub-Boards/i)){
			riTable[a-1].rows[0].style.display = 'none';
			riTable[a-1].style.backgroundColor = 'transparent';
			riTable[a].rows[0].cells[0].innerHTML = "<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td width='64%'><font class='titletext'>Sub-<font color='CC0000'>Boards</font></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>"
			riTable[a].rows[0].cells[0].colSpan = 4;
			riTable[a].rows[0].cells[1].style.display = 'none';
			riTable[a].rows[0].cells[2].style.display = 'none';
			riTable[a].rows[0].cells[3].style.display = 'none';
			var newCell = riTable[a-1].insertRow(-1).insertCell(0);
			newCell.appendChild(theMainTable.cloneNode(true));
			var tBod = newCell.firstChild.rows[1].cells[0].firstChild.firstChild;
			tBod.appendChild(riTable[a].rows[0].cloneNode(true));
			for(b=0; b<riTable[a].rows.length; b++){
				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%';
					tBod.appendChild(riTable[a].rows[b].cloneNode(true));
				}
			}
			break;
		}
	}
	for(a=0; a<riTable.length; a++){
		if(riTable[a].rows[0].cells[0].className == 'titlebg' && riTable[a].rows[1] && riTable[a].rows[1].cells[0].className == 'catbg'){
			if(riTable[a].rows[0].cells[0].colSpan == 8){ break; }
			var stickies = false; var anyTopics = false;
			riTable[a-1].style.backgroundColor = 'transparent';
			var newCellA = riTable[a-1].insertRow(-1).insertCell(0);
			var newCellB = riTable[a-1].insertRow(-1).insertCell(0);
			newCellA.appendChild(theMainTable.cloneNode(true));
			newCellA.appendChild(gapDiv.cloneNode(true));
			newCellB.appendChild(theMainTable.cloneNode(true));
			var tbodA = newCellA.firstChild.rows[1].cells[0].firstChild.firstChild;
			var tbodB = newCellB.firstChild.rows[1].cells[0].firstChild.firstChild;
			riTable[a].rows[0].cells[0].className = 'catbg';
			riTable[a].rows[1].cells[0].colSpan = 4;
			riTable[a].rows[1].cells[0].className = 'titlebg';
			riTable[a].rows[1].cells[0].style.padding = '0px';
			riTable[a].rows[1].cells[0].innerHTML = "<table width='100%' cellspacing='0' cellpadding='4' border='0'><tr><td width='61%'><font class='titletext'>Important <font color='CC0000'>Topics</font></font></font></td><td width='14%' align='center'>Replies <font color='#CC0000' class='titletext'> & Views</font></td><td width='25%' align='center'>Last <font color='#CC0000'>Post</font></td></tr></table>";
			riTable[a].rows[1].cells[1].style.display = 'none';
			riTable[a].rows[1].cells[2].style.display = 'none';
			riTable[a].rows[1].cells[3].style.display = 'none';
			riTable[a].rows[1].cells[4].style.display = 'none';
			riTable[a].rows[1].cells[5].style.display = 'none';
			riTable[a].rows[1].cells[6].style.display = 'none';
			tbodA.appendChild(riTable[a].rows[1].cloneNode(true));
			tbodB.appendChild(riTable[a].rows[1].cloneNode(true));
			tbodB.firstChild.firstChild.getElementsByTagName('td')[0].firstChild.innerHTML = "Normal <font color='CC0000'>Topics</font>";
			for(b=0; b<riTable[a].rows.length; b++){
				if(riTable[a].rows[b].cells[0] && riTable[a].rows[b].cells[0].className == 'windowbg2' && riTable[a].rows[b].cells[1] && riTable[a].rows[b].cells[1].className == 'windowbg2'){
					if(riTable[a].rows[b].cells[0].innerHTML.match(/sticky/i) && riTable[a].rows[b].cells[2] && !riTable[a].rows[b].cells[2].innerHTML.match(/Announcement:/i)){
						var word = 'Sticky: '; var isStick = true; var stickies = true;
					}else if(riTable[a].rows[b].cells[2].innerHTML.match(/Announcement:/i)){
						var word = ''; var isStick = true; var stickies = true;
					}else{
						var word = ''; var isStick = false; var anyTopics = true;
					}
					riTable[a].rows[b].cells[0].style.display = 'none';
					riTable[a].rows[b].cells[1].style.display = 'none';
					riTable[a].rows[b].cells[3].style.display = 'none';
					riTable[a].rows[b].cells[4].width = '7%';
					riTable[a].rows[b].cells[5].width = '7%';
					riTable[a].rows[b].cells[6].width = '25%';
					riTable[a].rows[b].cells[2].className = 'windowbg2';
					riTable[a].rows[b].cells[2].width = '61%';
					riTable[a].rows[b].cells[2].innerHTML = "<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td width='1%' rowspan='2' align='center' valign='middle' style='padding-right:4px;'>" + riTable[a].rows[b].cells[0].innerHTML + "</td><td width='99%' align='left' valign='top'><font size='2'>" + word + riTable[a].rows[b].cells[2].innerHTML + "</font></td></tr><tr><td align='left' valign='top'><font size='1'>[Started By: " + riTable[a].rows[b].cells[3].innerHTML + "]</font></td></tr></table>";
					if(isStick){ tbodA.appendChild(riTable[a].rows[b].cloneNode(true)); }else{ tbodB.appendChild(riTable[a].rows[b].cloneNode(true)); }
					riTable[a].rows[b].style.display = 'none';
				}
			}
			tbodA.appendChild(riTable[a].rows[0].cloneNode(true));
			tbodB.appendChild(riTable[a].rows[0].cloneNode(true));
			riTable[a-1].rows[0].style.display = 'none';
			newCellA.style.display = (stickies) ? '' : 'none';
			if(stickies){
				newCellB.style.display = (anyTopics) ? '' : 'none';
			}
			break;
		}
	}
}

if(location.href.match(/action=display/i)){
	for(a=0; a<riTable.length; a++){
		if(riTable[a].rows[0].cells[0].className == 'titlebg' && riTable[a].rows[1] && riTable[a].rows[1].cells[0].className == 'catbg'){
			riTable[a-1].style.backgroundColor = 'transparent';
			riTable[a].className = 'bordercolor';
			var newCell = riTable[a-1].insertRow(-1).insertCell(0);
			if(riTable[a].rows[1].cells[0].innerHTML.match(/Poll/i)){
				riTable[a].rows[1].cells[0].innerHTML = '<font class=\'titletext\'>Poll</font>';
				riTable[a].rows[3].cells[0].innerHTML = '<font class=\'titletext\'>Author</font>';
				riTable[a].rows[0].cells[0].className = 'catbg';
				riTable[a].rows[3].cells[0].className = 'titlebg';
				riTable[a].rows[3].cells[1].className = 'titlebg';
				newCell.appendChild(gapDiv.cloneNode(true));
				var isPoll = true;
			}else{
				riTable[a].rows[1].cells[0].innerHTML = '<font class=\'titletext\'>Author</font>';
				riTable[a].rows[0].cells[0].className = 'catbg';
				riTable[a].rows[1].cells[0].className = 'titlebg';
				riTable[a].rows[1].cells[1].className = 'titlebg';
				var isPoll = false;
			}
			for(b=2; b<riTable[a].rows.length; b++){
				if(riTable[a].rows[b].cells[0].className.match(/windowbg/i) && !riTable[a].rows[b-1].cells[0].innerHTML.match(/Poll/i)){
					var newTab = theMainTable.cloneNode(true);
					var tB = newTab.rows[1].cells[0].firstChild.firstChild;
					tB.appendChild(riTable[a].rows[(isPoll?3:1)].cloneNode(true));
					tB.appendChild(riTable[a].rows[b].cloneNode(true));
					tB.appendChild(riTable[a].rows[0].cloneNode(true));
					riTable[a].rows[b].style.display = 'none';
					newCell.appendChild(newTab);
					if(riTable[a].rows[b+1] && riTable[a].rows[b+1].cells[0].className.match(/windowbg/i)){
						newCell.appendChild(gapDiv.cloneNode(true));
					}
				}
				if(riTable[a].rows[b].cells[0].vAlign == 'middle' && riTable[a].rows[b].cells[0].colSpan == 2 && riTable[a].rows[b].cells[0].align == 'left' && riTable[a].rows[b].cells[0].innerHTML.match(/adminfunctions/i)){
					riTable[a].rows[b].cells[0].colSpan = 1;
					riTable[a].rows[b].cells[0].className = 'catbg';
					newCell.appendChild(gapDiv.cloneNode(true));
					var tab = theSecondTable.cloneNode(true);
					tab.width = '728';
					tab.firstChild.appendChild(riTable[a].rows[b].cloneNode(true));
					riTable[a].rows[b].style.display = 'none';
					newCell.appendChild(tab);
				}
				if(riTable[a].rows[b].cells[0].className == 'titlebg' && !riTable[a].rows[b].cells[0].innerHTML.match(/Author/i)){
					riTable[a].rows[b].style.display = 'none';
				}
			}
			if(!isPoll){
				riTable[a].rows[0].style.display = 'none';
				riTable[a].rows[1].style.display = 'none';
			}else{
				riTable[a].rows[0].cells[0].className = 'titlebg';
				riTable[a].rows[3].style.display = 'none';
			}
			break;
		}
	}
}

for(x=riSelect.length-1; x>=0; x--){
	if(riSelect[x].innerHTML.match(/Forum\sJump/i)){
		riSelect[x].style.display = 'none';
	}
}

document.write("</div></td></tr><tr><td>");
document.write("<a href='http://roddyinnov.proboards75.com' title='Visit Roddy Innovations for more templates like this!'>");
document.write("<img src='"+imgBase+"footer.gif' alt='Copyright (c)2006/2007 Scorpian, Roddy Innovations Designs' border='0'/>");
document.write("</a></td></tr></table>");