// menu_sideNavi

var path = document.location.pathname;

var menu = {
  voicetrek: [
        { text: "DS-750", link:"/product/audio/ds750/index.html" },
        { text: "DS-700", link:"/product/audio/ds700/index.html" },
        { text: "V-82", link:"/product/audio/v82/index.html" },
        { text: "V-72", link:"/product/audio/v72/index.html" },
        { text: "V-62", link:"/product/audio/v62/index.html" },
        { text: "V-22", link:"/product/audio/v22/index.html" },
        { text: "VN-6200", link:"/product/audio/vn6200/index.html" },
        { text: "限定企画　G-20", link:"/product/audio/g20/index.html" }
      ],
linearpcm: [ 
        { text: "LS-11", link:"/product/audio/ls11/index.html" },
        { text: "LS-10", link:"/product/audio/ls10/index.html" }
      ],
radioserver: [ 
        { text: "VJ-10", link:"/product/audio/vj10/index.html" },
        { text: "VJ-10-JA", link:"/product/audio/vj10ja/index.html" },
        { text: "VJ-10-JB", link:"/product/audio/vj10jb/index.html" },
        { text: "PJ-10", link:"/product/audio/pj10/index.html" }
      ]
};

var old_products = [
  "/product/audio/j500/index.html",
  "/product/audio/v61/index.html",
  "/product/audio/v51/index.html",
  "/product/audio/v41/index.html",
  "/product/audio/v13/index.html",
  "/product/audio/ds40/index.html",
  "/product/audio/ds50/index.html",
  "/product/audio/ds60/index.html",
  "/product/audio/ds51/index.html",
  "/product/audio/ds61/index.html",
  "/product/audio/ds71/index.html",
  "/product/audio/vn4100/index.html",
  "/product/audio/vn2100/index.html",
  "/product/audio/vn3200/index.html",
  "/product/audio/g10/index.html",
  "/voicetrek/v11/index.html",
  "/voicetrek/v30/index.html",
  "/product/audio/s713/index.html"
];

var selector = [
  "/product/audio/selector/index.html"
];

function write_menu(category){
  for(var i=0,cur_menu; cur_menu = menu[category][i]; i++){
    var _path = cur_menu["link"].split("index.html")[0]
    var _current = path.match(_path) ? ' class="current"' : '';
    document.write('<li'+_current+'><a href="'+cur_menu["link"]+'">'+cur_menu["text"]+'</a></li>');
  }
};

function write_old_products(){
  for(var i=0,cur_old; cur_old = old_products[i]; i++){
    if( path.match(cur_old.split("index.html")[0]) ){
      document.write('<li><span><a href="/product/audio/record/index.html"><img src="/product/images/localNav_record_h.gif" alt="今までに発表した製品" width="154" height="25" /></a></span></li>');
      return;
    }
  }
  document.write('<li><span><a href="/product/audio/record/index.html"><img src="/product/images/localNav_record_o.gif" alt="今までに発表した製品" width="154" height="25" /></a></span></li>');
};

function write_selector(){
  for(var i=0,cur_sel; cur_sel = selector[i]; i++){
    if( path.match(cur_sel.split("index.html")[0]) ){
      document.write('<li><span><a href="/product/audio/selector/index.html"><img src="/product/images/localNav_icrecorder_h.gif" alt="ICレコーダーセレクター" width="154" height="25" /></a></span></li>');
      return;
    }
  }
  document.write('<li><span><a href="/product/audio/selector/index.html"><img src="/product/images/localNav_icrecorder_o.gif" alt="ICレコーダーセレクター" width="154" height="25" /></a></span></li>');
};

/*------------------------------------------------------------------*/

document.write('<h2><a href="/product/audio/index.html"><img src="/product/images/localNav_audio.gif" alt="オーディオ" width="156" height="29" /></a></h2>');
document.write('<ul id="localNav">');
document.write('<li><span><a href="/product/audio/index.html#ancVoiceTrek"><img src="/product/images/localNav_voicetrek_o.gif" alt="ICレコーダー VoiceTrek" width="154" height="31" /></a></span>');
document.write('<ul>');
write_menu("voicetrek");
document.write('</ul>');
document.write('</li>');
write_selector();
document.write('<li><span><a href="/product/audio/index.html#ancLinearpcm"><img src="/product/images/localNav_linearpcm_o.gif" alt="リニアPCMレコーダー" width="154" height="31" /></a></span>');
document.write('<ul>');
write_menu("linearpcm");
document.write('</ul>');
document.write('</li>');
document.write('<li><span><a href="/product/audio/index.html#ancRadio"><img src="/product/images/localNav_radioserver_o.gif" alt="ラジオサーバー" width="154" height="31" /></a></span>');
document.write('<ul>');
write_menu("radioserver");
document.write('</ul>');
document.write('</li>');
document.write('<li><span><a href="/product/audio/accessory/index.html"><img src="/product/images/localNav_accessory_o.gif" alt="アクセサリー" width="154" height="25" /></a></span></li>');
write_old_products();
document.write('<li><span><a href="/product/price/audio.html" rel="popup"><img src="/product/images/localNav_price_o.gif" alt="価格表／JANコード表" width="154" height="25" /></a></span></li>');
document.write('</ul><!-- /localNav -->');