﻿


$(function(){
	
	//▼ 動画・写真一覧ページの.xThumbBoxの高さを揃える ▼//
	$(".xThumbBox").each(function() {
		var array1 = new Array();
		var array2 = new Array();
		
		$(this).find(".xThumb").each(function() {
			array1.push(this);
			if (array1.length == 6) {
				array2.push(array1);
				array1 = [];
			}
		});
		if(array1.length) {
			array2.push(array1);
		}
		
		$.each(array2, function() {
			$(this).flatHeights();
		});
	});
	//▲ 動画・写真一覧ページの.xThumbBoxの高さを揃える ▲//
	
	/*
	//▼ ロールオーバー（後でオブジェクト化したい） ▼//
	//画像のプリロード
	var preLoadedImages = new Array();
	function preLoadImage(url) {
		var l = preLoadedImages.length;
		preLoadedImages[l] = new Image();
		preLoadedImages[l].src = url;
	};

	$(".xSwapImg").hover(function() {
		$(this).find("img").each(function() {
			this.src = this.src.replace(/(\.gif|\.jpg|\.png)/, "_ov"+"$1");
		});
	},function() {
		$(this).find("img").each(function() {
			this.srcArr = this.src.split("_ov");
			this.src = this.srcArr[0] + this.srcArr[1];
		});
	});
	*/
	
		//this.originalSrc = this.src;
		//this.rolloverSrc = this.originalSrc.replace(/(\.gif|\.jpg|\.png)/, "_ov"+"$1");
		//preLoadImage(this.rolloverSrc);
		
		/*
		$(this.parentNode).hover(function() {
			this.src = this.rolloverSrc;
			console.info(this);
		},function() {
			this.src = this.originalSrc;
		});
		*/
	/*
	}).hover(function() {
		this.src = this.rolloverSrc;
	},function() {
		this.src = this.originalSrc;
	*/
	
	
	
	/*
	$(".xSwapImg").each(function() {
		$(this).find("img").each(function() {
			this.originalSrc = this.src;
			this.rolloverSrc = this.originalSrc.replace(/(\.gif|\.jpg|\.png)/, "_ov"+"$1");
			preLoadImage(this.rolloverSrc);
		});
	}).hover(function() {
		$(this).find("img").each(function() {
			this.src = this.rolloverSrc;
		});
	},function() {
		$(this).find("img").each(function() {
			this.src = this.originalSrc;
		});
	*/
	
	
	
	//▲ ロールオーバー ▲//
	
});

