jQuery.noConflict();
jQuery().ready(function() {
	jQuery('#coda-slider-1').codaSlider({
		autoHeight: false,
		dynamicArrows: false,
		dynamicTabs: true,
		dynamicTabsAlign: "left",
		dynamicTabsPosition: "bottom",
		autoSlide: true,
		autoSlideInterval: 5000,
		autoSlideStopWhenClicked: true,
		slideEaseDuration: 500
	});
});

jQuery(function(){
	jQuery(window).bind("load", function(){
		// 中央トリミング処理1
		jQuery('div[class="item1"] img:first-child').each(function(){
			if (jQuery(this).height() <= 95) {
				jQuery(this).css("top", "0px");
				jQuery(this).css("clip", "rect(0px 167px " + jQuery(this).height() + "px 72px)");
			} else {
				var tsize = (jQuery(this).height() / 2 - 48);
				var bsize = tsize + 95;
				jQuery(this).css("top", "-" + tsize + "px");
				jQuery(this).css("clip", "rect(" + tsize + "px 167px " + bsize + "px 72px)");
			}
		});
		// 中央トリミング処理2
		jQuery('div[class="clip2"] img:first-child').each(function(){
			if (jQuery(this).height() <= 95) {
				jQuery(this).css("top", "0px");
				jQuery(this).css("clip", "rect(0px 175px " + jQuery(this).height() + "px 0px)");
			} else {
				var tsize = (jQuery(this).height() / 2 - 48);
				var bsize = tsize + 95;
				jQuery(this).css("top", "-" + tsize + "px");
				jQuery(this).css("clip", "rect(" + tsize + "px 175px " + bsize + "px 0px)");
			}
		});
	});
});

jQuery(function(){
	jQuery("#top4").hide();
	jQuery("#top3").hide();
	jQuery("#top2").hide();

	jQuery("#top1").hover(function(){
		//mouseover
		jQuery("#top1").hide();
		jQuery("#top2").show();
		jQuery(this).oneTime(1500, function(){
			jQuery("#top3").fadeIn();
			jQuery("#top4").fadeIn();
		});
	}, function() {
		//mouseout
	});

	jQuery("#top2").hover(function(){
		//mouseover
	}, function() {
		//mouseout
		jQuery("#top4").hide();
		jQuery("#top3").hide();
		jQuery("#top2").hide();
		jQuery("#top1").show();
	});
});

function setSearch() {
	navClicks++;
	jQuery("#topmain").css("width", "760px");
}

function dispTitle_over(objid) {
	var idx = objid.replace("item1_","");
	//mouseover
	jQuery("#" + objid).oneTime(100, function(){
		jQuery("#item2_" + idx).fadeIn();
		jQuery("#item3_" + idx).fadeIn();
	});
}

function dispTitle_out(objid) {
	var idx = objid.replace("item1_","");
	//mouseout
	jQuery("#" + objid).oneTime(100, function(){
		jQuery("#item2_" + idx).fadeOut();
		jQuery("#item3_" + idx).fadeOut();
	});
}

jQuery(function(){
	var imgMax  = 7; // 画像枚数
	var imgRand = Math.floor(Math.random() * imgMax) + 1
	jQuery("#top1").html('<img src="/image/top' + imgRand + '.gif" border="0" />');
});
