/* ########## オートスタートアップ ##########
  D: document.onloadで起動します。
*/
$(document).ready(function(){
});

var urlRootPath;
/* ########## arsoaHeaderSetup ##########
  U: $.arsoaHeaderSetup(argRootPath)
  D: ヘッダーを書き出します。ついでにルートのパスを設定します。
  I: jquery-1.5.1.min.js
  I: jquery.belatedPNG.min.js
  I: arsoaImageSwap()
  A: argRootPath ... ルートのパス
*/
$.fn.arsoaHeaderSetup =function(argRootPath){
  urlRootPath = argRootPath;

//  if(urlRootPath.charAt(1)=='.'){
    urlDirectPath = 'http://' + location.hostname + location.pathname.substring(0, location.pathname.lastIndexOf('/')) + '/' + argRootPath;
    urlDirectPathSsl = 'https://' + location.hostname + location.pathname.substring(0, location.pathname.lastIndexOf('/')) + '/' + argRootPath;
//  }else{
//    urlDirectPath = 'http://' + location.hostname + argRootPath;
//    urlDirectPathSsl = 'https://' + location.hostname + argRootPath;
//  }

  $(this).html('\
<div class="arsoa40th"><a><img src="'+ urlRootPath +'image/ph09.gif" alt="" width="135" height="60"/></a><br/></div>\n\
<div class="font01"><img src="'+ urlRootPath +'image/ph05.gif" alt="Text" width="28" height="10"/><br/></div>\n\
<div class="font02"><a><img src="'+ urlRootPath +'image/ph06_1_on.gif" alt="Normal" width="43" height="15"/></a><br/></div>\n\
<div class="font03"><a><img src="'+ urlRootPath +'image/ph06_2.gif" alt="Large" width="32" height="15"/></a><br/></div>\n\
');
  if($.browser.msie && $.browser.version <7) $(this).find('div.entry img').fixPng();
  $(this).find('div.entry').hover(function(){
    arsoaImageSwap(this, urlRootPath +'image/ph03_on.png', 'サンプルのお申込み', 151, 34);
  }, function(){
    arsoaImageSwap(this, urlRootPath +'image/ph03.png', 'サンプルのお申込み', 151, 34);
  });
  $(this).find('div.navi01').hover(function(){
    $(this).find('a img').attr({'src': urlRootPath +'image/ph04_1_on.gif'});
  }, function(){
    $(this).find('a img').attr({'src': urlRootPath +'image/ph04_1.gif'});
  });
  $(this).find('div.navi02').hover(function(){
    $(this).find('a img').attr({'src': urlRootPath +'image/ph04_2_on.gif'});
  }, function(){
    $(this).find('a img').attr({'src': urlRootPath +'image/ph04_2.gif'});
  });
  $(this).find('div.navi03').hover(function(){
    $(this).find('a img').attr({'src': urlRootPath +'image/ph04_3_on.gif'});
  }, function(){
    $(this).find('a img').attr({'src': urlRootPath +'image/ph04_3.gif'});
  });
  $(this).find('div.navi04').hover(function(){
    $(this).find('a img').attr({'src': urlRootPath +'image/ph04_4_on.gif'});
  }, function(){
    $(this).find('a img').attr({'src': urlRootPath +'image/ph04_4.gif'});
  });
  $(this).find('div.font02 a').click(function(){
    $('body').toggleClass('font_large',false);
    $(this).find('img').attr({'src': urlRootPath +'image/ph06_1_on.gif'});
    $(this).parents('div').find('div.font03 a img').attr({'src': urlRootPath +'image/ph06_2.gif'});
  });
  $(this).find('div.font03 a').click(function(){
    $('body').toggleClass('font_large',true);
    $(this).find('img').attr({'src': urlRootPath +'image/ph06_2_on.gif'});
    $(this).parents('div').find('div.font02 a img').attr({'src': urlRootPath +'image/ph06_1.gif'});
  });
  $(this).find('div.search input[name=query]').focus(function(){
    if($(this).attr('value') =='サイト内検索'){
      $(this).attr({'value': ''});
      $(this).toggleClass('empty',false);
    }
  });
  $(this).find('div.search input[name=query]').blur(function(){
    if($(this).attr('value') ==''){
      $(this).attr({'value': 'サイト内検索'});
      $(this).toggleClass('empty',true);
    }
  });
  $(this).find('div[class^=font] a').css({
    'cursor': 'pointer'
  });
  $(this).find('div.search input[name=query]').attr({'value': 'サイト内検索'});
  $(this).find('div.search input[name=query]').toggleClass('empty',true);
}

