// menu_sideNavi

var path = document.location.pathname;

var menu = {
  accessory: [
        { text: "外部フラッシュ", link:"/product/compact/accessory/flash/index.html" },
        { text: "コンバージョンレンズ", link:"/product/compact/accessory/conversion_lens/index.html" },
        { text: "バッテリー類", link:"/product/compact/accessory/battery/index.html" },
        { text: "ケース&amp;ストラップ", link:"/product/compact/accessory/case_strap/index.html" },
        { text: "防水プロテクター", link:"/product/compact/accessory/underwater/index.html" },
        { text: "記録メディア", link:"/product/compact/accessory/media/index.html" },
        { text: "その他", link:"/product/compact/accessory/others/index.html" }
           ]
};

var old_products = [
  "/product/compact/accessory/underwater/pt045/index.html",
  "/product/compact/accessory/underwater/pt044/index.html",
  "/product/compact/accessory/underwater/pt043/index.html",
  "/product/compact/accessory/underwater/pt036/index.html",
  "/product/compact/accessory/underwater/pt037/index.html",
  "/product/compact/accessory/underwater/pt035/index.html",
  "/product/compact/accessory/underwater/pt039/index.html",
  "/product/compact/accessory/flash/fl50/index.html",
  "/product/compact/accessory/flash/fl36/index.html",
  "/product/compact/accessory/underwater/pt038/index.html",
  "/product/compact/accessory/underwater/pt033/index.html",
  "/digitalcamera/accessory/protector/pt034/",
	"/product/compact/accessory/underwater/pt041/",
	"/product/compact/accessory/underwater/pt042/",
	"/product/compact/accessory/underwater/ppo05/",
	"/product/compact/accessory/underwater/ppo02/"
];

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/compact/record/index2.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/compact/record/index2.html"><img src="/product/images/localNav_record_o.gif" alt="今までに発表した製品" width="154" height="25" /></a></span></li>');
};

/*------------------------------------------------------------------*/

document.write('<h2><a href="/product/compact/index.html"><img src="/product/images/localNav_compact_o.gif" alt="コンパクトデジタルカメラ" width="156" height="29" /></a></h2>');
document.write('<ul id="localNav">');
document.write('<li><span><a href="/product/compact/index.html#ancMju"><img src="/product/images/localNav_mu_o.gif" alt="ミュー" width="154" height="25" /></a></span></li>');
document.write('<li><span><a href="/product/compact/index.html#ancMjuTough"><img src="/product/images/localNav_muTough_o.gif" alt="ミュータフ" width="154" height="25" /></a></span></li>');
document.write('<li><span><a href="/product/compact/index.html#ancSp"><img src="/product/images/localNav_sp_o.gif" alt="SP" width="154" height="25" /></a></span></li>');
document.write('<li><span><a href="/product/compact/index.html#ancFe"><img src="/product/images/localNav_fe_o.gif" alt="fe" width="154" height="25" /></a></span></li>');
document.write('<li><span><a href="/product/compact/accessory/index.html"><img src="/product/images/localNav_accessory_o.gif" alt="アクセサリー" width="154" height="25" /></a></span>');
document.write('<ul>');
write_menu("accessory");
document.write('</ul>');
document.write('</li>');
write_old_products();
document.write('<li><span><a href="/product/price/compact.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 -->');