if (document.images) {
  var menu_menu_off = new Image;
  var menu_menu_on  = new Image;
  menu_menu_off.src = 'img/menu_menu.gif';
  menu_menu_on.src = 'img/menu_menu_on.gif';

  var menu_about_off = new Image;
  var menu_about_on  = new Image;
  menu_about_off.src = 'img/menu_about.gif';
  menu_about_on.src = 'img/menu_about_on.gif';

  var menu_press_off = new Image;
  var menu_press_on  = new Image;
  menu_press_off.src = 'img/menu_press.gif';
  menu_press_on.src = 'img/menu_press_on.gif';

  var menu_location_off = new Image;
  var menu_location_on  = new Image;
  menu_location_off.src = 'img/menu_locations.gif';
  menu_location_on.src = 'img/menu_locations_on.gif';

  var menu_contact_off = new Image;
  var menu_contact_on  = new Image;
  menu_contact_off.src = 'img/menu_contact.gif';
  menu_contact_on.src = 'img/menu_contact_on.gif';

  var sub_menu_dinner_off = new Image;
  var sub_menu_dinner_on  = new Image;
  sub_menu_dinner_off.src = 'img/sub_menu_dinner.gif';
  sub_menu_dinner_on.src = 'img/sub_menu_dinner_on.gif';

  var sub_menu_lunch_off = new Image;
  var sub_menu_lunch_on  = new Image;
  sub_menu_lunch_off.src = 'img/sub_menu_lunch.gif';
  sub_menu_lunch_on.src = 'img/sub_menu_lunch_on.gif';

  var sub_menu_special_off = new Image;
  var sub_menu_special_on  = new Image;
  sub_menu_special_off.src = 'img/sub_menu_special.gif';
  sub_menu_special_on.src = 'img/sub_menu_special_on.gif';

  var sub_menu_teppan_off = new Image;
  var sub_menu_teppan_on  = new Image;
  sub_menu_teppan_off.src = 'img/sub_menu_teppan.gif';
  sub_menu_teppan_on.src = 'img/sub_menu_teppan_on.gif';

  var sub_menu_pismo_off = new Image;
  var sub_menu_pismo_on  = new Image;
  sub_menu_pismo_off.src = 'img/sub_menu_pismo.gif';
  sub_menu_pismo_on.src = 'img/sub_menu_pismo_on.gif';

  var sub_menu_santa_off = new Image;
  var sub_menu_santa_on  = new Image;
  sub_menu_santa_off.src = 'img/sub_menu_santa.gif';
  sub_menu_santa_on.src = 'img/sub_menu_santa_on.gif';

  var sub_menu_san_off = new Image;
  var sub_menu_san_on  = new Image;
  sub_menu_san_off.src = 'img/sub_menu_san.gif';
  sub_menu_san_on.src = 'img/sub_menu_san_on.gif';

  var sub_menu_paso_off = new Image;
  var sub_menu_paso_on  = new Image;
  sub_menu_paso_off.src = 'img/sub_menu_paso.gif';
  sub_menu_paso_on.src = 'img/sub_menu_paso_on.gif';

  var sub_menu_sf_off = new Image;
  var sub_menu_sf_on  = new Image;
  sub_menu_sf_off.src = 'img/sub_menu_sf.gif';
  sub_menu_sf_on.src = 'img/sub_menu_sf_on.gif';

  var sub_menu_wow_off = new Image;
  var sub_menu_wow_on  = new Image;
  sub_menu_wow_off.src = 'img/sub_menu_wow.gif';
  sub_menu_wow_on.src = 'img/sub_menu_wow_on.gif';

  var appetizer_off = new Image;
  var appetizer_on  = new Image;
  appetizer_off.src = 'img/appetizers_off.gif';
  appetizer_on.src = 'img/appetizers.gif';

  var salad_off = new Image;
  var salad_on  = new Image;
  salad_off.src = 'img/salads_off.gif';
  salad_on.src = 'img/salads.gif';

  var hsr_off = new Image;
  var hsr_on  = new Image;
  hsr_off.src = 'img/house_special_rolls_off.gif';
  hsr_on.src = 'img/house_special_rolls.gif';

  var sashimi_off = new Image;
  var sashimi_on  = new Image;
  sashimi_off.src = 'img/sashimi_off.gif';
  sashimi_on.src = 'img/sashimi.gif';

  var rb_off = new Image;
  var rb_on  = new Image;
  rb_off.src = 'img/rice_bowls_off.gif';
  rb_on.src = 'img/rice_bowls.gif';

  var dc_off = new Image;
  var dc_on  = new Image;
  dc_off.src = 'img/dinner_combinations_off.gif';
  dc_on.src = 'img/dinner_combinations.gif';

  var udon_off = new Image;
  var udon_on  = new Image;
  udon_off.src = 'img/udon_off.gif';
  udon_on.src = 'img/udon.gif';

  var ala_off = new Image;
  var ala_on  = new Image;
  ala_off.src = 'img/alacarte_off.gif';
  ala_on.src = 'img/alacarte.gif';

  var bc_off = new Image;
  var bc_on  = new Image;
  bc_off.src = 'img/boat_combinations_off.gif';
  bc_on.src = 'img/boat_combinations.gif';

  var sushi_off = new Image;
  var sushi_on  = new Image;
  sushi_off.src = 'img/sushi_off.gif';
  sushi_on.src = 'img/sushi.gif';
}

