

/*	マウスオーバー
----------------------------------------------------*/

/*$(document).ready(function(){
		   $("ul.side_Bn a").hover(on,off);
		   
		   function on(){
				$(this).fadeTo(200,0.8);
			
			}
		   function off(){
			   	$(this).fadeTo(200,1);
				
			}
  
     });



*/










/*	ドロップダウンメニュー
----------------------------------------------------*/


$(document).ready(function(){
	$("ul.reformset p").hide();
	$("ul.reformset li").hover(function(){
		$("p:not(:animated)",this).slideDown("fast")
	  },
	  function(){
		  $("p",this).slideUp("fast");
	});
});
 
 
/*	スライドパネル
----------------------------------------------------*/

 
 $(document).ready(function() {	

	//Get the height of the first item
	$('#mask').css({'height':$('#panel-1').height()});	
	
	//Calculate the total width - sum of all sub-panels width
	//Width is generated according to the width of #mask * total of sub-panels
	$('#panel').width(parseInt($('#mask').width() * $('#panel div').length));
	
	//Set the sub-panel width according to the #mask width (width of #mask and sub-panel must be same)
	$('#panel div').width($('#mask').width());
	
	//Get all the links with rel as panel
	$('a[rel=panel]').click(function () {
	
		//Get the height of the sub-panel
		var panelheight = $($(this).attr('href')).height();
		
		//Set class for the selected item
		$('a[rel=panel]').removeClass('selected');
		$(this).addClass('selected');
		
		//Resize the height
//		$('#mask').animate({'height':panelheight},{queue:false, duration:500});			
		
		//Scroll to the correct panel, the panel id is grabbed from the href attribute of the anchor
		$('#mask').scrollTo($(this).attr('href'), 600);		
		
		//Discard the link default behavior
		return false;
	});
	
});


/*	ページトップスクロール
----------------------------------------------------*/


$(function () {
						$('.page-top').css("cursor","pointer"); 

    if (! $.browser.safari) {
        $('.page-top').click(function () {
            $(this).blur();

            $('html,body').animate({ scrollTop: 0 }, 'normal');

            return false;
        });
    }
});




/*	クッキー
----------------------------------------------------*/





/*	文字サイズ変更
----------------------------------------------------*/


$(function($){
    //変数にクッキー名を入れる
    var history = $.cookie('fontSize');
	
    //適用する箇所を指定。今回は部分的に#test内のpに
    var elm = $('body');
	
    //変数が空ならfontMを、空でなければクッキーに保存しておいたものを適用
    (!history)? elm.addClass('fontM'):elm.addClass(history);
	
    //クリックしたら実行
    $('li','.text-change').click(function(){
	
        //クリックした要素のID名を変数にセット
        var setFontSize = this.id;
	    
        //クッキーに変数を保存
    	$.cookie('fontSize', setFontSize);
		
        //一度classを除去して、変数をclassとして追加
        elm.removeClass().addClass(setFontSize);
    });
});


