var menuNames = new Array('racing','news','org','links');
var menuWidths = new Array(270,223,218,195);
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.display='none'");
    i++;
  }
}


function showMenu (mnu) {
  if (!compatable) {
    return null;
  }
 	
 	hideMenus();
  setProperty('menu_' + mnu,"style.display='block'");
}

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 = 190 - ysub;
 	var y = 100 - ysub;

  var startX = Math.floor((getWindowWidth() / 2) - (910 / 2));
  
  if(IE) {
    startX += 8; 
    y += 6;
  }
  
  if (startX < 0) {
    startX = 0; 
  }
  
  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 - 55));  
    startX += menuWidths[i];  
    i++;
  }
}

if (!IE) {
  window.captureEvents(Event.RESIZE);
}
window.onresize = setPositions;	
