/* ---------------------------------------------------------------
	
	メニュースライドin
		
--------------------------------------------------------------- */

$(function(){
/* config - commentOut to Off */

//	enableFlash();
//	enablePNG ();

	
	switch($('body').attr('id')){
		case '':
			$('#mainmenu').articleMOVE();
			break;
	}
});

//articleMOVE
$.fn.articleMOVE = function(){
	var count = this.length;
	var time = 200;
	var moveTime = 3000;
	var distance = 1000;
	var holder = this;
	var i = 0;
	holder.css({'bottom':distance, 'opacity':0});
	setTimeout(function move(){
		if (!(i < count)) return;
		holder.eq(i).animate({'bottom':0, 'opacity':1}, moveTime, 'jswing');
		i ++;
		setTimeout(move, time);
	}, time);
}

/* ---------------------------------------------------------------
	
	お菓子ボタン
		

$(function() {
	var num = 1;
	$('#nav1 li.fresh')
	//マウスオーバー画像を配置
	.each(function(){
		$(this).css('background', 'url(/images/home/btn-fresh.png) no-repeat 0px 0px ')
		num++;
	})
	.find('img').hover(
		function(){  
			$(this).stop().animate({'opacity' : '0'}, 500);  
		},
		function(){
			$(this).stop().animate({'opacity' : '1'}, 1000);
		}
	); 
});

$(function() {
	var num = 1;
	$('#nav1 li.baked')
	//マウスオーバー画像を配置
	.each(function(){
		$(this).css('background', 'url(/images/home/btn-baked.png) no-repeat 0px 0px')
		num++;
	})
	.find('img').hover(
		function(){  
			$(this).stop().animate({'opacity' : '0'}, 500);  
		},
		function(){
			$(this).stop().animate({'opacity' : '1'}, 1000);
		}
	); 
});
--------------------------------------------------------------- */
/* ---------------------------------------------------------------
	
	フェイドイン
		
--------------------------------------------------------------- */

$('head').append('<style type="text/css">#windowFade{display:block;height:' + $(window).height() + 'px}</style>');
function windowFade(){
	$('#windowFade').each(function(){
		$('#windowFade').fadeOut(500).height($('body').height());
		/*$('a').click(function(){
			var url = $(this).attr('href');
			if( this.href.match(location.hostname) && $(this).attr("href").charAt(0) != "#" && !$(this).attr("rel") && !$(this).attr("target") ){
				var LinkURL = $(this).attr("href");
				$('#windowFade').fadeIn(500,function(){
					location.href = LinkURL;
				});
				return false;
			}
		});*/
	});
};
window.onload = function() {
	windowFade();
};
window.onunload = function() {
	windowFade();
};

/* ---------------------------------------------------------------
	
	アニメーション
		
--------------------------------------------------------------- */
