/*
 * js.js - 生命保険比較イズム
 * Copyright (c) 2011 Webcrew Agency Inc. All rights reserved. 
 */

/*--------------------------------------------------------
onLoad
--------------------------------------------------------*/
$(document).ready(function(){

  // 別ウィンドウで開く設定
  $("a.blank").click(function(){
      window.open($(this).attr("href"), "_blank");
      return false;
  });

  // ポップアップで開く設定
  $("a.popup01").click(function(){
      window.open($(this).attr("href"), "terms", "toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=520,height=500,left=0,top=0");
      return false;
  });

  // ロールオーバー設定
  $("img.rollover").mouseover(function() {
    if (! $(this).parent().parent().attr("className").match("currentPage"))
      $(this).attr("src", ($(this).attr("src")).replace("_off.", "_on."));
  });
  $("img.rollover").mouseout(function() {
    if (! $(this).parent().parent().attr("className").match("currentPage"))
      $(this).attr("src", ($(this).attr("src")).replace("_on.", "_off."));
  });

  // ブロック要素の高さ揃える設定
  if (jQuery.fn.flatHeights) {
    $("div#content div#contentsLink ul li p.cnt").flatHeights();  
    $("div#content div#contentsLink ul li").flatHeights();  
    $("div#content div#media ul li").flatHeights();
  }

  // イージングの設定
  jQuery.easing.easeOutCubic = function (x, t, b, c, d) {
    return c*((t=t/d-1)*t*t + 1) + b;
  };

  // アンカー設定
  $("body").each(function()  {
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$("i.j a[5=\'#\']",3).k(6(e){2 a=3.5;2 b=7;2 c=(!3.4||3.4=="#")?$("8"):$(3.4);2 d=(c.l("m")=="n")?0:c.o().p-q;2 f=$(r).9();2 g=$(s).9();h(g-d<f)d=g-f;$("t, 8").u({v:d},w,\'x\',6(){h(d>0&&!b){c.y("z",{A:"#B",C:1},D);b=E}});F 7});',42,42,'||var|this|hash|href|function|false|body|height||||||||if|ul|pageNav|click|attr|tagName|BODY|offset|top|20|window|document|html|animate|scrollTop|2000|easeOutCubic|effect|highlight|color|99FFFF|times|2500|true|return'.split('|'),0,{}))
  });

});

