window.onload = function() {
	initNav();
}

function altFloats() {
		var odd = false;
		var items = document.getElementById('news_items').getElementsByTagName("li");
		for(j=0; j<items.length; j++) {
			if(odd == true) {
				items[j].className = "even";
				odd = false;//set odd to false
			} else {
				items[j].className = "odd";
				odd = true;
			}
		}
}

function stripeTable() {
	if(!document.getElementsByTagName("table")) return false;//basic old browser check
		var tables = document.getElementsByTagName("table");//grab the tables in the document
		for(i=0; i<tables.length; i++) {//loop through the tables
			var odd = false;//creat an odd function for the table, set it to false
			var rows = tables[i].getElementsByTagName("tr");//grab the rows in the specific table
			for(j=0; j<rows.length; j++) {//loop through the rows in the specific table
				if(odd == true) {
					rows[j].style.backgroundColor = "#fff";//if odd is true, set the bg color to this
					odd = false;//set odd to false
				} else {
					odd = true;//set odd to true, this is picked up by next iteration and styles the next row
				}
			}
		}
}

function initNav() {
	var nav = myGetElementById('nav');
	var img = nav.getElementsByTagName('img');
	for (var i = 0; i < img.length; i++) {
		if ( img[i].className == "on" ) {
			img[i].onmouseover = null;
			img[i].onmouseout = null;
		} else {
			img[i].onmouseover = function () {
				this.src = "../images/" + this.id + "2.gif";
			}
			img[i].onmouseout = function() {
				this.src = "../images/" + this.id + ".gif";
			}
		}
	}
}

function countPastShows() {
	var table = myGetElementById('past_shows');
	var rows = table.getElementsByTagName('tr');
	var count = myGetElementById('pastShowCount');
	count.innerHTML = rows.length;
}
	
var isIE = (document.getElementById && document.all)?true:false;
var isNS4 = (document.layers)?true:false;
var isNS6 = (document.getElementById && !document.all)?true:false;

function myGetElementById (id)
{
    if ( isIE )
    {
	var str = "document.all('" + id + "')";
	var o = eval(str);
	return o;
    }

    return document.getElementById(id);
}