﻿/* テーマリフォーム制御 */
$(document).ready(function(){
	$('div#before-photo-btn').hover(
		function() {
			$('#after-image').hide();
			$('#before-image').show();
			$('#after-image-comment').hide();
			$('#before-image-comment').show();
		},
		function() {
			$('#after-image').show();
			$('#before-image').hide();
 			$('#after-image-comment').show();
			$('#before-image-comment').hide();
		}
	);
	
	if ($("#imageroll > ul > li").size() > 5)
		liCount = 5;
	else
		liCount = $("#imageroll > ul > li").size();
	
	$("#imageroll").jCarouselLite({
		btnNext: "#rollbtnright",
		btnPrev: "#rollbtnleft",
		mouseWheel: true,
		visible: liCount
	});

});

/* 画像の切り替え処理 */
function changeImage(index, image, beforeImage, commentPadding, beforeCommentPadding)
{
	$('#after-image > img').attr('src', image);
	//$('#after-image > img').attr('alt', comment);
	$('#before-image > img').attr('src', beforeImage);
	//$('#before-image > img').attr('alt', beforeComment);
	$('#after-image-comment').html($('#comment_0_' + index).html());
	$('#before-image-comment').html($('#comment_1_' + index).html());
	$('#after-image').css('padding', '0px ' + commentPadding + 'px')
	$('#before-image').css('padding', '0px ' + beforeCommentPadding + 'px')
	$('#before-photo-btn').css('margin', '10px ' + (commentPadding-430) + 'px')
}
