

/**
 * Class for Mini Gallery
 * Gallery is made up of thumbnails and one large image. This image
 * is replaced as the user mouses over each thumbnail with the large
 * version of the thumbnails. A preloader is shown as the image loads
 *
 * @param div_name Id of <div> containing large image
 * @param base_path Relative path to large images for this gallery
 *
 * @constructor
 */
 
 function BR_MiniGallery(img_name, div_name, pre_div_name, base_path) {
 	this.image_name = img_name;
	this.img_div_name = div_name;
	this.preloader = document.getElementById(pre_div_name);
	this.base_path = base_path;
	this.img_container = document.getElementById(div_name);
	this.loader = '';
 };
 
 /**
 * This function initialise the gallery and loads the first image
 *
 * @param path Full path to large image to show
 */
 
 BR_MiniGallery.prototype.showLarge = function(filename) {
	eval("document." + this.image_name + ".src = '" + this.base_path + filename + "';");
	//this.img_container.innerHTML = '<img onload="javascript: MiniGallery.showPreloader();" src="' + this.base_path + num + '.jpg" />';
 };

 /**
 * This function initialise the gallery and loads the first image
 */
 
 BR_MiniGallery.prototype.showPreloader = function() {
 	clearInterval(this.loader);
	this.preloader.style.display = 'none';
 	this.loader = setInterval(this, "runLoader()", 20);
 };

 /**
 * This function initialise the gallery and loads the first image
 */
 
 BR_MiniGallery.prototype.runLoader = function() {
	this.preloader.style.display = 'block';
	this.preloader.innerHTML = 'loading...';
 };
 
 
 