/* ########## arsoaImageSwap ##########
  U: arsoaImageSwap(argObjTarget, argURLImage, argSubject, argWidth, argHeight)
  D: PNG画像差替の場合、IE6とそれ以外で方法が違う為のラッパー。
  I: jquery-1.5.1.min.js
  I: jquery.belatedPNG.min.js
  A: argObjTarget ... 操作するimgを含むコンテナ(IE6の場合、コンテナ内のHTMLを入れ替える為)
  A: argURLImage .... 画像のURL
  A: argSubject ..... 画像のALT
  A: argWidth ....... 画像の幅
  A: argHeight ...... 画像の高さ
*/
function arsoaImageSwap(argObjTarget, argURLImage, argSubject, argWidth, argHeight){
  if($.browser.msie && $.browser.version <7){
    $(argObjTarget).html('<img src="'+ argURLImage +'" alt="'+ argSubject +'" width="'+ argWidth +'" height="'+ argHeight +'"/>');
    $(argObjTarget).find('img').fixPng();
  } else {
    $(argObjTarget).find('img').attr({'src': argURLImage});
  }
}

/* ########## arsoaSideMenuSetup ##########
  U: $.arsoaSideMenuSetup(argPreOpen)
  D: サイドメニューを書き出します。
  I: jquery-1.5.1.min.js
  I: arsoaHeaderSetup()
  I: arsoaImageSwap()
  A: argPreOpen ... アクティブにする項目(1-3,11-12,21-26,31-33,121-127)
*/
$.fn.arsoaSideMenuSetup =function(argPreOpen){
  $(this).html('\
<div class="menu00"><a href="'+ urlDirectPath +'./"><img src="'+ urlRootPath +'image/sidemenu_ph04.gif" alt="ARSOA" width="237" height="164"/></a></div>\n\
<div class="menu01">\n\
  <div class="menu_1"><a><img src="'+ urlRootPath +'image/sidemenu_ph01_1.png" alt="About ARSOA" width="237" height="30"/></a><br/></div>\n\
  <div class="menu_11"><a href="'+ urlDirectPath +'brand/"><img src="'+ urlRootPath +'image/sidemenu_ph02_11.png" alt="Brand Story" width="237" height="25"/></a><br/></div>\n\
  <div class="menu_12"><a href="'+ urlDirectPath +'company/"><img src="'+ urlRootPath +'image/sidemenu_ph02_12.png" alt="Company Information" width="237" height="25"/></a><br/></div>\n\
  <div class="menu_121"><a href="'+ urlDirectPath +'company/profile.html"><img src="'+ urlRootPath +'image/sidemenu_ph03_121.png" alt="Corporate Profile" width="237" height="22"/></a><br/></div>\n\
  <div class="menu_122"><a href="'+ urlDirectPath +'company/office.html"><img src="'+ urlRootPath +'image/sidemenu_ph03_122.png" alt="Headquarters" width="237" height="22"/></a><br/></div>\n\
  <div class="menu_123"><a href="'+ urlDirectPath +'company/plant.html"><img src="'+ urlRootPath +'image/sidemenu_ph03_123.png" alt="Our Plant" width="237" height="22"/></a><br/></div>\n\
  <div class="menu_124"><a href="'+ urlDirectPath +'company/history.html"><img src="'+ urlRootPath +'image/sidemenu_ph03_124.png" alt="History" width="237" height="22"/></a><br/></div>\n\
</div>\n\
<div class="menu02">\n\
  <div class="menu_2"><a><img src="'+ urlRootPath +'image/sidemenu_ph01_2.png" alt="Products" width="237" height="30"/></a><br/></div>\n\
  <div class="menu_21"><a href="'+ urlDirectPath +'product/"><img src="'+ urlRootPath +'image/sidemenu_ph02_21.png" alt="List of Products" width="237" height="25"/></a><br/></div>\n\
  <div class="menu_22"><a href="'+ urlDirectPath +'product/skin/"><img src="'+ urlRootPath +'image/sidemenu_ph02_22.png" alt="Skincare" width="237" height="25"/></a><br/></div>\n\
  <div class="menu_221"><a href="'+ urlDirectPath +'product/skin/queensilver/"><img src="'+ urlRootPath +'image/sidemenu_ph03_221.png" alt="ARSOA Queen Silver" width="237" height="22"/></a><br/></div>\n\
  <div class="menu_222"><a href="'+ urlDirectPath +'product/skin/amuny/"><img src="'+ urlRootPath +'image/sidemenu_ph03_222.png" alt="Amuny" width="237" height="22"/></a><br/></div>\n\
  <div class="menu_223"><a href="'+ urlDirectPath +'product/skin/saussurea/"><img src="'+ urlRootPath +'image/sidemenu_ph03_223.png" alt="Saussurea" width="237" height="22"/></a><br/></div>\n\
  <div class="menu_224"><a href="'+ urlDirectPath +'product/skin/nuquor/"><img src="'+ urlRootPath +'image/sidemenu_ph03_224.png" alt="Nuquor R" width="237" height="22"/></a><br/></div>\n\
  <div class="menu_225"><a href="'+ urlDirectPath +'product/skin/step.html"><img src="'+ urlRootPath +'image/sidemenu_ph03_225.png" alt="Steps to Use the Skincare Products" width="237" height="22"/></a><br/></div>\n\
  <div class="menu_226"><a href="'+ urlDirectPath +'product/skin/concept.html"><img src="'+ urlRootPath +'image/sidemenu_ph03_226.png" alt="Structure of Skin" width="237" height="22"/></a><br/></div>\n\
  <div class="menu_23"><a href="'+ urlDirectPath +'product/make/"><img src="'+ urlRootPath +'image/sidemenu_ph02_23.png" alt="Makeup" width="237" height="25"/></a><br/></div>\n\
  <div class="menu_24"><a href="'+ urlDirectPath +'product/hairbody/"><img src="'+ urlRootPath +'image/sidemenu_ph02_24.png" alt="Hair Care/Body Care" width="237" height="25"/></a><br/></div>\n\
</div>\n\
<style>\n\
  div#'+ $(this).attr('id') +' {\n\
    width: 237px;\n\
    height: 468px;\n\
    background: url('+ urlRootPath +'image/sidemenu_bg01_2.jpg) no-repeat left top;\n\
  }\n\
  div#'+ $(this).attr('id') +' div.menu00 {\n\
    width: 237px;\n\
    height: 164px;\n\
  }\n\
</style>\n\
');
  if($.browser.msie && $.browser.version <7) $(this).find('div div a img').fixPng();
  $(this).find('div.menu01 div[class^=menu_12][class!=menu_12]').hide();
  $(this).find('div.menu02 div[class^=menu_22][class!=menu_22]').hide();
  $(this).find('div.menu01 div.menu_1 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
       arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph01_1_on.png', 'アルソアについて', 237, 30);
    }
  }, function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph01_1.png', 'アルソアについて', 237, 30);
    }
  });
  $(this).find('div.menu01 div.menu_11 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_11_on.png', 'ブランドストーリー', 237, 25);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_11.png', 'ブランドストーリー', 237, 25);
    }
  });
  $(this).find('div.menu01 div.menu_12 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_12_on.png', '企業情報', 237, 25);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_12.png', '企業情報', 237, 25);
    }
  });
  $(this).find('div.menu01 div.menu_121 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_121_on.png', '会社概要', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_121.png', '会社概要', 237, 22);
    }
  });
  $(this).find('div.menu01 div.menu_122 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_122_on.png', '本社のご案内', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_122.png', '本社のご案内', 237, 22);
    }
  });
  $(this).find('div.menu01 div.menu_123 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_123_on.png', 'アクセス', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_123.png', 'アクセス', 237, 22);
    }
  });
  $(this).find('div.menu01 div.menu_124 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_124_on.png', '工場のご案内', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_124.png', '工場のご案内', 237, 22);
    }
  });
  $(this).find('div.menu01 div.menu_125 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_125_on.png', '沿革', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_125.png', '沿革', 237, 22);
    }
  });
  $(this).find('div.menu01 div.menu_126 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_126_on.png', '採用情報', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_126.png', '採用情報', 237, 22);
    }
  });
  $(this).find('div.menu01 div.menu_127 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_127_on.png', 'TVCM', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_127.png', 'TVCM', 237, 22);
    }
  });
  $(this).find('div.menu02 div.menu_2 a').hover(function(){
    if(!$(this).hasClass('active')){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph01_2_on.png', '製品情報', 237, 30);
    }
  }, function(){
    if(!$(this).hasClass('active')){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph01_2.png', '製品情報', 237, 30);
    }
  });
  $(this).find('div.menu02 div.menu_21 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_21_on.png', '製品一覧', 237, 25);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_21.png', '製品一覧', 237, 25);
    }
  });
  $(this).find('div.menu02 div.menu_22 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_22_on.png', 'スキンケア', 237, 25);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_22.png', 'スキンケア', 237, 25);
    }
  });
  $(this).find('div.menu02 div.menu_221 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_221_on.png', 'アルソア クイーンシルバー', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_221.png', 'アルソア クイーンシルバー', 237, 22);
    }
  });
  $(this).find('div.menu02 div.menu_222 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_222_on.png', 'アムニー', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_222.png', 'アムニー', 237, 22);
    }
  });
  $(this).find('div.menu02 div.menu_223 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_223_on.png', 'サースレア', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_223.png', 'サースレア', 237, 22);
    }
  });
  $(this).find('div.menu02 div.menu_224 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_224_on.png', 'ヌクォルR', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_224.png', 'ヌクォルR', 237, 22);
    }
  });
  $(this).find('div.menu02 div.menu_225 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_225_on.png', 'スキンケア製品使用ステップ', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_225.png', 'スキンケア製品使用ステップ', 237, 22);
    }
  });
  $(this).find('div.menu02 div.menu_226 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_226_on.png', '肌の仕組み', 237, 22);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph03_226.png', '肌の仕組み', 237, 22);
    }
  });
  $(this).find('div.menu02 div.menu_23 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_23_on.png', 'メイクアップ', 237, 25);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_23.png', 'メイクアップ', 237, 25);
    }
  });
  $(this).find('div.menu02 div.menu_24 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_24_on.png', 'ヘアケア＆ボディケア', 237, 25);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_24.png', 'ヘアケア＆ボディケア', 237, 25);
    }
  });
  $(this).find('div.menu02 div.menu_25 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_25_on.png', 'ヘルスケア', 237, 25);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_25.png', 'ヘルスケア', 237, 25);
    }
  });
  $(this).find('div.menu02 div.menu_26 a').hover(function(){
    if(!$(this).find('img').attr('src').match(/_act/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_26_on.png', '浄水器', 237, 25);
    }
  }, function(){
    if($(this).find('img').attr('src').match(/_on/)){
      arsoaImageSwap(this, urlRootPath +'image/sidemenu_ph02_26.png', '浄水器', 237, 25);
    }
  });

  $(this).find('div.menu01 div.menu_1 a').click(function(){
    arsoaSideMenuSwitch(1);
  });
  $(this).find('div.menu02 div.menu_2 a').click(function(){
    arsoaSideMenuSwitch(2);
  });

  if(String(argPreOpen).match(/^12/)){
    $(this).find('div.menu01 div[class^=menu_12][class!=menu_12]').show();
    $(this).find('div.menu01 div.menu_1 a').unbind('click');
    $(this).find('div.menu01 div.menu_1 a').click(function(){
      arsoaSideMenuSwitch(12);
    });
  }
  if(String(argPreOpen).match(/^22/)){
    $(this).find('div.menu02 div[class^=menu_22][class!=menu_22]').show();
    $(this).find('div.menu02 div.menu_2 a').unbind('click');
    $(this).find('div.menu02 div.menu_2 a').click(function(){
      arsoaSideMenuSwitch(22);
    });
    $(this).css({
      'height': '594px'
    });
    $(this).closest('div.sidemenu').css({
      'background': 'url('+ urlRootPath +'image/sidemenu_bg01_2.jpg) no-repeat left top'
    });
  }
  switch(argPreOpen){
    case 121:
      arsoaImageSwap('div#menubox div.menu01 div.menu_121 a', urlRootPath +'image/sidemenu_ph03_121_act.png', '会社概要', 237, 22);
      break;
    case 122:
      arsoaImageSwap('div#menubox div.menu01 div.menu_122 a', urlRootPath +'image/sidemenu_ph03_122_act.png', '本社のご案内', 237, 22);
      break;
    case 123:
      arsoaImageSwap('div#menubox div.menu01 div.menu_123 a', urlRootPath +'image/sidemenu_ph03_123_act.png', 'アクセス', 237, 22);
      break;
    case 124:
      arsoaImageSwap('div#menubox div.menu01 div.menu_124 a', urlRootPath +'image/sidemenu_ph03_124_act.png', '工場のご案内', 237, 22);
      break;
    case 125:
      arsoaImageSwap('div#menubox div.menu01 div.menu_125 a', urlRootPath +'image/sidemenu_ph03_125_act.png', '沿革', 237, 22);
      break;
    case 126:
      arsoaImageSwap('div#menubox div.menu01 div.menu_126 a', urlRootPath +'image/sidemenu_ph03_126_act.png', '採用情報', 237, 22);
      break;
    case 127:
      arsoaImageSwap('div#menubox div.menu01 div.menu_127 a', urlRootPath +'image/sidemenu_ph03_127_act.png', 'TVCM', 237, 22);
      break;
    case 221:
      arsoaImageSwap('div#menubox div.menu02 div.menu_221 a', urlRootPath +'image/sidemenu_ph03_221_act.png', 'アルソア クイーンシルバー', 237, 22);
      break;
    case 222:
      arsoaImageSwap('div#menubox div.menu02 div.menu_222 a', urlRootPath +'image/sidemenu_ph03_222_act.png', 'アムニー', 237, 22);
      break;
    case 223:
      arsoaImageSwap('div#menubox div.menu02 div.menu_223 a', urlRootPath +'image/sidemenu_ph03_223_act.png', 'サースレア', 237, 22);
      break;
    case 224:
      arsoaImageSwap('div#menubox div.menu02 div.menu_224 a', urlRootPath +'image/sidemenu_ph03_224_act.png', 'ヌクォル', 237, 22);
      break;
    case 225:
      arsoaImageSwap('div#menubox div.menu02 div.menu_225 a', urlRootPath +'image/sidemenu_ph03_225_act.png', 'スキンケア製品使用ステップ', 237, 22);
      break;
    case 226:
      arsoaImageSwap('div#menubox div.menu02 div.menu_226 a', urlRootPath +'image/sidemenu_ph03_226_act.png', 'スキンケアコンセプト', 237, 22);
      break;
  }
  $(this).find('div[class^=menu] div[class^=menu_] a').css({'cursor':'pointer'});
  arsoaSideMenuSwitch(eval(String(argPreOpen).substr(0,2)));
}

