var menuNames = new Array('venues','festivals','informed','purchase','links');
var menuWidths = new Array(157,135,135,143,170);
var IE = document.all;
compatable = (IE || parseInt(navigator.appVersion) > 4);

function nothing () {
	return;	
}

function setProperty (objID, sProp) {
	if (!compatable) { return null; }
	if (IE) eval('document.all("' + objID + '").'+sProp+';');
	else eval('document.getElementById("'+objID+'").'+sProp+';');
}

function getProperty(objID,sProp) {
	if (!compatable) { return null; }
	return eval('document.getElementById("'+objID+'").'+sProp+';');
}

function hideMenus() {
	if (!compatable) { return null; }
	var i = 0;
	while (i < menuNames.length) {
		setProperty('menu_' + menuNames[i],"style.visibility='hidden'");
		i++;	
	}
}

function showMenu (mnu) {
	if (!compatable) { return null; }
	setProperty('menu_' + mnu,"style.visibility='visible'");
}

function getWindowWidth () {
	if (!compatable) { return null; }
	var w;
	if (IE) { w = document.body.clientWidth; }
	else { w = window.innerWidth; }
	return(w);	
}

function setPositions () {
	if (!compatable) { return null; }
	var y = 37;
	var startX = Math.floor((getWindowWidth() / 2) - (740 / 2));
	if (startX < 0) { startX = 6; }
	var totwidths = 0;
	var i = 0;
	while (i < menuNames.length) {
		setProperty('menu_' + menuNames[i],'style.top=' + y);
		setProperty('menu_' + menuNames[i],'style.left=' + (startX + totwidths - 11));
		setProperty('menu_' + menuNames[i],"style.display='block'");
		startX += menuWidths[i];
		i++;	
	}
}


if (!IE) {
	window.captureEvents(Event.RESIZE);
}
window.onresize = setPositions;	