//マウスオーバーでpageNavi属性表示←title属性のテキストを<em></em>の中に格納。その後マウスオーバーしたら表示。
//$(document).ready(function(){

	//$("ul.pageNavi li a").append("<em></em>");
	
	//$("ul.pageNavi li a").hover(function() {
		//$(this).find("em").animate({opacity: "show", top: "-40"}, "slow");
		//var hoverText = $(this).attr("title");
	    //$(this).find("em").text(hoverText);
	//}, function() {
		//$(this).find("em").animate({opacity: "hide", top: "0"}, "fast");
	//});

//});



//マウスオーバーでimg要素を表示←<li>の中の<img>を見つけて、その後マウスオーバーしたら表示。

$(document).ready(function(){

	$("div#pageNavi ul li a img").hover(function() {
		//$(this).next("img").show();
		$(this).next("img.popup").animate({opacity: "show", top: "-52"}, "slow");
	}, function() {
		//$(this).next("img").hide();
		$(this).next("img.popup").animate({opacity: "hide", top: "-60"}, "slow");
	});

});

$(document).ready(function(){

	$("div#pageNavi ul li a img").hover(function() {
		//$(this).next("img").show();
		$(this).next("img.popup1").animate({opacity: "show", top: "-52"}, "slow");
	}, function() {
		//$(this).next("img").hide();
		$(this).next("img.popup1").animate({opacity: "hide", top: "-60"}, "slow");
	});

});

$(document).ready(function(){

	$("div#pageNavi ul li a img").hover(function() {
		//$(this).next("img").show();
		$(this).next("img.popup2").animate({opacity: "show", top: "-52"}, "slow");
	}, function() {
		//$(this).next("img").hide();
		$(this).next("img.popup2").animate({opacity: "hide", top: "-60"}, "slow");
	});

});


//サブメニュー展開
$(document).ready(function(){
	$("div#sideNavi ul li ul").css("display","none");
	$("div#sideNavi ul li.subContents").hover(function(){
		$("div#sideNavi ul li.subContents ul").show("slow");
		}, function() {
		$("div#sideNavi ul li.subContents ul").hide("slow");
		});
});


// imageのプリロード処理
var preloadImages = {
	preloader: {
		loadedImages: [],
		load: function (url){
			var img = this.loadedImages;
			var l = img.length;
			img[l] = new Image();
			img[l].src = url;
		}
	}
};

//ロールオーバー
$(function(){
	$('#wrap img').each(function(){
		this.originalSrc = $(this).attr('src');
		this.rolloverSrc = this.originalSrc.replace("_off.", "_on.");
		preloadImages.preloader.load(this.rolloverSrc);
	}).hover(function(){
		$(this).attr('src',this.rolloverSrc);
	},function(){
		$(this).attr('src',this.originalSrc);
	});
});
