// jQuery Easing v1.3
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

$(document).ready(function() {
	
	var ch = $("#contents").height();
	
	if ($("#aside").height() < ch) {
		if ($("#page.top").size() != 0){
			ch -= $("#tabs-twin-detail").height();
			ch -= $("#tabs-restaurant-detail").height();
			ch -= $("#tabs-etc-detail").height();
		}
		$("#aside").height(ch);
	}
	
	// rollover
	$('.rollOver img').rollover('_over');
	$('.rollOver input:image').rollover('_over');
	
	// easingScroll
	$('a[href^="#"]').click(function() {
		$('html:animated, body:animated').queue('fx', []).stop();
		var targetOffset = 0;
		
		var targetId = $(this).attr("href");
		if (targetId != "#") {
			if (targetId.search(/^#tabs/i) == -1) {
				targetOffset = $(targetId).offset().top;
			} else {
				return false;
			}
		}
        $('html,body').animate({ scrollTop: targetOffset }, 500, 'easeOutQuart');
		return false;
	});

	// mouseWheel
	
	if (window.addEventListener) window.addEventListener('DOMMouseScroll', wheel, false);
	window.onmousewheel = document.onmousewheel = wheel;
	
	// bigTarget
	
	$(".big-target h4 a").bigTarget({
		hoverClass: 'over',
		clickZone : 'li:eq(0)'
	}).css("cursor","pointer");
	
});

function wheel()
{
	$('html:animated, body:animated').queue('fx', []).stop();
}

