/* ホームタイトル */
function home() {
   document.title =  "ニューデリー日本人学校";
}

/* インフォメーションフレーム切り替え for info */
function info(X) {
   window.mainframe.left.location.href = "./info/info00.html";
   window.mainframe.right.location.href = "./info/info0"+ X +".html";
   return false;
}
/* フレーム切り替え for sitemap */
function guide(X) {
   parent.left.location.href = "../guide/guide00.html";
   window.location.href = "../guide/guide"+ X +".html";
   return false;
}
function edu(X) {
   parent.left.location.href = "../edu/edu00.html";
   window.location.href = "../edu/edu"+ X +".html";
   return false;
}
function kinder(X) {
   parent.left.location.href = "../kinder/kinder00.html";
   window.location.href = "../kinder/kinder0"+ X +".html";
   return false;
}
function archive(X) {
   parent.left.location.href = "../archive/archive00.html";
   window.location.href = "../archive/archive0"+ X +".html";
   return false;
}
function bus(X) {
   parent.left.location.href = "../bus/bus00.html";
   window.location.href = "../bus/bus0"+ X +".html";
   return false;
}
function link(X) {
   parent.left.location.href = "../link/link00.html";
   window.location.href = "../link/link0"+ X +".html";
   return false;
}
function info2(X) {
   parent.left.location.href = "../info/info00.html";
   window.location.href = "../info/info"+ X +".html";
   return false;
}


/* メニュー開閉 */
/* クラス名の定義 */
menu_class    = 'menu';      /* メニュー領域のクラス名 */
submenu_class = 'sub_menu';  /* サブメニュー（折りたたみ）領域のクラス名 */
title_class = 'title';   /* メニュー題目のクラス名 */
icon_class    = 'icon';      /* アイコンのクラス名 */
/* アイコンの定義 */
imgs = new Array(
  '../images/closed.gif',    　　/* 閉じている状態のアイコン */
  '../images/open.gif'       　　/* 開いている状態のアイコン */
);
/* displayスタイル(CSS)の定義 */
displays = new Array(
  'none',                    /* 閉じている状態の displayスタイル(CSS) */
  'block'                    /* 開いている状態の displayスタイル(CSS) */
);
/* メニューを逆転する関数 */
function menu_toggle(title,icon){
  /* DOM チェック */
  if(!document.hasChildNodes) return;
  /* アイコンの変更 */
  var node = null, state = title.title_state?0:1;
  var new_state = state?1:0;
  if(icon){
    if(icon.className && icon.className == icon_class) node = icon;
    else if(icon.hasChildNodes()){
      var nodes = icon.childNodes;
      for(var i=0; i<nodes.length; i++){
        var n = nodes[i];
        if(n.className && n.className == icon_class){
          node = n;
          break;
        }
      }
    }
    if(node) node.src = imgs[new_state];
  }
  /* メニュー表示の変更 */
  if(title.parentNode.hasChildNodes()){
    var nodes = title.parentNode.childNodes;
    for(var i=0; i<nodes.length; i++){
      var node = nodes[i];
      if(node.className){
        if(node.className == submenu_class){
          node.style.display = displays[new_state];
          break;
        }
      }
    }
    title.title_state = new_state;
  }
  return false;
}

