
/* ロールオーバー（ウィンク）↓↓↓↓↓↓↓↓↓↓
=========================================================== */

$(function(){
	$("img.wink").hover(function(){
		$(this).css("opacity", "0.2");
		$(this).css("filter", "alpha(opacity=20)");
		$(this).fadeTo("slow", "1.0");
	});
});


$(function(){
	$("#gallery-list img").hover(function(){
		$(this).css("opacity", "0.2");
		$(this).css("filter", "alpha(opacity=20)");
		$(this).fadeTo("slow", "1.0");
	});
});


/* ===========================================================
 　ロールオーパー（ウィンク）↑↑↑↑↑↑↑↑↑↑ */


/* フォントサイズ変更↓↓↓↓↓↓↓↓↓↓
=========================================================== */

$(document).ready(function() {
	var bodyClass = 'font';
	var switchClass = 'fontChange';
	var startClass = "Small";
	var activeClass = 'active';

	// クッキーを読み込む
	var value = $.cookie('fontSize');

	if ( value ) {
		$("body").addClass(bodyClass + value);
		$(".fontChanger ." + switchClass + value).addClass(activeClass);
	} else {
		$("body").addClass(bodyClass + startClass);
		$(".fontChanger ." + switchClass + startClass).addClass(activeClass);
	}

	$(".fontChanger span").click( function() {
		value = $(this).attr("class").replace(switchClass, '');

		// bodyに付いているフォントサイズ調整用のクラスを削除
		$("body").removeClass(bodyClass + "Normal").removeClass(bodyClass + "Small").removeClass(bodyClass + "Large");

		// 新たにフォントサイズ調整用のクラスを追加
		$("body").addClass(bodyClass + value);
		$(".fontChanger span").removeClass(activeClass);

		// 押したボタンにクラスを追加
		$(".fontChanger ." + switchClass + value).addClass(activeClass);

		// クッキーに保存
		$.cookie('fontSize', value);

	});
});


/* ===========================================================
 　フォントサイズ変更↑↑↑↑↑↑↑↑↑↑ */




/* スムーズスクロール↓↓↓↓↓↓↓↓↓↓
=========================================================== */


$(function(){
   // #で始まるアンカーをクリックした場合に処理
   $('a[href^=#]').click(function() {
      // スクロールの速度
      var speed = 600;// ミリ秒
      // アンカーの値取得
      var href= $(this).attr("href");
      // 移動先を取得
      var target = $(href == "#" || href == "" ? 'html' : href);
      // 移動先を数値で取得
      var position = target.offset().top;
      // スムーススクロール
      $($.browser.safari ? 'body' : 'html').animate({scrollTop:position}, speed, 'swing');
      return false;
   });
});



/* ===========================================================
 　スムーズスクロール↑↑↑↑↑↑↑↑↑↑ */




/* GoogleAnalytics↓↓↓↓↓↓↓↓↓↓
=========================================================== */

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-25421385-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


/* ===========================================================
 　GoogleAnalytics↑↑↑↑↑↑↑↑↑↑ */

