jQuery(function($) {
	//common
	$(window).load(function() {
		if($('.twoColumnL #leftColumn').innerHeight() < $('.twoColumnL #rightColumn').innerHeight()) {
			$('.twoColumnL #leftColumn').css({
				'height':$('.twoColumnL #rightColumn').innerHeight()
			});
		};
		if($('.twoColumnR #rightColumn .lowerSection').size() > 0) {
			if($('.twoColumnR #rightColumn').innerHeight() < $('.twoColumnR #leftColumn').innerHeight()) {
				$('.twoColumnR #rightColumn .lowerSection').css({
					'height':$('.twoColumnR #leftColumn').innerHeight()
				});
			};
		};
		if($('.detailColumn #centerColumn').size() > 0) {
			if($('.detailColumn #centerColumn').innerHeight() < $('.detailColumn #leftColumn').innerHeight()) {
				$('.detailColumn #centerColumn').css({
					'height':$('.detailColumn #leftColumn').innerHeight()
				});
			};
		};
	});
	//LINK
	if(!$('#infoListSec,#blogListSec').size() > 0) {
	$('.linkBox').each(function() {
		$(this).hover(function() {
			$(this).stop(true,true).animate({ opacity:0.8 }, 500);
		},function() {
			$(this).stop(true,true).animate({ opacity:1 }, 500);
		});
	});
	};
	$('.linkBox').click(function() {
		//リンクが外部のとき
		if($(this).find('a').attr('target') == '_blank') {
			window.open($(this).find('a').attr('href'),'_blank');
			return false;
		} else {
			window.location = $(this).find('a').attr('href');
			return false;
		};
	});
	
	//rollover
	$('.gather img, .btn').overHandler();
	
	//alpha
	$('.alphaGaz a img, .alphaBtn').each(function() {
		$(this).hover(function() {
			$(this).stop(true,true).animate({ opacity:0.8 }, 500);
		},function() {
			$(this).stop(true,true).animate({ opacity:1 }, 500);
		});
	});
	
	//aq
	$(document).everyTime(5000, 'aqTimer', function() {
		$('li#aqTglBtn span:first-child').stop(true,true).fadeToggle(800,function() {
			$(this).css('filter','');
		});
	});
	
	//blog
	$(window).load(function() {
		//mainvisual
		if($('#mainVisual').size() > 0) {
			$('ul#visualBlogArea .box').each(function() {
				$('ul#visualBlogArea .blogToggleArea').each(function() {
					$(this).css({ bottom:-$(this).innerHeight() });
				});
				$(this).hover(function() {
					$('.blogToggleArea',this).stop(true,true).animate({ bottom:0 }, 300);
				},function() {
					$('.blogToggleArea',this).stop(true,true).animate({ bottom:-$('.blogToggleArea',this).innerHeight() }, 300);
				});
				$(this).click(function() {
					if($(this).find('a').attr('target') == '_blank') {
						window.open($(this).find('a').attr('href'),'_blank');
						return false;
					} else {
						window.location = $(this).find('a').attr('href');
						return false;
					};
				});
			});
	
		  	$('#mainVisual').galleryView({
		  		border:'none',
		  		background_color:'none',
		  		pause_on_hover:true,
		  		show_panel_nav:false
		  	});
		};
	});
	
	//search
	$('p#freeword input',this).focus(function() {
		if($(this).val() == $(this).prop('defaultValue')) {
			$(this).val('');
		};
	}).blur(function() {
		if(jQuery.trim($(this).val()) == '') {
			$(this).val($(this).prop('defaultValue'));
		};
	});
	
	//toggle archive
	if($('ul.toggleArchive').size() > 0) {
		$('ul.toggleArchive li.tParent').each(function(){
			$(this).click(function() {
				$('ul',this).stop(true,true).slideToggle().parent().siblings().children("ul:visible").slideToggle();
				$(this).toggleClass('tOpen').siblings().toggleClass('tOpen');
				if($(this).siblings().hasClass('tOpen')) {
					$(this).siblings().removeClass('tOpen');
				};
			});
		});
	};

	//shop
	if($('ul#secPhotos').size() > 0) {
		$('ul#secPhotos').innerfade({ 
			speed: 1000,
			timeout: 4000,
			type: 'sequence',
			containerheight: '343px'
		});
	};

});

