function ShowLayer(el){return;}
function Outm(){return;}

// DCLK variables, required for every page
var axel = Math.random() + "";
var ord = axel * 1000000000000000000;

// Broswer detection - these must be consistent on every page.  make sure the old script file has the same variables.
var NS4 = (document.layers) ? 1 : 0;
var IE4 = ((document.all) && (!document.getElementById)) ? 1 : 0;
var IE5 = ((document.all) && (!document.fireEvent) && (!window.opera)) ? 1 : 0;
var DOM = (document.getElementById) ? 1 : 0;  // ns6+ and ie5+ and mozilla
var NS6 = ((!document.all) && (document.getElementById)) ? 1 : 0;  // ns6+ and mozilla, not ie6
var IE = (navigator.appName == "Microsoft Internet Explorer") ? 1 : 0;
var PC = (navigator.platform == "Win32") ? 1 : 0;
var MAC = ((navigator.appVersion.indexOf("PPC") >0) || (navigator.appVersion.indexOf("Mac") >0)) ? 1 : 0;

//Layer switch functions using the display property
function layerSwitchDisplay(theDivs, divId) {
// Layer switching functions
  for (var i = 0; i < theDivs.length; i++) {
    if (theDivs[i] == divId) {
      showLayerDisplay(theDivs[i]);
    }
    else {
      hideLayerDisplay(theDivs[i]);
    }
  }
}
function hideLayerDisplay(whichEl) {
  document.getElementById(whichEl).style.display = "none";
}
function showLayerDisplay(whichEl) {
  document.getElementById(whichEl).style.display = "";
}




function Redirect(url) {
location.replace(url);
}
////////////-------------------------------------------------
var isOver = false; var isOverChild = false;
var timer = null; var timerChild = null;
var ddTop = 0;
var ddLeft = 0;
var myObject;

function Initms() {
  for (i = 0; i < tt.length; i++) {  // set m properties
  var ff = eval("nav_" + tt[i][1]);
  w_m = "gn" + tt[i][1];
  w_m = document.getElementById(w_m);
    if (tt[i][0] == 1) { // parent ms
      w_m.isChildm = 0;
      w_m.onmouseover = Overm;
      w_m.onmouseout = Outm;
      w_m.categoryId = tt[i][1];
      for ( j = 0 ; j < ff.length ; j++ ) {
        w_mItem = "nav_" + tt[i][1] + "_" + j;
        w_mItem = document.getElementById(w_mItem);
        w_mItem.onmouseover = OvermEl;
        w_mItem.onmouseout = OutmEl;
        if (ff[j][2]) w_mItem.childm = ff[j][3];
        w_mItem.destination = ff[j][0];
        w_mItem.newWin = ff[j][4];
        w_mItem.w_Class = "dd";
        w_mItem.onclick = LinkingPage;
      }
    }
    else { //child ms
      w_m.isChildm = 1;
      w_m.onmouseover = OverChildm;
      w_m.onmouseout = OutChildm;
      for ( j = 0 ; j < ff.length ; j++ ) {
        w_mItem = "nav_" + tt[i][1] + "_" + j;
        w_mItem = document.getElementById(w_mItem);
        w_mItem.onmouseover = OverChildmEl;
        w_mItem.onmouseout = OutChildmEl;
        w_mItem.destination = ff[j][0];
        w_mItem.newWin = ff[j][4];
        w_mItem.w_Class = "dd";
        w_mItem.onclick = LinkingPage;
      }
    }
  }
}

function ShowLayer(el) {
  var showEl = "gn" + el;
  if (!DOM) return;
  clearTimeout(timer);
  HideAllLayers();
  isOver = true;
  var w_El = document.getElementById(showEl);
  w_Anchor = "nav_" + el;
	
	//if (el == 2407) {
		// document.getElementById("nav_2407").style.backgroundImage = '';
		// alert(document.getElementById("nav_2407").style.backgroundImage);
	//}
	
  if (document.getElementById(w_Anchor)){
    myObject = document.getElementById(w_Anchor);
    //ddLeft = myObject.offsetLeft;
    while (myObject.offsetParent) {
      ddTop += myObject.offsetTop;
			ddLeft += myObject.offsetLeft;
      myObject = myObject.offsetParent;
    }
    ddTop += 39; //increase to offset where menu sits next to main menu
    ddLeft += -2; //decrease to move drop down menu left, increase for right
  }
  if (w_El.className == "dd1") {var w_ElWidth = 130;}
  else if (w_El.className == "dd2") {var w_ElWidth = 130;}
  if ((ddLeft + w_ElWidth) > document.body.clientWidth) {
    ddLeft = document.body.clientWidth - w_ElWidth;
  }
  w_El.style.top = ddTop;
  w_El.style.left = ddLeft;
  ToggleSelect('hidden');
  for (i = 0; i < tt.length; i++) {
    w_nav = "nav_" + tt[i][1];
    if (document.getElementById(w_nav)) {
      w_nav = document.getElementById(w_nav);
      if (w_nav.className == "navElOn") w_nav.className = "navElOnOver";
    }
  }
  document.getElementById(w_Anchor).className = "navElOver";
  w_El.style.visibility = "visible";
  ddTop = 0; ddLeft = 0;
}

