﻿// menu_sideNavi

var path = document.location.pathname;

var menu = {
  esystem: [ 
        { text: "E-3", link:"/product/dslr/e3/index.html" },
        { text: "E-30", link:"/product/dslr/e30/index.html" },
        { text: "E-620", link:"/product/dslr/e620/index.html" },
        { text: "E-520", link:"/product/dslr/e520/index.html" }
      ],
  microFourThirds: [ 
		{ text: "E-P2", link:"/product/dslr/ep2/index.html" },
        { text: "E-P1", link:"/product/dslr/ep1/index.html" },
        { text: "E-PL1", link:"/product/dslr/epl1/index.html" }
      ]
};

var old_products = [
  "/product/dslr/e1/index.html",
  "/product/dslr/e330/index.html",
  "/product/dslr/e510/index.html",
  "/product/dslr/e410/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/dslr/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/dslr/record/index.html"><img src="/product/images/localNav_record_o.gif" alt="今までに発表した製品" width="154" height="25" /></a></span></li>');
};

/*------------------------------------------------------------------*/

document.write('<h2><a href="/product/dslr/index.html"><img src="/product/images/localNav_dslr.gif" alt="デジタル一眼カメラ" width="156" height="29" /></a></h2>');
document.write('<ul id="localNav">');
document.write('<li><span><a href="/product/dslr/index.html#ancFourThirds"><img src="/product/images/localNav_ft_o.gif" alt="FourThirds規格ボディー　E-シリーズ" width="154" height="38" /></a></span>');
document.write('<ul>');
write_menu("esystem");
document.write('</ul>');
document.write('</li>');
document.write('<li><span><a href="/product/dslr/index.html#ancMicroFourThirds"><img src="/product/images/localNav_mft_o.gif" alt="MicroFourThirds規格ボディー　OLYMPUS PEN" width="154" height="38" /></a></span>');
document.write('<ul>');
write_menu("microFourThirds");
document.write('</ul>');
document.write('</li>');
document.write('<li><span><a href="/product/dslr/lens/index.html"><img src="/product/images/localNav_lens_ft_o.gif" alt="FourThirds規格　交換レンズ" width="154" height="38" /></a></span></li>');
document.write('<li><span><a href="/product/dslr/mlens/index.html"><img src="/product/images/localNav_lens_mft_o.gif" alt="MicroFourThirds規格　交換レンズ" width="154" height="38" /></a></span></li>');
document.write('<li><span><a href="/product/dslr/lens/selector/index.html"><img src="/product/images/localNav_lensSelector_o.gif" alt="レンズセレクター" width="154" height="25" /></a></span></li>');
document.write('<li><span><a href="/product/dslr/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/index.html" rel="popup"><img src="/product/images/localNav_price_o.gif" alt="価格表／JANコード表" width="154" height="25" /></a></span></li>');
document.write('<li><span><a href="http://www.olympus.co.jp/jp/lineup/spec/imsg/index.cfm"><img src="/product/images/localNav_conversion_o.gif" alt="製品比較" width="154" height="25" /></a></span></li>');
document.write('</ul><!-- /localNav -->');