/* 詳細表示制御 */
$(document).ready(function(){
	$('.detailafter, .detailbefore').click(
		function() {
			if ($('a', this).length == 1) {
				if (this.className == 'detailafter') {
					$(this).empty();
					$('.detailbefore').append('<a href="javascript:void(0);"></a>');
					//$('<a href="javascript:void(0);></a>').appendTo('.detailbefore');
					$('#after-image').show();
					$('#before-image').hide();
					$('#after-image-comment').show();
					$('#before-image-comment').hide();
				}
				else {
					$(this).empty();
					$('.detailafter').append('<a href="javascript:void(0);"></a>');
					//$('<a href="javascript:void(0);></a>').appendTo('.detailafter');
					$('#after-image').hide();
					$('#before-image').show();
					$('#after-image-comment').hide();
					$('#before-image-comment').show();
				}
			}
			return false;
		}
	);
	
	/*
	$('div.image-navi-beforebtn').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();
		}
	);
	*/
});

/* 画像の切り替え処理 */
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());
	$('#after-image-comment').css('padding', '0px ' + commentPadding + 'px')
	$('#before-image-comment').html($('#comment_1_' + index).html());
	$('#before-image-comment').css('padding', '0px ' + beforeCommentPadding + 'px')
	$('#after-image').css('padding', '0px ' + commentPadding + 'px')
	$('#before-image').css('padding', '0px ' + beforeCommentPadding + 'px')
	/*$('#before-photo-btn').css('margin', '0px ' + (commentPadding-440) + 'px')*/
	$('.detailafter').click();
}