var number_of_pictures = 5; 

function show_pictures () {
	var while_pictures = 1;
	while(while_pictures <= number_of_pictures) {
		var new_image = new Element('img', {
			'src': 'images/thumbs/' + while_pictures + '.jpg',
			'id': 'image_' + while_pictures,
			'events': {
				'click': function(){
					$('display_picture_img').innerHTML = "<img src=\"" + this.src.replace('images/thumbs/', 'images/pics/') + "\" id=\"big_picture\" class=\"" + this.id + "\" />";
					$('display_picture').fade(1);
					$('big_picture').fade('hide');
					$('big_picture').fade(1);
				}
			}
		});

		new_image.inject($('inside'));
		var preload_image = new Element('img', {
			'src': 'images/pics/' + while_pictures + '.jpg',
			'class': 'hide'
		});
		preload_image.inject($('container'));
		while_pictures++;
	}

}
window.addEvent('domready', function() {	
	show_pictures();
	$('big_picture').fade('hide');
	$('big_picture').fade(1);
});