// menu_sideNavi
var path = document.location.pathname;

var old_products = [ 
  "/product/dslr/lens/50-200_28-35/index.html",
  "/product/dslr/lens/14-45_35-56/",
  "/product/dslr/lens/14-54_28-35/"
];

var lens_selector = "/product/dslr/lens/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/dslr/record/index.html#dslrLens"><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#dslrLens"><img src="/product/images/localNav_record_o.gif" alt="今までに発表した製品" width="154" height="25" /></a></span></li>');
};

s_page = {
"ancWidezoom": "9-18_40_56 7-14_40 11-22_28-35".split(" "),
"ancStandardzoom": "14-35_20swd 12-60_28-40swd 14-54_28-35 14-42_35_56 18-180_35-63".split(" "),
"ancTelephotozoom": "35-100_20 90-250_28 50-200_28-35swd 40-150_40-56 70-300_40-56".split(" "),
"ancSinglefocus": "150_20 300_28 8_35fisheye 25_28".split(" "),
"ancMacrolens": "50_20macro 35_35-macro".split(" "),
"ancAccessories": "ec14 ec20 ex25 mf-1 lh43".split(" "),
"ancWidezoom2": "9-18_40-56".split(" "),
"ancStandardzoom2": "14-42_35-56 14-150_40-56".split(" "),
"ancSinglefocus2": "17_28".split(" "),
"ancAccessories2": "mmf1 mf2 prfd405 prfd37 prfd52pro prfd58pro".split(" "),
"/product/dslr/lens/selector/index.html": "selector".split(" ")
}

out_html = ['<h2><a href="/product/dslr/index.html"><img src="/product/images/localNav_dslr.gif" alt="デジタル一眼カメラ" width="156" height="29" /></a></h2>',
'<ul id="localNav">',
'<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></li>',
'<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></li>',
'<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>',
'<ul>',
'<li><a href="/product/dslr/lens/index.html#ancWidezoom">ワイドズーム</a></li>',
'<li><a href="/product/dslr/lens/index.html#ancStandardzoom">標準ズーム</a></li>',
'<li><a href="/product/dslr/lens/index.html#ancTelephotozoom">望遠ズーム</a></li>',
'<li><a href="/product/dslr/lens/index.html#ancSinglefocus">単焦点</a></li>',
'<li><a href="/product/dslr/lens/index.html#ancMacrolens">マクロ</a></li>',
'<li><a href="/product/dslr/lens/index.html#ancAccessories">関連アクセサリー</a></li>',
'</ul>',
'</li>',
'<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>',
'<ul>',
'<li><a href="/product/dslr/mlens/index.html#ancWidezoom2">ワイドズーム</a></li>',
'<li><a href="/product/dslr/mlens/index.html#ancStandardzoom2">標準ズーム</a></li>',
'<li><a href="/product/dslr/mlens/index.html#ancSinglefocus2">単焦点</a></li>',
'<li><a href="/product/dslr/mlens/index.html#ancAccessories2">関連アクセサリー</a></li>',
'</ul>',
'</li>',
'<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>',
'<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>',
].join('');

selector_html = ['<h2><a href="/product/dslr/index.html"><img src="/product/images/localNav_dslr.gif" alt="デジタル一眼カメラ" width="156" height="29" /></a></h2>',
'<ul id="localNav">',
'<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></li>',
'<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></li>',
'<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>',
'<ul>',
'<li><a href="/product/dslr/lens/index.html#ancWidezoom">ワイドズーム</a></li>',
'<li><a href="/product/dslr/lens/index.html#ancStandardzoom">標準ズーム</a></li>',
'<li><a href="/product/dslr/lens/index.html#ancTelephotozoom">望遠ズーム</a></li>',
'<li><a href="/product/dslr/lens/index.html#ancSinglefocus">単焦点</a></li>',
'<li><a href="/product/dslr/lens/index.html#ancMacrolens">マクロ</a></li>',
'<li><a href="/product/dslr/lens/index.html#ancAccessories">関連アクセサリー</a></li>',
'</ul>',
'</li>',
'<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>',
'<ul>',
'<li><a href="/product/dslr/mlens/index.html#ancWidezoom2">ワイドズーム</a></li>',
'<li><a href="/product/dslr/mlens/index.html#ancStandardzoom2">標準ズーム</a></li>',
'<li><a href="/product/dslr/mlens/index.html#ancSinglefocus2">単焦点</a></li>',
'<li><a href="/product/dslr/mlens/index.html#ancTelephotozoom2">望遠ズーム</a></li>',
'<li><a href="/product/dslr/mlens/index.html#ancAccessories2">関連アクセサリー</a></li>',
'</ul>',
'</li>',
'<li><span><a href="/product/dslr/lens/selector/index.html"><img src="/product/images/localNav_lensSelector_h.gif" alt="レンズセレクター" width="154" height="25" /></a></span></li>',
'<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>',
].join('');

if(path == lens_selector){
	document.write(selector_html);
}else{
	document.write(out_html);
}


for(cat in s_page){
  for(var i=0, f; f=s_page[cat][i]; i++){
    if(window.location.href.match(f)){
      $('#localNav li li a[href$='+cat+']').parent().addClass('current')
      continue;
    }
  }
}



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 -->');


