﻿window.onload=function()
{
    roundCorners();
    activateTabs();
    setTall();
}

function roundCorners()
{
    if(NiftyCheck())
    {
        Rounded("div.orangeBlock","all","#FFF","#F58220","smooth");
        Rounded("div.blackBlock","all","#FFF","#000","smooth");
        //Rounded("div.yellowBlock","all","#FFF","#FFFFA0","smooth");
        Rounded("div.whiteBlock","tl bl br","#FFF","#FFF","border #CCC");
    }
}

function setTall() {
	if (document.getElementById) {
		var rightHeight = document.getElementById('RightBar');
		var leftHeight = document.getElementById('MainContent');
		var spacer = document.getElementById('RightBarSpacer');
		
		if (leftHeight.offsetHeight >= rightHeight.offsetHeight) { 
		    var difference = (leftHeight.offsetHeight-rightHeight.offsetHeight);
		    spacer.style.height = (difference + 10) + 'px'; 
		}
	}
}

function activateTabs() {
	var entries = document.getElementById('navTabs');
	//window.alert(entries);
	if (entries != null)
	{
	    entries = entries.getElementsByTagName('a');
	    for (i=0; i<entries.length; i++) 
	    {
		    entries[i].onmouseover = function () {this.parentNode.style.backgroundColor = '#FFFFFF'}
		    entries[i].onmouseout = function () {if (this.parentNode.className != 'highlite') this.parentNode.style.backgroundColor = '#F4CAA6'}
		    entries[i].onclick = function () { document.getElementById('selectedTab').value = this.parentNode.getAttribute('tabid'); return true; }
	    }
	}
}