// Tangentyere Council - Layout Control Functions




// function: initHomepage()
// details:  set the height of the middle Column to be longer than the side Column
// usage:    called onLoad for document
function initHomepage() {
    var newsColHeight = document.getElementById("news").offsetHeight;
    var mainColHeight = document.getElementById("content2").offsetHeight;
    if (newsColHeight > mainColHeight) {
        newHeight = newsColHeight + 10;
        document.getElementById("content2").style.height = newHeight + "px";
    }
}



// function: initSide1()
// details:  set the height of the side1 Column to be equal to content3 Column
// usage:    called onLoad for document
function initSide1() {
	var leftColHeight2 = document.getElementById("side1").offsetHeight;
    var rightColHeight2 = document.getElementById("side2").offsetHeight;
    var contentColHeight2 = document.getElementById("content3").offsetHeight;
    if (contentColHeight2 > leftColHeight2) {
        adjHeight = contentColHeight2;
        document.getElementById("side1").style.height = adjHeight + "px";
    }
}



// function: initCols()
// details:  set the height of the content3 Column to be longer than the side2 Column
// usage:    called onLoad for document
function initCols() {
	var leftColHeight = document.getElementById("side1").offsetHeight;
    var rightColHeight = document.getElementById("side2").offsetHeight;
    var contentColHeight = document.getElementById("content3").offsetHeight;
    if (rightColHeight > contentColHeight) {
        newHeight = rightColHeight + 10;
        document.getElementById("content3").style.height = newHeight + "px";
    }
}



// function: switchTabs()
// details:  set the display of hidden divs to view onClick
// usage:    called onLoad for document
function switchTabs(whichTab)
{
    var divArray = new Array("Content1872", "Content1970", "Content1980", "Content1990", "Content2000");
    var linkArray = new Array("Link1872", "Link1970", "Link1980", "Link1990", "Link2000");
    for (i = 0; i < divArray.length; i++) {
        if (divArray[i] == whichTab) {
            document.getElementById(divArray[i]).style.display = 'block';
            document.getElementById(linkArray[i]).className = 'tabActivated';
        } else {
            document.getElementById(divArray[i]).style.display = 'none';
            document.getElementById(linkArray[i]).className = '';
        }
    }
}



/*************************************************************
 * Window Onload Manager (WOM) v1.0
 * Author: Justin Barlow - www.netlobo.com
 *
 * Description:
 * The WOM library of functions allows you to easily call
 * multiple javascript functions when your page loads.
 *
 * Usage:
 * Add functions to WOM using the womAdd() function. Pass the
 * name of your functions (with or without parameters) into
 * womAdd(). Then call womOn() like this:
 *     womAdd('hideDiv()');
 *     womAdd('changeBg("menuopts","#CCCCCC")');
 *     womOn();
 * WOM will now run when your page loads and run all of the
 * functions you have added using womAdd()
 *************************************************************/

/*************************************************************
 * The womOn() function will set the window.onload function to
 * be womGo() which will run all of your window.onload
 * functions.
 *************************************************************/
function womOn(){
	window.onload = womGo;
}

/*************************************************************
 * The womGo() function loops through the woms array and
 * runs each function in the array.
 *************************************************************/
function womGo(){
	for(var i = 0;i < woms.length;i++)
		eval(woms[i]);
}

/*************************************************************
 * The womAdd() function will add another function to the woms
 * array to be run when the page loads.
 *************************************************************/
function womAdd(func){
	woms[woms.length] = func;
}

/*************************************************************
 * The woms array holds all of the functions you wish to run
 * when the page loads.
 *************************************************************/
var woms = new Array();