function ToggleSelect(visState) {
  if (!IE) return;
  for (i=0; i < document.all.tags('SELECT').length; i++){
    var obj = document.all.tags('SELECT')[i];
    if (!obj || !obj.offsetParent) continue;
    obj.style.visibility = visState;
  }
}

function ShowChildLayer(childm, mItem) {
  var childm = "gn" + childm;
  clearTimeout(timer);
  HideChildLayers();
  var w_El = document.getElementById(childm);
  if (document.getElementById(mItem)){
    var myObject = document.getElementById(mItem);
    while (myObject.offsetParent) {
      ddTop = ddTop + myObject.offsetTop;
      ddLeft = ddLeft + myObject.offsetLeft;
      myObject = myObject.offsetParent;
    }
  }
  if (w_El.className == "dd1") {var w_ElWidth = 130;}
  else if (w_El.className == "dd2") {var w_ElWidth = 130;}
  if ((ddLeft + (2*w_ElWidth)) > document.body.clientWidth) {
    w_El.style.top = ddTop - 2;
    w_El.style.left = ddLeft - 127;
  }
  else {
    w_El.style.top = ddTop - 2;
    w_El.style.left = ddLeft + 117;
  }
  w_El.style.visibility = "visible";
  ddTop = 0; ddLeft = 0;
}
function HideAllLayers() {
  if (isOver || isOverChild) return;
  for (i = 0; i < tt.length; i++) {
    w_El = "gn" + tt[i][1];
    w_El = document.getElementById(w_El);
    w_El.style.visibility = "hidden";
    w_El.style.left = -1000;
    w_nav = "nav_" + tt[i][1];
    if (document.getElementById(w_nav)) {
      w_nav = document.getElementById(w_nav);
      if (tt[i][1] != navOn) {//restore to original state
      	if(tt[i][1] != 2407){//this is the arcade button
            w_nav.className = "navEl";
		 		}else{
            w_nav.className = "navEl2";
		 		}
      }else {
        w_nav.className = "navElOn";
      }
    }
  }
  ToggleSelect('visible');
}
function HideChildLayers() {
  if (isOverChild) return;
  for (i = 0; i < tt.length; i++) {
    if (tt[i][0] == 2) {
      w_El = "gn" + tt[i][1];
      w_El = document.getElementById(w_El);
      w_El.style.visibility = "hidden";
    }
  }
}
function Overm() {
  clearTimeout(timer);
  isOver = true;
}
function OverChildm() {
  clearTimeout(timerChild);
  isOverChild = true;
}
function OutChildm() {
  clearTimeout(timerChild);
  isOverChild = false;
  timerChild = setTimeout("HideAllLayers()",300);
}
function OvermEl() {
  this.className = 'ddHigh';
  this.style.cursor = 'hand';
  if (this.childm || isOverChild) {
    ShowChildLayer(this.childm, this.id);
  }
  if (!this.childm) {
    HideChildLayers();
  }
}
function OverChildmEl() {
  this.className = 'ddHigh';
  this.style.cursor = 'hand';
}
function OutmEl() {
  this.className = this.w_Class;
}
function Outm() {
  clearTimeout(timer);
  isOver = false;
  timer = setTimeout("HideAllLayers()", 300);
}
function OutChildmEl() {
  this.className = this.w_Class;
}
function LinkingPage() {
  var url = String(this.destination);
  if (!this.newWin) {window.location.href = url;}
  else {window.open(url);}
}

///--- Drop Down lists are in Alphabetical Order

///--- 2009 Meet Information
var nav_1= new Array(['/meetinfo.cfm','General Information',0,-1,0],
						['/eligible.cfm','Eligibility Requirements',0,-1,0],
						['/open.cfm','Online Registration',0,-1,0],
						['/rules.cfm','Event Rules',0,-1,0],
						['/forms.cfm','Forms and Applications',0,-1,0],
						['/layout.cfm','Layout of Arena Floor ',0,-1,0],
						['Schedule_by_Event.pdf','Meet Schedule by Event',0,-1,0],
///---                        ['Schedule_by_Event.pdf','Meet Schedule by Event',0,-1,0],
                        ['Schedule_by_Time.pdf','Meet Schedule by Time',0,-1,0],
///---						['/1G_Schedule_by_Time.htm','Meet Schedule by Time',0,-1,0],
						['/travel.cfm','Travel Information',0,-1,0],
						['/lodging.cfm','Lodging Information',0,-1,0],
						['/shuttle.cfm','Simplot Games Shuttle',0,-1,0],
						['/poster.cfm','2010 Simplot Games Poster',0,-1,0]);

