
//コンテンツｻｲｽﾞ調整用　変数セット
var wWidth;
var contentWidth;
var resizeWidth;
var bodyClass = $("body").attr("class");


//＊＊＊＊＊＊読み込み時実行
$(function () {

//contentsのサイズ調整																									
contentResize()

//ページ内スクロール実行　下りはうまくいかない？
$("a[href*='#']").easingScroll({
  easing: "easeOutQuint",
  duration: 1500
});

//いいねボタンのキャッチマーク用アニメーション実行
new03BtnAnime()

//Cardの整列指示
$(".listBox01").vgrid({
		easeing: "easeOutQuint",
		useLoadImageEvent: true,
		useFontSizeListener: true, 
		time: 500,
		delay: 20,
		fadeIn: {
		time: 600,
		delay: 50
		}
});

//a拡張　リンクボックスセット
$('.bigger').biggerlink();


//rightBoxの年別アーカイブの開閉用記述
$("ul.mothe").hide();
$("ul.contentNaviMenuYearList li.firstChild ul.mothe").slideDown();
$("div.year").click(function(){
$("ul.mothe").slideUp();
$("div.year").removeClass("open");
if($("+ul",this).css("display")=="none"){
	$("+ul",this).slideDown();
	$(this).addClass("open");
}
});

$( document ).ready( function () {
	$( '#topBtn' ).scrollFollow( {
		//アニメーションの速度の設定。0 にするとアニメーションなしになります。
		speed: 500,
		//ブラウザの領域とフロート要素との余白。0にするとぴったりくっつきます。
		offset: 30
	} );
		$( '#rightBox' ).scrollFollow( {
		//アニメーションの速度の設定。0 にするとアニメーションなしになります。
		speed: 500,
		contener: 'Contener',
		//ブラウザの領域とフロート要素との余白。0にするとぴったりくっつきます。
		offset: 30

	} );
} );


});



//＊＊＊＊＊＊ウインドウサイズ変更時実行
$(window).resize(function(){
																									
//contentsのサイズ調整
contentResize();

});



//＊＊＊＊＊＊ちょっと特殊な実行（実際は読み込み時から常時作動）
//読み込み時、およびウインドウサイズ変更時にカードが切れるのを防止・常時作動中 かなり無理やり、重けりゃ外せ
$(function() {
$('.listBox01').css( 'overflow','visible');
$('#contents').css( 'overflow','visible');
var interval = 0;
setInterval(function(){
$('.listBox01').css( 'overflow','visible');
$('#contents').css( 'overflow','visible');
}, interval);
});	




//＊＊＊＊＊＊ここから関数


//contentsのサイズとマージン調整用　関数
function contentResize(){
if( $("body").attr("class") == "concept" || $("body").attr("class") == "news" || $("body").attr("class") == "member" || $("body").attr("class") == "service" || $("body").attr("class") == "contact" || $("body").attr("class") == "company" || $("body").attr("class") == "sitemap"){

	
//contentsのサイズ調整 ウインドウサイズから左右の余白引いた分
wWidth = $(window).width();
contentWidth = $('#contents').width();
resizeWidth = wWidth-250;

}else{
	
	
//contentsのサイズ調整 ウインドウサイズから左右の余白引いた分
wWidth = $(window).width();
contentWidth = $('#contents').width();
resizeWidth = wWidth-120-250;

}

if( wWidth > 1200 ){
	
if( $("body").attr("class") == "staffblog" ){
$('#contents').animate("margin-left",260);
$('#contents').css("margin-left",260);
$('#contents').css("width",resizeWidth);	

}else{
	
//windowのサイズが1200px以上なら左マージンを260に増やす＆コンテンツサイズ調整
$('#contents').animate("margin-left",260);
$('#contents').css("margin-left",260);
$('#contents').css("width",resizeWidth);	
}


}else{

//windowのサイズが1200px以下なら左マージンは250のまま、もしくは減らす
$('#contents').animate("margin-left",250);
$('#contents').css("margin-left",250);

if( wWidth > 980){
//windowのサイズが1200以下800px以上なら実行
$('#contents').css("width",resizeWidth);	
}else{
	
//windowのサイズが800px以下なら実行
$('#contents').css("width",610);
};



};





}


//いいねボタンの横につけるアイコンアニメーション用関数
function new03BtnAnime(){
var interval = 5000;

$(".new03")
.animate({top:"5px"}, 300)
.animate({top:"-8px"}, 200)
.animate({top:"-3px"}, 100)
.animate({top:"-5px"}, 80);

setInterval(function(){
$(".new03")
.animate({top:"5px"}, 300)
.animate({top:"-8px"}, 200)
.animate({top:"-3px"}, 100)
.animate({top:"-5px"}, 80)
}, interval);
};
