/*  Tab Script */

	// constants
	var ACTIVE_TAB_CLASS = "current";
	var INACTIVE_TAB_CLASS = "select";
	var ACTIVE_SUB_NAV_CLASS = "sub_active";
	var INACTIVE_SUB_NAV_CLASS = "sub";

	// sets the passed tab as the active tab
	function setActiveTab(fromEl)
	{
		// get the container ul element by stepping up 2 parent levels
		var tabClicked = (document.all ? fromEl.parentElement.parentElement : fromEl.parentNode.parentNode);
		setClassNames(tabClicked);
	}
	
	// sets all the relevant css class names
	function setClassNames(tabClicked)
	{
		// get the container of the nav and all the ul elements within it
		var navContainer = document.getElementById("nav");
		var mainNavArray = navContainer.getElementsByTagName("ul");
		
		// loop through all the uls
		for (i = 0; i < mainNavArray.length; i++)
		{
			// make sure it is of the 'main' type by checking its classname
			if (mainNavArray[i].className == ACTIVE_TAB_CLASS || mainNavArray[i].className == INACTIVE_TAB_CLASS)
			{
				// if we happen upon the tab that was clicked then set its properties to the active state
				// otherwise set the element to the inactive state
				if (mainNavArray[i] == tabClicked)
				{
					mainNavArray[i].className = ACTIVE_TAB_CLASS;
					mainNavArray[i].getElementsByTagName("ul")[0].className = ACTIVE_SUB_NAV_CLASS;
					
				}
				else
				{
					mainNavArray[i].className = INACTIVE_TAB_CLASS;
					mainNavArray[i].getElementsByTagName("ul")[0].className = INACTIVE_SUB_NAV_CLASS;
				}
			}
		}
	}

/* end Tab Script */

/* Make rounded corners on all divs marked 'rounded' */

var makeRound = function(){var els = document.getElementsByTagName('div'); for(var i=0; el=els[i]; i++) if(el.className.indexOf('round')>-1 && el.firstChild && el.firstChild.className!='t') el.innerHTML = '<b class="t"><b class="r"></b></b><div class="c"><b class="br"></b>'+el.innerHTML+'<b class="br"></b></div><b class="b"><b class="r"><!----></b></b>';}


/*    rotator     */


