$(function(){
	// for navigation
	$(".list  li:first").css("padding-top","0px");
	$(".list  li:first-child").css("padding-top","0px");
	$(".list  li:last-child").css("border-bottom","none");

	//for schedule
	$("#schedule h3.current").css("border-top","none");
	
	//for blog and schedule
	$("#blog .post-content .post:first-child h3.headline, #schedule h3.headline:first, .post-nav > h3.headline:first-child").css("border-top","none");

	//for item
	$("#item .post:last-child").css("border-bottom","none").css("padding-bottom","0px");
	$(".thumb .image ul li:last-child").css("padding-right","0px");
	

	//for mail
	$('.mail').each( function() {
		var e = $(this).html().split(' ').join('@');
		$(this).attr('href', 'mailto:' +e  ).html(e);
	});

	//for index
	$('ul#slide').innerfade({
		speed: 1000,
		timeout: 5000,
		type: 'random',
		containerheight: '420px'
	});

	$('a').hover(function() {
		$(this).stop(true, false).animate({
				opacity: .5
			}, {
				duration: 200
		});
	}, function() {
		$(this).stop(true, false).animate({
				opacity: 1
			}, {
				duration: 200
		});
	});
	

	//for fancybox
	$('a[href$=".jpg"], a[href$=".jpeg"], a[href$=".gif"], a[href$=".png"]').fancybox({ 'titleShow': false });

	//for calender
	$('.calendarTab_inner dl dt').each(function(){
		if($(this).text().indexOf('(Sat)') != -1 || $(this).text().indexOf('(Sun)') != -1) $(this).css("color","#f08080"); 
	});
	$('.calendarTab_inner dl dd').each(function(){
		if($(this).text().indexOf('定休') != -1 || $(this).text().indexOf('休廊') != -1　|| $(this).text().indexOf('臨時休業') != -1) {
			$(this).css('textAlign','center').css('color','#888');
		}
		if($(this).text().indexOf('調整中') != -1) {
			$(this).css('color','#888');
		}
	});
	$('.calendarTab_inner h1').css('marginTop', '-2px');
	
  $('#calendarBt').click(function(){ 
  	$('#calendarTab').animate({right: "0px"}, 500, "swing"); 
  	$('#calendarClose').animate({right: "305px"}, 500, "swing"); 
  });
  $('#calendarClose').click(function(){ 
		$('#calendarTab').animate({right: "-322px"}, 500, "swing"); 
		$('#calendarClose').animate({right: "-17px"}, 500, "swing"); 
	});
	

	$(window).load(function(){ $('#calendarTab').height( $(window).height()); });
	var resizeTimer = null;
	$(window).bind('resize', function() {
		if (resizeTimer) clearTimeout(resizeTimer);
		resizeTimer = setTimeout(function(){
			$('#calendarTab').height($(window).height());
		}, 10);
	});
});
