/**
 * @name main.js
 * @fileOverview
 * @version 1.1
 * @description
 * <p>(c) FOURDIGIT Inc. Licensed <a href="http://ja.wikipedia.org/wiki/GNU_General_Public_License">GNU General Public License</a>.</p>
 */

//他ライブラリと共存する場合、下の一行コメントアウト解除($無効化)
//jQuery.noConflict();

/**
 * config
 */
(function($){
	$(function() {
	//bodyのクラスにブラウザ情報を追加
		$.addClassUA();
	//easyOverのターゲット設定
		$("input.ahover, img.ahover, .ahoverArea img").easyOver();
	//IE5,6にてPNG有効化
		$.autoEnablePNG();
	//Flash
		//$("object, embed").enableFlash();
  //HTML5タグ有効化
  	//$.enableHTML5();
	//ポップアップリンクに置換
		$(".commonPop").easyPop();
	//他ドメインリンク時にpageTracker有効化
		//$("a,area").blankLogToGoogle();
	//アンカーリンクをスムージング
		$("a[href^=#]").smoothScroll();
	//対象の要素をスクロールに追従するようにする
		//$("#fixBox").fixPosition("stopperID","normal");
	//対象の要素がopenerを判別して挙動を変える
		//$("a.moveOpener, area.moveOpener").moveOpener();
	//heightline
	  $(".separator").each(function(){
	    //$(this).heightline(".box");
	  });
	});
})(jQuery);

(function($){
  $(function(){

    var COOKIE_CODE = "font-size";

    $(".fontSize")
      .find(".font-s a").click(function(){
        $("body").removeClass("font-m font-l normal").addClass("font-s");
        $.cookie(COOKIE_CODE, "font-s", { expires: 30, path: '/' });
        return false;
      }).end()
      .find(".font-m a").click(function(){
        $("body").removeClass("font-s font-l normal").addClass("font-m");
        $.cookie(COOKIE_CODE, "font-m", { expires: 30, path: '/' });
        return false;
      }).end()
      .find(".font-l a").click(function(){
        $("body").removeClass("font-s font-m normal").addClass("font-l");
        $.cookie(COOKIE_CODE, "font-l", { expires: 30, path: '/' });
        return false;
      }).end()
    ;

      if(/^font-[sml]$/.test($.cookie(COOKIE_CODE))){
        $(".fontSize ."+$.cookie(COOKIE_CODE)+" a").click();
      }

    $("#Nav a")
      .mouseover(function(){
        $(this).addClass("hover");
        $(this).find("span").enablePNG();
      })
      .mouseout(function(){
        $(this).removeClass("hover");
      })
    ;
  });
})(jQuery);
