// popup for seating chart
var newwindow;
function popchart(url) {
	newwindow=window.open(url,'name','resizable=1');
	if (window.focus) {newwindow.focus()}
}


// Preload ImageClass Swap Function

 /* if (document.images)
    {
      preload_image_object = new Image();
      // set image url
      image_url = new Array();
      image_url[0] = "gfx/homeimage01.jpg";
      image_url[1] = "gfx/homeimage02.jpg";
      image_url[2] = "gfx/homeimage03.jpg";
      image_url[3] = "gfx/homeimage04.jpg";
	  image_url[4] = "gfx/homeimage05.jpg";
      image_url[5] = "gfx/homeimage06.jpg";
	  image_url[6] = "gfx/homeimage07.jpg";
	  image_url[7] = "gfx/homeimage08.jpg";
	  image_url[8] = "gfx/homeimage09.jpg";
	  image_url[9] = "gfx/homeimage10.jpg";
       var i = 0;
       for(i=0; i<=3; i++)
         preload_image_object.src = image_url[i];
    } */

// Hack to enable main menu in MSIE

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace
	(" over", "");
   }
   }
  }
 }
}
window.onload=startList;

// Class Swap Function

// copyright Eddie Traversa 2002
// free to use as long as this copyright notice is intact
// http://dhtmlnirvana.com/
// etraversa@dhtmlnirvana.com

var selected_id = null;
var dom = document.getElementById;
function swapIt(id, newclass) {
if (dom) {
if(selected_id != id) {
el = document.getElementById(id);
el.className = newclass;
el.style.cursor = "hand";
el.style.cursor = "pointer";
}
}
}
function down (id,oldclass,newclass){
if (dom) {
if(selected_id != null) {
document.getElementById(selected_id).className = oldclass;
}
el.className = newclass;
selected_id = id;
}
}
function redirect(select,newhref)
{
	destination = select.options[select.selectedIndex].value;
	if (destination) location.href = newhref+destination;
}
var timeLength=20;
function countdown()
{
	if (timeLength>-1)
	{
		docount(timeLength);
		timeLength--;
		setTimeout("countdown()",60000);
		//pause(6);
	}
}
function docount(length)
{
	if (document.getElementById("checkoutclock"))
	{
		document.getElementById("checkoutclock").innerHTML="You now have approximately "+length+" minutes to move to the next step.";
	}
}
function pause(millisecondi)
{
    var now = new Date();
    var exitTime = now.getTime() + millisecondi;

    while(true)
    {
        now = new Date();
        if(now.getTime() > exitTime) return;
    }
}

// since window.onload is called above, we need a way to do something else on
// window.onload without causing js errors in IE
// (if you call window.onload twice in ie you will get a 'not implemented' error)
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