/* ########## arsoaSideMenuSwitch ##########
  U: arsoaSideMenuSwitch(argMenunum)
  D: サイドメニューの開閉処理。
  I: jquery-1.5.1.min.js
  I: arsoaHeaderSetup()
  I: arsoaImageSwap()
  A: argMenunum ... アクティブにする項目(1-3,11-12,21-26,31-33,121-127)
*/
function arsoaSideMenuSwitch(argMenunum){
  arsoaImageSwap('div#menubox div.menu01 div.menu_1 a', urlRootPath +'image/sidemenu_ph01_1.png', 'アルソアについて', 237, 30);
  $('div#menubox div.menu01 div.menu_1 a').removeClass('active');
  $('div#menubox div.menu01').animate({
    height: '30px'
  },300,'linear');
  arsoaImageSwap('div#menubox div.menu02 div.menu_2 a', urlRootPath +'image/sidemenu_ph01_2.png', '製品情報', 237, 30);
  $('div#menubox div.menu02 div.menu_2 a').removeClass('active');
  $('div#menubox div.menu02').animate({
    height: '30px',
    top: '195px'
  },300,'linear',function(){
    switch(eval(String(argMenunum).substr(0,2))){
      case 1:
        arsoaImageSwap('div#menubox div.menu01 div.menu_1 a', urlRootPath +'image/sidemenu_ph01_1_act.png', 'アルソアについて', 237, 30);
        $('div#menubox div.menu01 div.menu_1 a').addClass('active');
        arsoaMenuboxStretch(80, 30);
        break;
      case 2:
        arsoaImageSwap('div#menubox div.menu02 div.menu_2 a', urlRootPath +'image/sidemenu_ph01_2_act.png', '製品情報', 237, 30);
        $('div#menubox div.menu02 div.menu_2 a').addClass('active');
        arsoaMenuboxStretch(30, 130 );
        break;
      case 11:
        arsoaImageSwap('div#menubox div.menu01 div.menu_1 a', urlRootPath +'image/sidemenu_ph01_1_act.png', 'アルソアについて', 237, 30);
        $('div#menubox div.menu01 div.menu_1 a').addClass('active');
        arsoaMenuboxStretch(80, 30);
        arsoaImageSwap('div#menubox div.menu01 div.menu_11 a', urlRootPath +'image/sidemenu_ph02_11_act.png', '「黒い石けん」との出会い', 237, 25);
        break;
      case 12:
        arsoaImageSwap('div#menubox div.menu01 div.menu_1 a', urlRootPath +'image/sidemenu_ph01_1_act.png', 'アルソアについて', 237, 30);
        $('div#menubox div.menu01 div.menu_1 a').addClass('active');
        arsoaMenuboxStretch(168, 30);
        arsoaImageSwap('div#menubox div.menu01 div.menu_12 a', urlRootPath +'image/sidemenu_ph02_12_act.png', '企業情報', 237, 25);
        break;
      case 21:
        arsoaImageSwap('div#menubox div.menu02 div.menu_2 a', urlRootPath +'image/sidemenu_ph01_2_act.png', '製品情報', 237, 30);
        $('div#menubox div.menu02 div.menu_2 a').addClass('active');
        arsoaMenuboxStretch(30, 130);
        arsoaImageSwap('div#menubox div.menu02 div.menu_21 a', urlRootPath +'image/sidemenu_ph02_21_act.png', '製品一覧', 237, 25);
        break;
      case 22:
        arsoaImageSwap('div#menubox div.menu02 div.menu_2 a', urlRootPath +'image/sidemenu_ph01_2_act.png', '製品情報', 237, 30);
        $('div#menubox div.menu02 div.menu_2 a').addClass('active');
        arsoaMenuboxStretch(30, 262);
        arsoaImageSwap('div#menubox div.menu02 div.menu_22 a', urlRootPath +'image/sidemenu_ph02_22_act.png', 'スキンケア', 237, 25);
        break;
      case 23:
        arsoaImageSwap('div#menubox div.menu02 div.menu_2 a', urlRootPath +'image/sidemenu_ph01_2_act.png', '製品情報', 237, 30);
        $('div#menubox div.menu02 div.menu_2 a').addClass('active');
        arsoaMenuboxStretch(30, 130);
        arsoaImageSwap('div#menubox div.menu02 div.menu_23 a', urlRootPath +'image/sidemenu_ph02_23_act.png', 'メイクアップ', 237, 25);
        break;
      case 24:
        arsoaImageSwap('div#menubox div.menu02 div.menu_2 a', urlRootPath +'image/sidemenu_ph01_2_act.png', '製品情報', 237, 30);
        $('div#menubox div.menu02 div.menu_2 a').addClass('active');
        arsoaMenuboxStretch(30, 130);
        arsoaImageSwap('div#menubox div.menu02 div.menu_24 a', urlRootPath +'image/sidemenu_ph02_24_act.png', 'ヘアケア＆ボディケア', 237, 25);
        break;
      case 25:
        arsoaImageSwap('div#menubox div.menu02 div.menu_2 a', urlRootPath +'image/sidemenu_ph01_2_act.png', '製品情報', 237, 30);
        $('div#menubox div.menu02 div.menu_2 a').addClass('active');
        arsoaMenuboxStretch(30, 130);
        arsoaImageSwap('div#menubox div.menu02 div.menu_25 a', urlRootPath +'image/sidemenu_ph02_25_act.png', 'ヘルスケア', 237, 25);
        break;
      case 26:
        arsoaImageSwap('div#menubox div.menu02 div.menu_2 a', urlRootPath +'image/sidemenu_ph01_2_act.png', '製品情報', 237, 30);
        $('div#menubox div.menu02 div.menu_2 a').addClass('active');
        arsoaMenuboxStretch(30, 130);
        arsoaImageSwap('div#menubox div.menu02 div.menu_26 a', urlRootPath +'image/sidemenu_ph02_26_act.png', '浄水器', 237, 25);
        break;
    }
  });
}

