function prepareGallery(){
	$('div.gallery div#imageContainer').show();

	$('div.gallery div.img_frame a').click(function(){
		changeImage(this);
		return false;
	});
	$('div.gallery div.img_frame').hover(
		function(){
			$(this).addClass('hover');
		},
		function(){
			$(this).removeClass('hover');
		}
	);
	var first_image = $('div.gallery div.img_frame a:first').get();
	if (first_image) {
		changeImage(first_image);
	}
}

function changeImage(el){
	var img_src = $(el).attr('href');
	var img_title = $(el).attr('title');
	if (!img_src){
		return;
	}

	$('#imageContainer').hide();
/*
	$('#imageInfo').hide();
	$('#loading').show();
*/

	$('div.gallery div.img_frame').removeClass('active');
	$(el).parent().addClass('active');
/*
	$('#imageInfo').html($(el).parent().parent().find('.description').html());
*/

	imgPreloader = new Image();
	imgPreloader.onload=function(){
		document.getElementById('galleryImage').src = img_src;
		document.getElementById('galleryImage').title = img_title;
		$('#imageContainer').show('fast');
/*
		$('#imageInfo').show('fast');
		$('#loading').hide();
*/
		imgPreloader.onload=function(){};	//	clear onLoad, IE behaves irratically with animated gifs otherwise
	}
	imgPreloader.src = img_src;
}
