function loadGallery()
{
  // Put some feedback for the user so that he knows it starts loading...
  // 1. Display the loading mask
  fadeIn('soulmate_gallery_loading_mask');
  // 2. Display the actual wrapper container
  fadeIn('soulmate_gallery_wrapper');

  // Get the argument and use it as an URI
  if(arguments[0])
  {
    var galleryURL = _galleriesRepository + arguments[0];
    // Retrieve the html page of the given URI
    var req = new Request.HTML({url:galleryURL,
		onSuccess: function(html) {
                        // Clear the mask
                        fadeOut('soulmate_gallery_loading_mask');
			//Clear the text currently inside the results div.
			$('soulmate_gallery_container').set('text', '');
			//Inject the new DOM elements into the results div.
			$('soulmate_gallery_container').adopt(html);
			soulmate_flow_page.start();
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
                        // Clear the mask
                        fadeOut('soulmate_gallery_loading_mask');
			$('soulmate_gallery_container').set('text', 'Unable to load the gallery. Please contact the webmaster (contact@soulmatemusic.fr)');
		}
	});
	req.send();
 }

}

function unloadGallery()
{
   fadeOut('soulmate_gallery_wrapper');
   // Re-activate the loading mask
   fadeIn('soulmate_gallery_loading_mask');

}