/* ########## arsoaMenuboxStretch ##########
  U: arsoaMenuboxStretch(argHeight1, argHeight2, argHeight3)
  D: メニュー開閉アニメーションのラッパー。
  I: jquery-1.5.1.min.js
  I: jquery.easing.1.3.js
  A: argHeight1 ... 「アルソアについて」高さ
  A: argHeight2 ... 「製品情報」高さ
*/
function arsoaMenuboxStretch(argHeight1, argHeight2){
  $('div#menubox div.menu01').animate({
    height: argHeight1 +'px',
    top: '164px'
  }, 750, 'easeOutExpo');
  $('div#menubox div.menu02').animate({
    height: argHeight2 +'px',
    top: (argHeight1 +165) +'px'
  }, 750, 'easeOutExpo');
}

/* ########## arsoaBannerSetup ##########
  U: $.arsoaBannerSetup(argVariation)
  D: バナーの配置。
  I: jquery-1.5.1.min.js
  I: arsoaHeaderSetup()
  A: argVariation ... バナー表示パターン(1-2)
*/
$.fn.arsoaBannerSetup =function(argVariation){
  $(this).html('\
<div class="banner01"><a href="'+ urlDirectPathSsl +'question/sample"><img src="'+ urlRootPath +'image/banner_ph01.jpg" alt="ArsoaQueenSilver - サンプルのお申込みはコチラ" width="237" height="85"/></a><br/></div>\n\
<div class="banner02"><a href="'+ urlDirectPath +'nemunoki/"><img src="'+ urlRootPath +'image/banner_ph02.jpg" alt="ねむの樹ファンクラブ - 様々な企画と会員限定の特典などをご用意しています" width="237" height="55"/></a><br/></div>\n\
<div class="banner03"><a href="http://www.arsoa.net/"><img src="'+ urlRootPath +'image/banner_ph03.jpg" alt="ARSOA studio" width="237" height="55"/></a><br/></div>\n\
<div class="banner04"><img src="'+ urlRootPath +'image/banner_ph04.jpg" alt="アルソアモバイルサイト - 商品情報をはじめ、様々なコンテンツを掲載しています。" width="237" height="80"/><br/></div>\n\
');
  $(this).find('div.banner01 a').hover(function(){
    $(this).find('img').attr({'src': urlRootPath +'image/banner_ph01_on.jpg'});
  }, function(){
    $(this).find('img').attr({'src': urlRootPath +'image/banner_ph01.jpg'});
  });
  $(this).find('div.banner02 a').hover(function(){
    $(this).find('img').attr({'src': urlRootPath +'image/banner_ph02_on.jpg'});
  }, function(){
    $(this).find('img').attr({'src': urlRootPath +'image/banner_ph02.jpg'});
  });
  $(this).find('div.banner03 a').hover(function(){
    $(this).find('img').attr({'src': urlRootPath +'image/banner_ph03_on.jpg'});
  }, function(){
    $(this).find('img').attr({'src': urlRootPath +'image/banner_ph03.jpg'});
  });
}

