var hTimer=-1;
function membersOpen() {
	window.clearTimeout(hTimer);
	hTimer=-1;
	$('div.inner').animate({'margin-top':'-240px'}, 500, function(){hTimer=window.setTimeout("memLink()",2000);});
}
function cornerOpen() {
	window.clearTimeout(hTimer);
	hTimer=-1;
	$('div.inner').animate({'margin-top':'-480px'}, 500, function(){hTimer=window.setTimeout("shopLink()",2000);});
}
function infoOpen() {
	window.clearTimeout(hTimer);
	hTimer=-1;
	$('div.inner').animate({'margin-top':'-720px'}, 500, function(){hTimer=window.setTimeout("infoLink()",2000);});
}
function clearFc() {
	window.clearTimeout(hTimer);
	hTimer=-1;
	$('div.inner').animate({'margin-top':'0'}, 500);
}

function memLink(){
	location.href = "/members/";
}
function shopLink(){
	location.href = "/corners/";
}
function infoLink(){
	location.href = "/information/index.php";
}

function slideSwitch() {
	var $active = $('#imgTop a.active');
	if ( $active.length == 0 ) $active = $('#imgTop a:last');
	var $next =  $active.next().length ? $active.next() : $('#imgTop a:first');
	$active.addClass('last-active');
	$next.css({opacity: 0.0})
	.addClass('active')
	.animate({opacity: 1.0}, 1000, function() {
		$active.removeClass('active last-active');
	});
}
$(function() {
	setInterval( "slideSwitch()", 5000 );
});

$(function(){
	$("div.pullon").hide();
	$(".pullArea .pulloff a").click(function(){
		$(".pullArea div.pulloff").hide();
		$("div.pullon").show();
		$("ul.sub:not(:animated)").slideDown();
	});
});
$(function(){
	$(".pullArea .pullon a").click(function(){
		$(".pullArea div.pulloff").show();
		$("div.pullon").hide();
		$("ul.sub:not(:animated)").slideUp();
	});
});



window.addEventListener('load', function () {
	setTimeout(doScroll, 100);
}, false);

window.onorientationchange = function() {
	setTimeout(doScroll, 100);
};

function doScroll() {
	if (window.pageYOffset === 0) {
		window.scrollTo(0, 1);
	}
}
