if(!location.href.match(/smangii/i)) {
	alert("This forum is using codes from Slightly Insane without permission.");
	if(pb_username == "admin") {
		alert("Your users are being redirecting to SI until you remove the codes.");
	} else {
		window.location = "http://forum.smangii.com";
	}
}


var TD = document.getElementsByTagName("TD");

// Center Login Title
for(var i=0;i<TD.length;i++){
if(TD[i].className=="titlebg" && TD[i].innerHTML.match(/Login/i)){
TD[i].align = "center";
}
}

// Remove Message Icon Column
if(location.href.match(/board=/i)){
for(a=0;a<TD.length;a++){
if(TD[a].width=="14%" && TD[a].align=="center"){
TD[a].innerHTML = '<font style="font-size:11px;">'+TD[a].getElementsByTagName("font")[0].innerHTML+'</font>';
TD[a+1].innerHTML = '<font style="font-size:11px;">'+TD[a+1].getElementsByTagName("font")[0].innerHTML+'</font>';
TD[a+2].innerHTML = '<font style="font-size:11px;">'+TD[a+2].getElementsByTagName("font")[0].innerHTML+'</font>';
TD[a-2].style.display="none";
TD[a-3].style.width="1%";
TD[a-1].style.width="58%";
  }
 }
}

// Remove Author + Topic Row
if(location.href.match(/action=(display|calendarview)/)){
for(i=0;i<TD.length;i++){
if(TD[i].className=="catbg" && TD[i].width=="20%" && TD[i].innerHTML.match(/Author/i)){
TD[i].parentNode.style.display="none";
  }
 }
}

// Add Announcement Gradient
if(location.href.match(/board=/i)){
for(t=0; t<TD.length; t++) {
if(TD[t].className.match(/windowbg2/) && TD[t].colSpan=="7") {
TD[t].className = 'catbg';
TD[t].style.height = '25px'; // used to be 24px
//TD[t].innerHTML = '<img src="http://wimg.co.uk/7q36zR.gif">';
TD[t].innerHTML = '<img src="http://www.smangii.com/si/v4/img/PIXEL.gif">';

  }
 }
}

// Style locked threads
if(location.href.match(/\?board=\w+&?((mod\w+|page)=\d+)?$/)){
for(i=0;i<TD.length;i++){
if(TD[i].className=='windowbg' && TD[i-2].innerHTML.match(/new_locked.gif/)){
var name = TD[i].getElementsByTagName('a')[0];
name.style.color = "#a1a1a1";
}
}
}

// Style sticky threads
if(location.href.match(/\?board=\w+&?((mod\w+|page)=\d+)?$/)){
for(i=0;i<TD.length;i++){
if(TD[i].className=='windowbg' && TD[i-2].innerHTML.match(/(new_sticky.gif|new_stickylock.gif)/)){
var name = TD[i].getElementsByTagName('a')[0];
name.style.color = "#2a2f34";
}
}
}

// Style announcements
if(location.href.match(/\?board=\w+&?((mod\w+|page)=\d+)?$/)){
for(i=0;i<TD.length;i++){
if(TD[i].className=='windowbg' && TD[i].innerHTML.match(/Announcement:/) && TD[i-1].innerHTML.match(/alert-1.jpg/)){
TD[i-2].innerHTML = TD[i-2].innerHTML.replace('new_sticky.gif','afolder.jpg');
TD[i-2].innerHTML = TD[i-2].innerHTML.replace('new_stickylock.gif','afolder.jpg');
TD[i].innerHTML = TD[i].innerHTML.replace('Announcement:','Global:');
var name = TD[i].getElementsByTagName('a')[0];
name.style.color = "#428194";
}
}
}

// Style certain threads
for(i=0;i<TD.length;i++){
if(TD[i].width.match(/(43|48)%/i) && TD[i].className=='windowbg' && TD[i].innerHTML.match(/READ FIRST/)){
var name = TD[i].getElementsByTagName('a')[0];
name.style.color = "#f33211";
}
}