/**
 * Drop Down Menu - settings
 */
// Sub menu for 'Menu'
var menu1 = new Array()
menu1[0] = '<a href="dinner.php" onMouseOver="document.menu_menu.src=menu_menu_on.src; document.sub_menu_dinner.src=sub_menu_dinner_on.src;" onMouseOut="document.menu_menu.src=menu_menu_off.src; document.sub_menu_dinner.src=sub_menu_dinner_off.src;"><img src="img/sub_menu_dinner.gif" width="130" height="27" border="0" id="sub_menu_dinner" name="sub_menu_dinner" style="border-bottom:1px solid #ffffff;" /></a>';
menu1[1] = '<a href="lunch.php" onMouseOver="document.menu_menu.src=menu_menu_on.src; document.sub_menu_lunch.src=sub_menu_lunch_on.src;" onMouseOut="document.menu_menu.src=menu_menu_off.src; document.sub_menu_lunch.src=sub_menu_lunch_off.src;"><img src="img/sub_menu_lunch.gif" width="130" height="27" border="0" id="sub_menu_lunch" name="sub_menu_lunch" style="border-bottom:1px solid #ffffff;" /></a>';
menu1[2] = '<a href="special.php" onMouseOver="document.menu_menu.src=menu_menu_on.src; document.sub_menu_special.src=sub_menu_special_on.src;" onMouseOut="document.menu_menu.src=menu_menu_off.src; document.sub_menu_special.src=sub_menu_special_off.src;"><img src="img/sub_menu_special.gif" width="130" height="27" border="0" id="sub_menu_special" name="sub_menu_special" style="border-bottom:1px solid #ffffff;" /></a>';
menu1[3] = '<a href="teppanlunch.php" onMouseOver="document.menu_menu.src=menu_menu_on.src; document.sub_menu_teppan.src=sub_menu_teppan_on.src;" onMouseOut="document.menu_menu.src=menu_menu_off.src; document.sub_menu_teppan.src=sub_menu_teppan_off.src;"><img src="img/sub_menu_teppan.gif" width="130" height="27" border="0" id="sub_menu_teppan" name="sub_menu_teppan" /></a>';

// Sub menu for 'Locations'
var menu2 = new Array()
menu2[0] = '<a href="location-pismobeach.php" onMouseOver="document.menu_location.src=menu_location_on.src; document.sub_menu_pismo.src=sub_menu_pismo_on.src;" onMouseOut="document.menu_location.src=menu_location_off.src; document.sub_menu_pismo.src=sub_menu_pismo_off.src;"><img src="img/sub_menu_pismo.gif" width="155" height="27" border="0" id="sub_menu_pismo" name="sub_menu_pismo" style="border-bottom:1px solid #ffffff;" /></a>';
menu2[1] = '<a href="location-santamaria.php" onMouseOver="document.menu_location.src=menu_location_on.src; document.sub_menu_santa.src=sub_menu_santa_on.src;" onMouseOut="document.menu_location.src=menu_location_off.src; document.sub_menu_santa.src=sub_menu_santa_off.src;"><img src="img/sub_menu_santa.gif" width="155" height="27" border="0" id="sub_menu_santa" name="sub_menu_santa" style="border-bottom:1px solid #ffffff;" /></a>';
menu2[2] = '<a href="location-sanluis.php" onMouseOver="document.menu_location.src=menu_location_on.src; document.sub_menu_san.src=sub_menu_san_on.src;" onMouseOut="document.menu_location.src=menu_location_off.src; document.sub_menu_san.src=sub_menu_san_off.src;"><img src="img/sub_menu_san.gif" width="155" height="27" border="0" id="sub_menu_san" name="sub_menu_san" style="border-bottom:1px solid #ffffff;" /></a>';
menu2[3] = '<a href="location-pasorobles.php" onMouseOver="document.menu_location.src=menu_location_on.src; document.sub_menu_paso.src=sub_menu_paso_on.src;" onMouseOut="document.menu_location.src=menu_location_off.src; document.sub_menu_paso.src=sub_menu_paso_off.src;"><img src="img/sub_menu_paso.gif" width="155" height="27" border="0" id="sub_menu_paso" name="sub_menu_paso" style="border-bottom:1px solid #ffffff;" /></a>';
menu2[4] = '<a href="location-wow.php" onMouseOver="document.menu_location.src=menu_location_on.src; document.sub_menu_wow.src=sub_menu_wow_on.src;" onMouseOut="document.menu_location.src=menu_location_off.src; document.sub_menu_wow.src=sub_menu_wow_off.src;"><img src="img/sub_menu_wow.gif" width="155" height="27" border="0" id="sub_menu_wow" name="sub_menu_wow" style="border-bottom:1px solid #ffffff;" /></a>';
menu2[5] = '<a href="location-dublin.php" onMouseOver="document.menu_location.src=menu_location_on.src; document.sub_menu_sf.src=sub_menu_sf_on.src;" onMouseOut="document.menu_location.src=menu_location_off.src; document.sub_menu_sf.src=sub_menu_sf_off.src;"><img src="img/sub_menu_sf.gif" width="155" height="27" border="0" id="sub_menu_sf" name="sub_menu_sf" /></a>';

