// ** save as utf-8 **

function MM_swapImgRestore() {
  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_preloadImages() {
  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_findObj(n, d) {
  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 MM_swapImage() {
  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];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features).focus();
}


var cmTimer = new Array();
var ready = null;
var category_name = "";		// 保持

function init(category) {
  var obj;
  category_name = category;		// 保持
  
  if(category != 'home') {
    obj = objectFinder('menu_home');
    moveLayerTo(obj, '114', '60');
  }
  
  if(category != 'info') {
    obj = objectFinder('menu_info');
    moveLayerTo(obj, '114', '60');
  }
  
  if(category != 'club') {
    obj = objectFinder('menu_club');
    moveLayerTo(obj, '114', '60');
  }
    
  if(category != 'guide') {
    obj = objectFinder('menu_guide');
    moveLayerTo(obj, '114', '60');
  }
    
  if(category != 'reserve') {
    obj = objectFinder('menu_reserve');
    moveLayerTo(obj, '114', '60');
  }
    
  obj = objectFinder('menu_blank');
  moveLayerTo(obj, '114', '60');
  
  ready = true;
}


function objectFinder(nm, d){
  if(!d) d = document;

  var p;
  if((p = nm.indexOf("?")) > 0 && parent.frames.length){
    d = parent.frames[nm.substring(p + 1)].document;
    nm = nm.substring(0, p);
  }

  var i;
  var x;
  if(!(x = d[nm]) && d.all){
    x = d.all[nm];
  }else if(!(x = d[nm]) && d.getElementById){
    x = d.getElementById(nm);
  }
  for(i = 0; !x && i < d.forms.length; i++){
    x = d.forms[i][nm];
  }
  for(i = 0; !x && d.layers && i < d.layers.length; i++){
    x = objectFinder(nm, d.layers[i].document);
  }
  return x;
}

function openMenu(na, nb){
  init(category_name);		// 毎回初期化
  if(ready){
    if(cmTimer[na]){
      clearTimeout(cmTimer[na]);
      cmTimer[na] = null;
    }
    var obj;
    obj = objectFinder(na);
    layerVisible(obj, "visible");
    if(nb){
      obj = objectFinder(nb);
      layerVisible(obj, "visible");
    }
  }
}

function clearMenu(na, nb){
  if(ready){
    if(cmTimer[na]){
      var obj;
      obj = objectFinder(na);
      layerVisible(obj, "hidden");
      if(nb){
        obj = objectFinder(nb);
        layerVisible(obj, "hidden");
      }
      clearTimeout(cmTimer[na]);
      cmTimer[na] = null;
    }else{
      cmTimer[na] = setTimeout("clearMenu(" + "'" + na + "'" + ', ' + "'" + nb + "');", 250);
    }
  }
}

function moveLayerTo(obj, x, y){
//	alert(document.getElementById('main').offsetLeft);
  y = y - 0 + 84; y += '';
  x = x - 0 + document.getElementById('main').offsetLeft;		// センタリング対応
  if(document.all || document.getElementById){
    obj.style.left = x;
    obj.style.top = y;
  }else if(document.layers){
    obj.moveTo(x, y);
  }
}

function moveLayerBy(obj, dx, dy){
  if(document.all || document.getElementById){
    obj.style.pixelLeft += dx;
    obj.style.pixelTop += dy;
  }else if(document.layers){
    obj.moveBy(dx, dy);
  }
}

function layerVisible(obj, option){
  if(option == "visible"){
    if(document.all || document.getElementById){
      obj.style.visibility = "visible";
    }else if(document.layers){
      obj.visibility = "show";
    }
  }else if(option == "hidden"){
    if(document.all || document.getElementById){
      obj.style.visibility = "hidden";
    }else if(document.layers){
      obj.visibility = "hide";
    }
  }
}


function load_menu(category) {
  
  if(category != 'info') {
    document.write('<div class="menulayer" id="menu_info" onMouseOut="MM_swapImgRestore(); clearMenu('+"'"+'menu_info'+"'"+','+"'"+'menu_info'+"'"+');" onMouseOver="MM_swapImage('+"'"+'gnavinfo'+"'"+', '+"''"+', '+"'"+'./img/gnavinfo_j_over.gif'+"'"+'); openMenu('+"'"+'menu_info'+"'"+','+"'"+'menu_info'+"'"+');">');
    document.write('<layer onMouseOut="clearMenu('+"'"+'menu_info'+"'"+','+"'"+'menu_info'+"'"+');" onMouseOver="openMenu('+"'"+'menu_info'+"'"+','+"'"+'menu_info'+"'"+');">');
    document.write('<table border="0" cellspacing="0" cellpadding="0" width="586" height="20">');
    document.write('<tr>');
    document.write('  <td width="50"><a href="./info/index.html"><img src="./img/gmenuinfo_top_off.gif" width="50" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="55"><a href="./info/service.html"><img src="./img/gmenuinfo_service_off.gif" width="55" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="70"><a href="./info/rule.html"><img src="./img/gmenuinfo_rule_off.gif" width="70" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="115"><a href="./info/event.html"><img src="./img/gmenuinfo_event_off.gif" width="115" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="75"><a href="./info/access.html"><img src="./img/gmenuinfo_access_off.gif" width="75" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="100"><a href="./info/comp.html"><img src="./img/gmenuinfo_comp_off.gif" width="100" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="121" bgcolor="#002600"><img src="./img/clear.gif" width="121" height="2"></td>');
    document.write('</tr>');
    document.write('</table>');
    document.write('</layer>');
    document.write('</div>');
  }
  
  
  if(category != 'club') {
    document.write('<div class="menulayer" id="menu_club" onMouseOut="MM_swapImgRestore(); clearMenu('+"'"+'menu_club'+"'"+','+"'"+'menu_club'+"'"+');" onMouseOver="MM_swapImage('+"'"+'gnavclub'+"'"+', '+"''"+', '+"'"+'./img/gnavclub_j_over.gif'+"'"+'); openMenu('+"'"+'menu_club'+"'"+','+"'"+'menu_club'+"'"+');">');
    document.write('<layer onMouseOut="clearMenu('+"'"+'menu_club'+"'"+','+"'"+'menu_club'+"'"+');" onMouseOver="openMenu('+"'"+'menu_club'+"'"+','+"'"+'menu_club'+"'"+');">');
    document.write('<table border="0" cellspacing="0" cellpadding="0" width="586" height="20">');
    document.write('<tr>');
    document.write('  <td width="100" bgcolor="#002600"><img src="./img/clear.gif" width="100" height="2"></td>');
    document.write('  <td width="65"><a href="./club/index.html"><img src="./img/gmenuclub_house_off.gif" width="65" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="65"><a href="./club/restaurant.html"><img src="./img/gmenuclub_restaurant_off.gif" width="65" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="70"><a href="./club/proshop.html"><img src="./img/gmenuclub_proshop_off.gif" width="70" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="286" bgcolor="#002600"><img src="./img/clear.gif" width="286" height="2"></td>');
    document.write('</tr>');
    document.write('</table>');
    document.write('</layer>');
    document.write('</div>');
  }
  
  
  if(category != 'guide') {
    document.write('<div class="menulayer" id="menu_guide" onMouseOut="MM_swapImgRestore(); clearMenu('+"'"+'menu_guide'+"'"+','+"'"+'menu_guide'+"'"+');" onMouseOver="MM_swapImage('+"'"+'gnavguide'+"'"+', '+"''"+', '+"'"+'./img/gnavguide_j_over.gif'+"'"+'); openMenu('+"'"+'menu_guide'+"'"+','+"'"+'menu_guide'+"'"+');">');
    document.write('<layer onMouseOut="clearMenu('+"'"+'menu_guide'+"'"+','+"'"+'menu_guide'+"'"+');" onMouseOver="openMenu('+"'"+'menu_guide'+"'"+','+"'"+'menu_guide'+"'"+');">');
    document.write('<table border="0" cellspacing="0" cellpadding="0" width="586" height="20">');
    document.write('<tr>');
    document.write('  <td width="75"><a href="./guide/index.html"><img src="./img/gmenuguide_top_off.gif" width="75" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="35"><img src="./img/gmenuguide_hole_off.gif" width="35" height="20" alt="Hole" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole01.html"><img src="./img/gmenuguide_h1_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="3"><img src="./img/gmenuguide_dot.gif" width="3" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole02.html"><img src="./img/gmenuguide_h2_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="3"><img src="./img/gmenuguide_dot.gif" width="3" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole03.html"><img src="./img/gmenuguide_h3_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="3"><img src="./img/gmenuguide_dot.gif" width="3" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole04.html"><img src="./img/gmenuguide_h4_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="3"><img src="./img/gmenuguide_dot.gif" width="3" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole05.html"><img src="./img/gmenuguide_h5_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="3"><img src="./img/gmenuguide_dot.gif" width="3" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole06.html"><img src="./img/gmenuguide_h6_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="3"><img src="./img/gmenuguide_dot.gif" width="3" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole07.html"><img src="./img/gmenuguide_h7_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="3"><img src="./img/gmenuguide_dot.gif" width="3" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole08.html"><img src="./img/gmenuguide_h8_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="3"><img src="./img/gmenuguide_dot.gif" width="3" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole09.html"><img src="./img/gmenuguide_h9_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="5"><img src="./img/gmenuguide_dot5.gif" width="5" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole10.html"><img src="./img/gmenuguide_h10_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="5"><img src="./img/gmenuguide_dot5.gif" width="5" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole11.html"><img src="./img/gmenuguide_h11_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="5"><img src="./img/gmenuguide_dot5.gif" width="5" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole12.html"><img src="./img/gmenuguide_h12_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="5"><img src="./img/gmenuguide_dot5.gif" width="5" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole13.html"><img src="./img/gmenuguide_h13_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="5"><img src="./img/gmenuguide_dot5.gif" width="5" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole14.html"><img src="./img/gmenuguide_h14_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="5"><img src="./img/gmenuguide_dot5.gif" width="5" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole15.html"><img src="./img/gmenuguide_h15_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="5"><img src="./img/gmenuguide_dot5.gif" width="5" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole16.html"><img src="./img/gmenuguide_h16_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="5"><img src="./img/gmenuguide_dot5.gif" width="5" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole17.html"><img src="./img/gmenuguide_h17_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="5"><img src="./img/gmenuguide_dot5.gif" width="5" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole18.html"><img src="./img/gmenuguide_h18_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="5"><img src="./img/gmenuguide_dot5.gif" width="5" height="20" alt="" border="0"></td>');
    document.write('  <td width="18"><a href="./guide/hole19.html"><img src="./img/gmenuguide_h19_off.gif" width="18" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="60" bgcolor="#002600"><img src="./img/clear.gif" width="60" height="2"></td>');
    document.write('</tr>');
    document.write('</table>');
    document.write('</layer>');
    document.write('</div>');
  }
  
  
  if(category != 'reserve') {
    document.write('<div class="menulayer" id="menu_reserve" onMouseOut="MM_swapImgRestore(); clearMenu('+"'"+'menu_reserve'+"'"+','+"'"+'menu_reserve'+"'"+');" onMouseOver="MM_swapImage('+"'"+'gnavreserve'+"'"+', '+"''"+', '+"'"+'./img/gnavreserve_j_over.gif'+"'"+'); openMenu('+"'"+'menu_reserve'+"'"+','+"'"+'menu_reserve'+"'"+');">');
    document.write('<layer onMouseOut="clearMenu('+"'"+'menu_reserve'+"'"+','+"'"+'menu_reserve'+"'"+');" onMouseOver="openMenu('+"'"+'menu_reserve'+"'"+','+"'"+'menu_reserve'+"'"+');">');
    document.write('<table border="0" cellspacing="0" cellpadding="0" width="586" height="20">');
    document.write('<tr>');
    document.write('  <td width="290" bgcolor="#002600"><img src="./img/clear.gif" width="290" height="2"></td>');
    document.write('  <td width="65"><a href="./reserve/index.html"><img src="./img/gmenureserve_top_off.gif" width="65" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="80"><a href="https://www.onwardresortgolf.jp/mangilao/ja/reserve/online.html"><img src="./img/gmenureserve_online_off.gif" width="80" height="20" alt="" border="0"></a></td>');
    document.write('  <td width="151" bgcolor="#002600"><img src="./img/clear.gif" width="151" height="2"></td>');
    document.write('</tr>');
    document.write('</table>');
    document.write('</layer>');
    document.write('</div>');
  }
  
  
  document.write('<div class="menulayer" id="menu_blank">');
  document.write('<layer>');
  document.write('<table border="0" cellspacing="0" cellpadding="0" width="586" height="20">');
  document.write('<tr>');
  document.write('  <td width="586" bgcolor="#002600"><img src="./img/clear.gif" width="586" height="2"></td>');
  document.write('</tr>');
  document.write('</table>');
  document.write('</layer>');
  document.write('</div>');
}

function open_subwin(f, n, w, h){ // f:file_name n:win_name w:width h:height
  win01=window.open(f,n,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+w+",height="+h);
  win01.focus();
}
