if (document.getElementsByTagName) document.getElementsByTagName('html')[0].className = 'hasScript';
function Up(index){
	if (document.images){
		document.images['nav'+index].src = navimg2[index].src;
	}
}
function Down(index) {
	if (document.images){
		document.images['nav'+index].src = navimg1[index].src;
	}
}
//Rotates elements
var rotTime = 5; //Time in seconds between image rotations
var sp;  //Array containing references to sponsor images
var current = 0, last;
function rotate() {
	var last = (current - 1 < 0) ? sp.length-1 : (current - 1);
	sp[last].style.visibility = 'hidden';
	sp[current].style.visibility = 'visible';
	current = (++current < sp.length) ? current : 0;
	setTimeout('rotate()',rotTime * 1000); //wait for a bit then do it again.
}

//Interior Initialization
function int_init() {
 if (document.getElementById && document.getElementsByTagName){
	sp = document.getElementById('sponsors').getElementsByTagName('A');
	els = document.getElementById('intContent').getElementsByTagName('A');
 }
 else if (document.all) {
  sp = document.all['sponsors'].all.tags('A')
	els = document.all['intContent'].all.tags('A');
 }
 else return;
 //initialize image rotation
 for(var j = 0; j < sp.length; j++) 
	sp[j].style.visibility = 'hidden'; 	
 if (sp.length) rotate(); //rotate if the there is something to rotate

 Popper(els); //Add controlled Popups to certain links
}
//Center and popup a new window
var wini; //Reference to a window
function PopWin(url, name, width, height) {
	h = (height) ? height : 400;
	h = (screen.height && screen.height > h) ? h : screen.height - 35;
	w = (width) ? width : 350;
	w  = (screen.width && screen.width > w) ? w : screen.width;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =  'height='+ h +',width='+ w +',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable';
	if (wini && !wini.closed)
			wini.resizeTo(w, h);
	wini = window.open(url,name,settings);
	if(wini) {
	 wini.focus();
	 return ( !wini );
	}
	else {
		if(document.all && document.getElementById){
			location.href= url;
			return (!wini);
		}
		else {
			return (wini);
		}
	}
	
}// PopWin()

function Popper(els) {
	for (var i = 0; i < els.length; i++) {
		if (els[i].className == 'popup') { //Show only 'A' tags with class="popup" within the content pane in a controlled popup window
			if (els[i].target == 'phototall') {
				els[i].onclick = function() { return PopWin(this.href, this.target, 235,335); }
			}
			else if (els[i].target == 'photowide') {
				els[i].onclick = function() { return PopWin(this.href, this.target, 335,235); }
			}
			else {
				els[i].onclick = function() { return PopWin(this.href, this.target, 530,570); }
			}// if(els[i].target)
		}// if(els[i].className)
	}// for
}// Popper()

/****************************************************************************/
//MP Initialization Routine
function mp_init() {
//Get references to dynamic elements
 if (document.getElementById && document.getElementsByTagName){
 	var t = document.getElementById('calendar').getElementsByTagName('TD');
	var i = document.getElementById('signUp');
	sp = document.getElementById('sponsors').getElementsByTagName('A');
 }
 else if (document.all) {
  var t = document.all['calendar'].all.tags('TD');
  var i = document.all['signUp'];
  sp = document.all['sponsors'].all.tags('A')
 }
 else return;
//input rollover
i.onmouseover = function() { this.src = signup2.src; }
i.onmouseout = function() { this.src = signup1.src }
//table rollovers
 for(var i = 0; i < t.length; i++) {
  if (t[i].innerHTML != '&nbsp;') {
	 	t[i].onmouseover = function() { ( this.className.indexOf("active") != -1) ? this.className="activeover" : this.className="over" };
		t[i].onmouseout = function() { ( this.className.indexOf("active") != -1) ? this.className="active" : this.className="" };
		t[i].onclick = moveCalContent;
	}
 }
 //initialize image rotation
 for(var j = 0; j < sp.length; j++) 
	sp[j].style.visibility = 'hidden'; 	
 if (sp.length) rotate();
} //mp_init()

//Moves HTML from hidden elements to a visible element
function moveCalContent() {
	if (document.getElementById && document.getElementsByTagName){
		var s = this.getElementsByTagName('DIV');
		var d = document.getElementById('event');
	}
	else if (document.all) {
		var s = this.all.tags('div');
		var d = document.all['event'];
	}
	else{
		this.location.href='/calendar/default.asp#'+el.id;
		return;
	}
	d.innerHTML = s[0].innerHTML;
} //moveCalContent()


function addLoadEvent(func) {
  if (!( document.getElementById && document.getElementsByTagName) ) return
	var oldonload = window.onload
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload()
			func()
		}
	}
}