$(function(){
/* ¡¡¡¡¡¡ ƒgƒbƒvƒMƒƒƒ‰ƒŠ[ƒZƒbƒg ¡¡¡¡¡¡ */
galleryLI = new Array();
$('.media_list').each(function(i){
galleryLI[i] = $(this).find('li');
$(this).find('li').on('click', function(){
$('.popup figure').html( $(this).html() );
$('.popup').fadeIn(300);
nowIndex = $(this).index();
nowgallery = i;
});
});
$('.popup .next').on('click', function(){
nowIndex++;
if( nowIndex >= galleryLI[nowgallery].length ) nowIndex = 0;
$('.popup figure').fadeOut(200);
setTimeout("$('.popup figure').html( galleryLI[" + nowgallery + "].eq(" + nowIndex + ").html() )",200);
setTimeout("$('.popup figure').fadeIn(200)",201);
});
$('.popup .prev').on('click', function(){
nowIndex--;
if( nowIndex < 0 ) nowIndex = galleryLI[nowgallery].length - 1;
$('.popup figure').fadeOut(200);
setTimeout("$('.popup figure').html( galleryLI[" + nowgallery + "].eq(" + nowIndex + ").html() )",200);
setTimeout("$('.popup figure').fadeIn(200)",201);
});
$('.popup .close, .popup').on('click', function(){
$('.popup').fadeOut(300);
});
$('.popup > div').on('click', function(e){
e.stopPropagation();
});
});