jQuery.fn.changePicture = function(picid){
  var newPicture = new Image();
  newPicture.onload = function(){
    $('#picture_container img').fadeOut('normal', function(){ $(this).attr('src', newPicture.src); }).fadeIn('normal');
  }

	newPicture.src = $('#'+ picid +'_path').attr('value');
	return this;
}
$(document).ready(function(){
	$('#gallery img').click(function(){
		$(this).changePicture( $(this).attr('id') );
		return false;
	});
});