var menuwidth = '130px'; // default menu width
var menubgcolor = '#ffffff';//'#4594c9'; // menu bgcolor
var disappeardelay = 250;  // menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick = "yes"; // hide menu when user clicks within menu?
var ie4 = document.all;
var ns6 = document.getElementById&&!document.all;
if (ie4||ns6) {
  document.write('<div id="dropmenudiv" style="z-index:1; visibility:hidden; border:1px solid #ffffff; width:'+menuwidth+'; background-color:'+menubgcolor+'" onMouseover="clearhidemenu();" onMouseout="dynamichide(event);"></div>');
}
function getposOffset(what, offsettype) {
  var totaloffset = (offsettype=="left") ? what.offsetLeft : what.offsetTop;
  var parentEl=what.offsetParent;
  while (parentEl!=null) {
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
  }
  return totaloffset;
}
function showhide(obj, e, visible, hidden, menuwidth) {
  if (ie4||ns6) {
    dropmenuobj.style.left = dropmenuobj.style.top = "-500px";
  }
  if (menuwidth!="") {
    dropmenuobj.widthobj=dropmenuobj.style;
    dropmenuobj.widthobj.width=menuwidth;
  }
  if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") {
    obj.visibility=visible;
  } else if (e.type=="click") {
    obj.visibility=hidden;
  }
}
function iecompattest(){
  return (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
}
function clearbrowseredge(obj, whichedge) {
  var edgeoffset=0;
  if (whichedge=="rightedge") {
    var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15;
    dropmenuobj.contentmeasure=dropmenuobj.offsetWidth;
    if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) {
      edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
    }
  } else {
    var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset;
    var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18;
    dropmenuobj.contentmeasure=dropmenuobj.offsetHeight;
    if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure) { // move up?
      edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight;
      if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) { // up no good either?
        edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge;
      }
    }
  }
  return edgeoffset;
}
function populatemenu(what) {
  if (ie4||ns6) {
    dropmenuobj.innerHTML=what.join("");
  }
}
function dropdownmenu(obj, e, menucontents, menuwidth) {
  if (window.event) {
    event.cancelBubble = true;
  } else if (e.stopPropagation) {
    e.stopPropagation();
  }
  clearhidemenu();
  dropmenuobj = document.getElementById ? document.getElementById("dropmenudiv") : dropmenudiv;
  populatemenu(menucontents);

  if (ie4||ns6) {
    showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth);
    dropmenuobj.x = getposOffset(obj, "left");
    dropmenuobj.y = getposOffset(obj, "top");
    dropmenuobj.style.left = dropmenuobj.x - clearbrowseredge(obj, "rightedge")+"px";
    dropmenuobj.style.top = dropmenuobj.y - clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px";
  }
  return clickreturnvalue();
}
function clickreturnvalue() {
  if (ie4||ns6) {
    return false;
  } else {
    return true;
  }
}
function contains_ns6(a, b) {
  while (b.parentNode) {
    if ((b = b.parentNode) == a) {
      return true;
    }
  }
  return false;
}
function dynamichide(e) {
  if (ie4&&!dropmenuobj.contains(e.toElement)) {
    delayhidemenu();
  } else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) {
    delayhidemenu();
  }
}
function hidemenu(e) {
  if (typeof dropmenuobj!="undefined") {
    if (ie4||ns6) {
      dropmenuobj.style.visibility="hidden";
    }
  }
}
function delayhidemenu() {
  if (ie4||ns6) {
    delayhide=setTimeout("hidemenu()", disappeardelay);
  }
}
function clearhidemenu() {
  if (typeof delayhide!="undefined") {
    clearTimeout(delayhide);
  }
}
if (hidemenu_onclick=="yes") {
  document.onclick=hidemenu;
}

// Image Hover script
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function keep_on() {
  var pdd = document.getElementById('menu_sub');
  pdd.style.visibility = 'visible';
}
function keep_off() {
  var pdd = document.getElementById('menu_sub');
  pdd.style.visibility = 'hidden';
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