/* ########## arsoaFooterSetup ##########
  U: $.arsoaFooterSetup()
  D: フッターの配置。
  I: jquery-1.5.1.min.js
  I: arsoaHeaderSetup()
*/
$.fn.arsoaFooterSetup =function(){
  $(this).html('\
<div class="copyright"><img src="'+ urlRootPath +'image/ph07.gif" alt="COPYRIGHT(C)2003-2011 ARSOA HONSHA CORPORATION ALL RIGHTS RESERVED." width="334" height="7"/><br/></div>\n\
');
}

/* ########## arsoaFooterSetup ##########
  U: $.arsoaToPageTopSetup()
  D: 「ページの先頭へ戻る」ボタンを配置。
  I: jquery-1.5.1.min.js
  I: jquery.scrollTo-min.js
  I: jquery.easing.1.3.js
  I: arsoaHeaderSetup()
*/
$.fn.arsoaToPageTopSetup =function(){
  $(this).css({'position': 'relative'});
  $(this).append('\
<div class="topagetop"><a><img src="'+ urlRootPath +'image/topagetop.gif" alt="To Page Top" width="98" height="23"/></a><br/>\n\
</div>\n\
');
  $(this).find('div.topagetop').css({
    'position': 'absolute',
    'bottom': 0,
    'right': 0,
    'zIndex': 100
  });
  if($.browser.msie && $.browser.version <7) $(this).find('div.topagetop').css('bottom', '4px');
  $(this).find('div.topagetop').css({
    'cursor': 'pointer'
  });
  $(this).find('div.topagetop a').hover(function(){
    $(this).find('img').attr({'src': urlRootPath +'image/topagetop_on.gif'});
  }, function(){
    $(this).find('img').attr({'src': urlRootPath +'image/topagetop.gif'});
  });
  $(this).find('div.topagetop a').click(function(){
    $.scrollTo('0px', 750, {'axis': 'y', 'easing':'easeOutExpo'});
  });
}

/* ########## arsoaImageRollOverSetup ##########
  U: $.arsoaImageRollOverSetup()
  D: 対象アンカー内のimgをロールオーバー化する。
  I: jquery-1.5.1.min.js
  I: jquery.scrollTo-min.js
  I: jquery.easing.1.3.js
  I: arsoaHeaderSetup()
*/
$.fn.arsoaImageRollOverSetup =function(){
  $(this).hover(function(){
    $(this).find('img').attr('src',
$(this).find('img').attr('src').replace(/\.(gif|jpe?g|png)$/, '_on.$1'));
  }, function(){
    $(this).find('img').attr('src',
$(this).find('img').attr('src').replace(/_on\.(gif|jpe?g|png)$/, '.$1'));
  });
  $(this).click(function(){
    $(this).find('img').attr('src',
$(this).find('img').attr('src').replace(/_on\.(gif|jpe?g|png)$/, '.$1'));
  });
}