///--- Training
var nav_2 = new Array(['/overview.cfm','Overview',0,-1,0],
						['/possible.cfm','Meet Management',0,-1,0],
						['/sponsors.cfm','Sponsors',0,-1,0],
						['/guest.cfm','Guest Olympians',0,-1,0],
						['/volunteers.cfm','Officials / Volunteers',0,-1,0],
///---						['/SimplotGamesStore/SimplotGamesStore.html','Simplot Games Store',0,-1,0],
						['/camp.cfm','Simplot Games Track Camp',0,-1,0],
						['/Video/index.html','Simplot Games Videos',0,-1,0]);


///---  Engineering
var nav_3 = new Array(['/2010_calendar.pdf','2010 Games Calendar',0,-1,0],
					   ['/breakfast.cfm','Breakfast-Fosbury&Friends',0,-1,0],
					   ['/adark.cfm','Simplot Games After Dark',0,-1,0],					
					   ['/coaches.cfm',' ...Track Academy',0,-1,0],
					      ['/deal.cfm',' ...Deal or No Deal',0,-1,0],
					     ['/dance.cfm',' ...Simplot Games Dance Party',0,-1,0],
					   ['/parade.cfm','Ceremonies & Parade',0,-1,0],
					   ['/otherTF.cfm','Other adidas Sponsored T&F Events',0,-1,0]);

///--- E.S. & H. Department 
var nav_4 = new Array(['/recordsset.cfm','Simplot Games Records',0,-1,0],
				  ['/results.cfm?ResultYear=2010','Meet Results',0,-1,0],
				  ['/pictures.cfm','Photos - Meet Winners',0,-1,0],
				  ['/press.cfm','Press Releases',0,-1,0],
				  ['http://www.dyestat.com/?pg=reg72007IndoorSimplot','2007 dyestat.com',0,-1,0],
				  ['http://nw.dyestat.com//?pg=reg72008IndoorID-Simplot-Games','2008 dyestat.com',0,-1,0],
                  ['http://www.dyestatnw.com/?pg=us-2009-Indoor-Track-Simplot-Games','2009 dyestat.com',0,-1,0],
                  ['http://www.dyestat.com//?pg=us-2010-Indoor-Simplot','2010 dyestat.com',0,-1,0]);


var tt = new Array([1,1],[1,2],[1,3],[1,4]);
var navOn=0;

for ( i = 0 ; i < tt.length ; i++ ) {
  var ff_nav = eval("nav_" + tt[i][1]);
  var divNum = "gn" + tt[i][1];

  if (tt[i][0] == 1) {
    var strDiv = "<div align=\"left\" class=\"dd1\" id=\"" + divNum + "\">";
  }
  else {
    var strDiv = "<div align=\"left\" class=\"dd2\" id=\"" + divNum + "\">";
  }
  strDiv += '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr valign="top"><td width="110">';
  for ( j = 0 ; j < ff_nav.length ; j++ ) {

      strDiv += "<div align=\"left\" id='nav_" + tt[i][1] + "_" + j + "' class='dd'>&nbsp\;" + ff_nav[j][1];
    
    strDiv += "</div>";
  }
  strDiv += '</td></tr></table></div>';
  document.write(strDiv);
}

Initms();

var Topmenu='<div class="nav" style="width:770px; background-color:red;" >' +
		'<table width="770" cellspacing="0" cellpadding="0" style="background-image: url(sf_nav_bg36.gif);" valign="top">' +
			'<tr align="center" valign="middle">' +
				'<td valign="middle" class="navEl" id="nav_0"><a href="/">SIMPLOT GAMES HOME</a></td>' +
				'<td valign="middle" class="navEl" id="nav_1" onMouseOver="ShowLayer(1);" onMouseOut="Outm();">' +
				'2010 Meet Information</td>' +
				'<td valign="middle" class="navEl" id="nav_2" onMouseOver="ShowLayer(2);" onMouseOut="Outm();">' +
				'General Information</td>' +
				'<td valign="middle" class="navEl" id="nav_3" onMouseOver="ShowLayer(3);" onMouseOut="Outm();">' +
				'Calendar and Events </td>' +
				'<td valign="middle" class="navEl" id="nav_4" onMouseOver="ShowLayer(4);" onMouseOut="Outm();">Simplot Games History</td></tr></table></div>';			




