﻿//for sitetop


/* -------------------------------------------------------------------
	* teaser
 ------------------------------------------------------------------- */
 

/* -------------------------------------------------------------------
	↓↓↓編集可能↓↓↓
 ------------------------------------------------------------------- */
 
//季節設定　「春」「夏」「秋」「冬」のいずれかを設定してください。
var setSeason = '冬'

/* -------------------------------------------------------------------
	↑↑↑編集可能↑↑↑
 ------------------------------------------------------------------- */




/* -------------------------------------------------------------------
	↓↓↓以下、編集を行わないでください↓↓↓
 ------------------------------------------------------------------- */



//変数定義
var swfSeason

if(setSeason == '春') {
	swfSeason = 'flash/haru_teaser.swf';
}
else if(setSeason == '夏') {
	swfSeason = 'flash/natsu_teaser.swf';
}
else if(setSeason == '秋') {
	swfSeason = 'flash/aki_teaser.swf';
}
else if(setSeason == '冬') {
	swfSeason = 'flash/huyu_teaser.swf';
}

 

//html処理前にコンテンツを消す
document.write('<style>#pageContainer{display:none;}</style>')


//cookieがなければFlash表示
//cookieがあればコンテンツ表示
$(function() {
	
	if (!($.cookie("appendFlashCookie"))) {
		appendFlash();
	}
	else if ($.cookie("appendFlashCookie")) {
		$("#pageContainer").css({ display:"block" });
	}
	
	//cookieを生成
	$.cookie("appendFlashCookie", "topFlash");
	
});


function appendFlash() {
	
	//Flash表示
	$("body").append('<div id="teaserFlashContents"></div>');
	$("#teaserFlashContents").css({ visibility:"visible" });

	// FlashParameters
	var params = {};
	swfobject.embedSWF(swfSeason, "teaserFlashContents", "100%", "100%", "9.0.0", "", "", params);
	
	//Flash100%表示のために必要
	$("html").css({ height:"100%" });
	$("body").css({ height:"100%" });
	
	//コンテンツ消す。
	$("#pageContainer").css({ display:"none" });
	
}


//request from Flash
function removeFlash() {
	
	$("#teaserFlashContents").css({ display:"none" });
	$("#pageContainer").css({ display:"block" });
	
	//for firefox3.6
	$("#footerLinks li:first a").focus();
	$("#footerLinks li:first a").blur();

}



/* -------------------------------------------------------------------
	* for swfobject
 ------------------------------------------------------------------- */
var flashvars = {};
var params = {
	menu: "false",
	scale: "noScale"
};
swfobject.embedSWF("flash/top.swf", "flashContents", "100%", "600px", "9.0.0.0", "flash/expressInstall.swf", flashvars, params);




/* -------------------------------------------------------------------
	* thumbnailImage for sitetop
 ------------------------------------------------------------------- */
$(function() {
		   
	if($('#sitetop').length){
		

		$('.thumbnailImage').hover( 
	
			function(){
			
				$(this).css('backgroundColor','#ffffff').fadeTo('fast', 0.8);
				$('a',this).css('borderColor','#615236');
				
				//IE6用記述
				if (jQuery.browser.msie && jQuery.browser.version == 6) {
					$('#contents').css('marginBottom','-24');
				}
				
			},
			function(){
				$(this).css('backgroundColor','#ffffff').fadeTo('fast', 1);
				$('a',this).css('borderColor','#aca180');
				
			});
		
	}
	
});
