/*
 * Copyright (c) DESIGN inc. All Rights Reserved.
 * http://www.design-inc.jp/
 *
 */

jQuery(function($){
	
	// liとtrの奇数・偶数・最初・最後にクラス付与（odd, even, first, last）
	$('li:nth-child(odd), tr:nth-child(odd)').addClass('odd');
	$('li:nth-child(even), tr:nth-child(even)').addClass('even');
	$('li:first-child, tr:first-child').addClass('first');
	$('li:last-child, tr:last-child').addClass('last');
	
	// ページ内スクロール
	$('a.scroll').click(function(){
		$('html,body').animate({scrollTop: $($(this).attr('href')).offset().top }, {'duration': 400, 'easing': 'easeOutCubic'});
		return false;
	});
	
	// 外部リンクに「target="_blank"」付与（クラス「a.noblank以外」）
	$('a[href^=http]').not('[href*="'+location.hostname+'"]').not('a.noblank').attr('target', '_blank');
	
	// jquery.rollOver.js
	$.fn.rollOver({
		animateTime: 300,
		fadeOpacity: 0.7,
		easing: 'easeOutCubic'
	});
	
	// jquery.cross-slide.min.js
	if($('#cross-slide').length){
		$('#cross-slide').crossSlide({
			sleep: 2,
			fade: 1
		}, [
			{ src: '/uploader/data/p1.jpg' },
			{ src: '/uploader/data/p2.jpg' },
			{ src: '/uploader/data/p3.jpg' },
			{ src: '/uploader/data/p4.jpg' },
			{ src: '/uploader/data/p5.jpg' },
			{ src: '/uploader/data/p6.jpg' }
		]);
	}
	
	// fixHeight.js
	$('.fixHeight').fixHeight();
	
	// タブ切り替え
$(document).ready(function() {
$(".tab_content, .tab_content2").hide(); //Hide all content
$("ul.tabs li:last, ul.tabs2 li:last").addClass("active").show(); //Activate first tab
$(".tab_content:first, .tab_content2:first").show(); //Show first tab content

//On Click Event
$("ul.tabs li").click(function() {
$("ul.tabs li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content

var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active ID content
return false;
});


//On Click Event
$("ul.tabs2 li").click(function() {
$("ul.tabs2 li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content2").hide(); //Hide all tab content

var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active ID content
return false;
});
});


});
