$(document).ready(function(){
	if($('#pict-child'))
	{
   		jQuery.each($('#pict-child'), function(){
            $(this).find('img').bind("click", function(e){
                var child_alt = $(this).attr("alt");
                var child_title = $(this).attr("title");
                var child_src = $(this).attr("src");
                
				$('#pict-main .sum').empty();
				$('#pict-main .sum').prepend($(this).parent().next('input').val());

                var new_src = child_src.replace(/.thumbnail/i, ".main story");

                $('#pict-main img').attr({
                    alt: child_alt,
                    title: child_title,
                    src: new_src
                });
			});
		});
	}
});



