$(function() {

	$('#up a, #faqList a, #faq p.return a').click(function(){

		$('html, body').animate({ scrollTop: $($(this).attr('href')).offset().top }, 'slow','swing');
		return false;

	});

	$('#tNav li a').hover(function(){

		$(this).stop().animate({'opacity' : '0'}, 500);

	},function(){

		$(this).stop().animate({'opacity' : '1'}, 500);

	});
	
	$('.linkBox').click(function(){

		window.location=$(this).find('a').attr('href');
		return false;

	});

	$('.pfFoot a, .sCont a img, .exBox img, a img').hover(function(){
		
		$(this).stop().fadeTo('fast',0.75);
			
	},function(){
			
		$(this).stop().fadeTo('fast',1);
			
	});
	
	$('a[rel*=facebox]').facebox({

		loadingImage : 'http://sk-house.co.jp/img/facebox/loading.gif',
		closeImage   : 'http://sk-house.co.jp/img/facebox/closelabel.png'

	});
	
	$('.tglBox').each(function(a){
		
		if($.cookie('tglcookie')){

			if(($.cookie('tglcookie').indexOf(a)) != -1 ){

				$('.tglBox').eq(a).show();

			}else{

				$('.tglBox').eq(a).hide();

			}

		}else{

			$('.tglBox').hide();

		}
		a = a+1;

	});

	$('.tglBtn').click(function(){

		var b = $('.tglBtn').index(this);
		var c = 'tglcookie';
		var d = $.cookie(c);
	
		$('.tglBox').eq(b).slideToggle('fast');

		if($.cookie(c)){

			if((d.indexOf(b)) != -1){

				if(($.cookie(c).length) == 1){

					$.cookie(c, null);

				}else{

					var d = $.cookie(c).replace(b, '');
					$.cookie(c, d, {expires:7, path: '/'});

				}

			}else{

				$.cookie(c, d+b, {expires:7, path: '/'});

			}

		}else{

			$.cookie(c, b, {expires:7, path: '/'});

		}

	}).css('cursor','pointer');

});

