window.onload = init;

function init() {
	var t 			= document.getElementById('toplinks');
	var toplinks	= t.getElementsByTagName('a');
	var b 			= document.getElementById('bottomlinks');
	var bottomlinks = b.getElementsByTagName('a');
	for ( var i=0 ; i < toplinks.length ; i++ ) {
		toplinks[i].onmouseover		= onLink;
		toplinks[i].onmouseout		= offLink;
		bottomlinks[i].onmouseover	= onLink;
		bottomlinks[i].onmouseout	= offLink;
		// Check for functions and run them if they exist
		if(typeof ContactForm=='function') document.forms[0].onsubmit = ContactForm;
		if(typeof bandnamesinit=='function') bandnamesinit();
	}
}

function onLink() {
	var t 			= document.getElementById('toplinks');
	var toplinks	= t.getElementsByTagName('a');
	var b 			= document.getElementById('bottomlinks');
	var bottomlinks = b.getElementsByTagName('a');
	for ( var i=0 ; i < toplinks.length ; i++ ) {
		if ( toplinks[i].href == this.href) toplinks[i].className = 'headerFooterHover';
		if ( bottomlinks[i].href == this.href) bottomlinks[i].className = 'headerFooterHover';
	}
	this.className = 'headerFooterHover';
}

function offLink() {
	var t 			= document.getElementById('toplinks');
	var toplinks	= t.getElementsByTagName('a');
	var b 			= document.getElementById('bottomlinks');
	var bottomlinks = b.getElementsByTagName('a');
	for ( var i=0 ; i < toplinks.length ; i++ ) {
		toplinks[i].className = '';
		bottomlinks[i].className = '';
	}
}

function openURL(webaddress,isExternal) {
	var theurl = 'about:blank';
	if (isExternal===undefined)	isExternal = true; // assume links are external
	if (isExternal===1)			isExternal = true;
	if (isExternal===0)			isExternal = false;	
	if (isExternal)
		{
		theurl = 'http://' + webaddress;
		window.open(theurl, 'thing');
		}
	else location.href = webaddress;
}