var j$ = jQuery;

// スクロール
j$(function(){
     j$(".scroll").click(function(){
     j$('html,body').animate({ scrollTop: j$(j$(this).attr("href")).offset().top }, 'slow','swing');
     return false;
     })
});

/**
 * jQuery.rollover
 *
 * @version    1.0.4
 * @author     Hiroshi Hoaki <rewish.org@gmail.com>
 * @copyright  2010-2011 Hiroshi Hoaki
 * @license    http://rewish.org/license/mit The MIT License
 * @link       http://rewish.org/javascript/jquery_rollover_plugin
 */
jQuery.fn.rollover = function(suffix) {
	suffix = suffix || '_on';
	var check = new RegExp(suffix + '\\.\\w+$');
	return this.each(function() {
		var img = jQuery(this);
		var src = img.attr('src');
		if (check.test(src)) return;
		var _on = src.replace(/\.\w+$/, suffix + '$&');
		jQuery('<img>').attr('src', _on);
		img.hover(
			function() { img.attr('src', _on); },
			function() { img.attr('src', src); }
		);
	});
};

jQuery(document).ready(function($) {
	j$('a.rollOver img').rollover();
	j$('form input:image').rollover();
});

//フォントサイズ
jQuery(function($){
	var history = $.cookie('fontSize');
	var elm = $('#container');
	(!history)? elm.addClass('fontM'):elm.addClass(history);
	$('li','#fontChange').click(function(){
		var setFontSize = this.id;
		$.cookie('fontSize', setFontSize);
		elm.removeClass().addClass(setFontSize);
	});
});

// colorbox
j$(document).ready(function(){
	j$("a[rel='box']").colorbox();
});

//領域クリック
jQuery(function($){
	j$("div.indMn").click(function(){
		window.location=$(this).find("a").attr("href");
	});
	j$("div.indMn").hover(function(){
		j$(this).addClass("idMnHover");},
		function(){
		j$(this).removeClass("idMnHover");
		return false;
	});
});
