var imgArr = new Array();
imgArr.push(['off.gif', 'icons/off.gif']);
imgArr.push(['on.gif', 'icons/on.gif']);
imgArr.push(['info.gif', 'icons/info.gif']);
imgArr.push(['online.gif', 'icons/uon.gif']);
for(i=0; i<riImg.length; i++)
	for(im=0; im<imgArr.length; im++)
		if(riImg[i].src.match(new RegExp('proboards.com/' + imgArr[im][0], 'i')))
			riImg[i].src = imgBase + imgArr[im][1];

var theTab = document.createElement('table');
with(theTab){
	border = 0;
	cellSpacing = 1;
	cellPadding = 4;
	align = 'center';
	width = '100%';
	className = 'bordercolor';
	appendChild(document.createElement('tbody'));
}
var headTab = document.createElement('table');
with(headTab){
	border = 0;
	cellSpacing = 0;
	cellPadding = 0;
	align = 'center';
	width = '100%';
	insertRow(0).insertCell(0);
	rows[0].cells[0].style.backgroundImage = 'url(' + imgBase + 'head.gif)';
	rows[0].cells[0].style.paddingLeft = '58px';
	rows[0].cells[0].height = '25px';
}
var baseImg = document.createElement('img');
baseImg.src = imgBase + 'base.gif';
var gapDiv = document.createElement('div');
gapDiv.style.height = '20px';

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-1].className == 'bordercolor' && riTable[a-1].cellSpacing == 0 && riTable[a].rows[0].cells[0].innerHTML.match(/Forum\sName/i)){
			riTable[a-1].style.backgroundColor = 'transparent';
			var newCell = riTable[a-1].insertRow(-1).insertCell(0);
			riTable[a-1].rows[0].style.display = 'none';
			var fN = riTable[a].rows[0].cloneNode(true);
			for(b=1; b<riTable[a].rows.length; b++){
				if(riTable[a].rows[b].cells[0].className == 'catbg' && riTable[a].rows[b].cells[0].align != 'right'){
					var cT = headTab.cloneNode(true);
					cT.rows[0].cells[0].appendChild(riTable[a].rows[b].cells[0].getElementsByTagName('a')[0].cloneNode(true));
					cT.rows[0].cells[0].appendChild(riTable[a].rows[b].cells[0].getElementsByTagName('font')[0].cloneNode(true));
					newCell.appendChild(cT);
					var tT = theTab.cloneNode(true);
					newCell.appendChild(tT);
					var tB = tT.firstChild;
					tB.appendChild(fN.cloneNode(true));
					newCell.appendChild(baseImg.cloneNode(true));
				}
				if(riTable[a].rows[b].cells[0].className == 'windowbg'){
					tB.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));
				}
			}
			break;
		}
	}
	for(a=0; a<riTable.length; a++){
		if(riTable[a].cellPadding == 4 && riTable[a].rows[0].cells[0].innerHTML.match(/Info\sCenter/i)){
			riTable[a-1].style.backgroundColor = 'transparent';
			var newCell = riTable[a-1].insertRow(-1).insertCell(0);
			riTable[a].className = 'bordercolor';
			var hT = headTab.cloneNode(true);
			riTable[a].rows[0].cells[0].getElementsByTagName('font')[0].className = 'cattext';
			hT.rows[0].cells[0].appendChild(riTable[a].rows[0].cells[0].getElementsByTagName('font')[0].cloneNode(true));
			riTable[a].rows[0].style.display = 'none';
			riTable[a].parentNode.insertBefore(hT, riTable[a]);
			riTable[a].parentNode.insertBefore(baseImg.cloneNode(true), riTable[a+1].nextSibling);
			break;
		}
	}
}