// order =>  sub1/sub2|sub1 
var dirs = "company|harbor|info|maintenance";
var dir = null;
if(document.URL.match("http://[^/]+/("+dirs+")")){
	var dir = RegExp.$1;
}
var hash = {
"maintenance":{
        "index.html":"設備保全",
        "gantry.html":"ガントリークレーン",
        "electricity.html":"受電設備",
        "bridge.html":"可動橋設備",
        "tunnel.html":"トンネル",
        "other.html":"SOLAS"
},
             
"harbor":{
        "index.html":"港湾施設管理",
        "wharf.html":"埠頭管理",
         },

"info": {
        "index.html":"営業案内",
        "recycling.html":"北九州リサイクルポート",
        "shinmoji.html":"新門司マリーナ",
        "wakamatsu.html":"久岐の浜駐車場",
        "water.html":"船舶給水販売"
        },
"company":{
	"index.html":"会社案内",
	"profile.html":"会社概要",
	"history.html":"沿革",
	"finance.html":"財務情報"
	}
}

$(function(){
  if(dir != null){
    var html=$("#ListNavi").html();
    html+="<dl>";
    if(hash[dir]["index.html"] != null){
      html+="<dt>"+hash[dir]["index.html"]+"サブメニュー</dt>";
    }
    for(key in hash[dir]){
      var title = "";
      var href = "";
      if(key == "index.html"){
        title = hash[dir][key] + "トップ";
      }else if(key == "recycling"){
        title = hash[dir][key];
      }else{
        title = hash[dir][key];
      }
      href = key;
      var here = ' class="other"';
      var url = document.URL.match("/$")?document.URL + "index.html":document.URL;
      if(url.match(dir + "/" + key)){
        here = ' class="here"';
      }
      html+="<dd" + here + "><a href='" + href + "'>"+title+"</a></dd>";

    }
    html+="</dl>";
    $("#ListNavi").html(html);
  
    $("dd.other","#ListNavi").hover(function(){
      //$(this).css("background","#AAF");
      $(this).removeClass("other");
      $(this).addClass("here");
    },function(){
      //$(this).css("background","#FFF");
      $(this).removeClass("here");
      $(this).addClass("other");
    });

  }  

});


