/*マウスオーバー時のフェードインアウト効果 */
$(function () {
	$('.post-header_blog img').hover(function() {
		$(this).fadeTo("fast", 0.7);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
});
$(function () {
	$('.post-header_blog2 img').hover(function() {
		$(this).fadeTo("fast", 0.7);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
});
$(function () {
	$('.post-header img').hover(function() {
		$(this).fadeTo("fast", 0.7);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
});
$(function () {
	$('.main_conte_sidebar img').hover(function() {
		$(this).fadeTo("fast", 0.7);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
});
$(function () {
	$('input').hover(function() {
		$(this).fadeTo("fast", .9);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
});
$(function () {
	$('.go_detai_items').hover(function() {
		$(this).fadeTo("fast", .7);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
});
$(function () {
	$('.read_more').hover(function() {
		$(this).fadeTo("fast", .7);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
});
$(function () {
	$('.liste_now').hover(function() {
		$(this).fadeTo("fast", .7);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
});
$(function () {
	$('.gigs img').hover(function() {
		$(this).fadeTo("fast", .7);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
});
$(function () {
	$('#footer_in img').hover(function() {
		$(this).fadeTo("fast", .7);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
});

/*iPhone delete toolbar */
window.addEventListener('load', function() {
    setTimeout(scrollTo, 0, 0, 1);
}, false);

/*Login menu */
$(document).ready(function(){
	$(".logslide").click(function(){
		$(".infos").toggle();
	});
});

/*Mega menu */
$(document).ready(function(){
	$(".downservices").click(function(){
		$(".servicesdropped").toggle();
	});
});

/*ページ読み込み時の自動フェードイン効果
$(document).ready(function(){
	$(".main_conte_items img").css({opacity: 0});
	$(".main_conte_items img").fadeTo("slow", 1); 
});
*/

/*トップページのmarquee効果（上下左に文字が流れる効果） */
$(function(){
	/* 例2 */
	$("#marquee2").marquee({yScroll: "bottom"});
	});
	var iNewMessageCount = 0;
	function addMessage(selector){
	iNewMessageCount++;
	var $ul = $(selector).append("<li>New message #" + iNewMessageCount + "</li>");
	// update the marquee
	$ul.marquee("update");
	}
	function pause(selector){
	$(selector).marquee('pause');
	}
	function resume(selector){
	$(selector).marquee('resume');
}

/*ヘッダ・メニューバーがウィンドウスクロール時に自動的にフェードアウトして隠れる効果
$(document).ready(function() {
	(function() {
	//settings
	var fadeSpeed = 150, fadeTo = 0.1, topDistance = 1;
	var topbarME = function() { $('#header').fadeTo(fadeSpeed,1); }, topbarML = function() { $('#header').fadeTo(fadeSpeed,fadeTo); };
	var inside = false;
	//do
	$(window).scroll(function() {
	position = $(window).scrollTop();
	if(position > topDistance && !inside) {
	//add events
	topbarML();
	$('#header').bind('mouseenter',topbarME);
	$('#header').bind('mouseleave',topbarML);
	inside = true;
	}
	else if (position < topDistance){
	topbarME();
	$('#header').unbind('mouseenter',topbarME);
	$('#header').unbind('mouseleave',topbarML);
	inside = false;
	}
	});
	})();
});  
*/     
        
/*トップページのメイン画像スライドショー効果*/
$(document).ready(function() {
	$('.top_poster').cycle({
		fx:     'fade', 
		speed:   500, 
		timeout: 5000, 
		next:   '.top_poster', 
		pause:   1 
	});
			
	$(".thumb-container").hover(function(){
	$(this).children("span.thumb-bg").fadeTo("fast", 0);
	$(this).children("span.thumb-type").fadeTo("slow", 1);
	
	},function(){
	$(this).children("span.thumb-bg").fadeTo("slow", 1);
	$(this).children("span.thumb-type").fadeTo("fast", 0);
	
	});
});

        
/*商品詳細ページでサブ画像をクリック時の画像切り替え表示効果*/
$(document).ready( function() {
	$(".itemsubimg a")
	// 読み込み時
	.fadeTo(5,1)
	
	// マウスオーバー・マウスアウト時
	.hover( 
	function(){// マウスオーバー時
	$(this).fadeTo(300, 1);
	},
	function(){// マウスアウト時
	$(this).fadeTo(500, 1);
	}
	)
	// クリック時の処理
	.click( function() {
	var changeSrc = $(this).attr("href");
	$(".itemimg img").fadeOut(
	"fast",
	function() {
	$(this).attr("src", changeSrc);
	$(this).fadeIn();
	});
	return false;
	});
});
