var timerID = null;
var timerOn = false;
var timecount = 500;
var what = null;
var newbrowser = true;
var check = false;

function init() {
	if(document.getElementById) {
		layerRef="document.getElementByID";
		styleSwitch=".style";
		visibleVar="visible";
		what="dom1";
	}
	else if(document.all) {
		layerRef="document.all";
		styleSwitch=".style";
		visibleVar="visible";
		what ="ie4"; 
	}
	else if (document.layers) {
		layerRef="document.layers";
		styleSwitch="";
		visibleVar="show";
		what ="ns4";
	}
	else {
		what="none";
		newbrowser = false;
	}
	check = true;
}

function showDiv(divName) {
	if(check) {
		if (what =="none") {
			return;
		}
		else if (what == "dom1") {
			document.getElementById(divName).style.visibility="visible";
		}
		else {
			eval(layerRef+'["'+divName+'"]'+styleSwitch+'.visibility="visible"');
		}
	}
	else {
		return;
	}
}

function hideDiv(divName) {
	if(check) {
		if (what =="none") {
			return;
		}
		else if (what == "dom1") {
			document.getElementById(divName).style.visibility="hidden";
		}
		else {
			eval(layerRef+'["'+divName+'"]'+styleSwitch+'.visibility="hidden"');
		}
	}
	else {
		return;
	}
} 

function hideAll() {
	hideDiv('subNavigation');
} 

function startTime() {
	if (timerOn == false) {
		timerID=window.setTimeout( "hideAll()" , timecount);
		timerOn = true;
	}
}

function stopTime() {
	if (timerOn) {
		window.clearTimeout(timerID);
		timerID = null;
		timerOn = false;
	}
}

function onLoad() {
	init();
	hideAll();
	
	var artists = document.getElementById('btnArtists');
	artists.onmouseover = function () {
		hideAll();
		showDiv('subNavigation');
		stopTime();
	}
	
	artists.onmouseout = startTime;
	
	var subNav = document.getElementById('subNavigation');
	subNav.onmouseover = stopTime;
	subNav.onmouseout = startTime;
}  