// This is the URL of the New Posts image.
newPostsImage="http://forums.firechao.com/images/on.gif";

// Wait until the page has loaded before doing anything.
$(document).ready(function(){

	// Go through all the <a>s in #menutabs:
	for (i=0;i<document.getElementById("menutabs").getElementsByTagName("a").length;i++) {

		newPosts=0;

		// Make things a little easier...
		currentTab=document.getElementById("menutabs").getElementsByTagName("a")[i];

		// Check the rel link...
		for (j=0;j<document.getElementById(currentTab.rel).getElementsByTagName("img").length;j++) {
			if (document.getElementById(currentTab.rel).getElementsByTagName("img")[j].src==newPostsImage) {
				newPosts=1;
			}
		}

		// Check the rev link if it exists...
		if (currentTab.rev=="") {} else {
			for (j=0;j<document.getElementById(currentTab.rev).getElementsByTagName("img").length;j++) {
				if (document.getElementById(currentTab.rev).getElementsByTagName("img")[j].src==newPostsImage) {
					newPosts=1;
				}
			}
		}

		// Set the class if necessary...
		if (newPosts==1) {
			currentTab.parentNode.className="newposts";
		}

	}

});
