function ImageGallery (name, mouseRightUpSrc, mouseRightUpOverSrc, mouseRightDownSrc, mouseLeftUpSrc, mouseLeftUpOverSrc, mouseLeftDownSrc)
{
	//alert("ENTER::ImageGallery()");
	
	
	this.List = new Array();
	this.List[name] = new Array ()	;
	this.List[name]["imageList"] = new Array ();
	this.List[name]["imageList"].length = 1;
	this.List[name]["mouseRightUp"]     = new Image();
	this.List[name]["mouseRightUpOver"] = new Image();
	this.List[name]["mouseRightDown"]   = new Image();
	this.List[name]["mouseRightUp"].src     = mouseRightUpSrc;
	this.List[name]["mouseRightUpOver"].src = mouseRightUpOverSrc;
	this.List[name]["mouseRightDown"].src   = mouseRightDownSrc;
	
	this.List[name]["mouseLeftUp"]     = new Image();
	this.List[name]["mouseLeftUpOver"] = new Image();
	this.List[name]["mouseLeftDown"]   = new Image();
	this.List[name]["mouseLeftUp"].src     = mouseLeftUpSrc;
	this.List[name]["mouseLeftUpOver"].src = mouseLeftUpOverSrc;
	this.List[name]["mouseLeftDown"].src   = mouseLeftDownSrc;

	this.List[name]["counter"] = 1;
	this.addImage2Gallery = addImage2Gallery;
	this.addGallery = addGallery;

}

function addGallery (name, mouseRightUpSrc, mouseRightUpOverSrc, mouseRightDownSrc, mouseLeftUpSrc, mouseLeftUpOverSrc, mouseLeftDownSrc)
{
	//alert("ENTER::addImage2Gallery ()");
	
	this.List[name] = new Array();
	this.List[name]["imageList"] = new Array ();
	this.List[name]["imageList"].length = 1;
	this.List[name]["mouseRightUp"]     = new Image();
	this.List[name]["mouseRightUpOver"] = new Image();
	this.List[name]["mouseRightDown"]   = new Image();
	this.List[name]["mouseRightUp"].src     = mouseRightUpSrc;
	this.List[name]["mouseRightUpOver"].src = mouseRightUpOverSrc;
	this.List[name]["mouseRightDown"].src   = mouseRightDownSrc;
	
	this.List[name]["mouseLeftUp"]     = new Image();
	this.List[name]["mouseLeftUpOver"] = new Image();
	this.List[name]["mouseLeftDown"]   = new Image();
	this.List[name]["mouseLeftUp"].src     = mouseLeftUpSrc;
	this.List[name]["mouseLeftUpOver"].src = mouseLeftUpOverSrc;
	this.List[name]["mouseLeftDown"].src   = mouseLeftDownSrc;

	this.List[name]["counter"] = 1;
}


function addImage2Gallery (name, ImageSrc)
{
	//alert("ENTER::addImage2Gallery ()");
	
	this.List[name]["imageList"].length += 1;
	this.List[name]["imageList"][this.List[name]["imageList"].length-1] = new Image();
	this.List[name]["imageList"][this.List[name]["imageList"].length-1].src = ImageSrc;
}

function galleryOnMouseRightOver (name)
{
	if (document.images[name+"RightButton"])  document.images[name+"RightButton"].src =  Gallery.List[name]["mouseRightUpOver"].src;
	else alert ("Error: button image dosn't exist");
}

function galleryOnMouseRightOut (name)
{	
	//window.status = "Out";
	if (document.images[name+"RightButton"]) document.images[name+"RightButton"].src =  Gallery.List[name]["mouseRightUp"].src;
	else alert ("Error: button image dosn't exist");
}


function galleryOnMouseRightDown (name)
{
	if (document.images[name+"RightButton"]) 
 		{
			//alert("imageSrc= "+Gallery.List[name]["imageList"][Gallery.List[name]["counter"]].src);
			//alert("buttonSrc= "+Gallery.List[name]["mouseRightDown"].src);
			
 			document.images[name+"RightButton"].src =  Gallery.List[name]["mouseRightDown"].src;
			Gallery.List[name]["counter"] +=1;
 			if (Gallery.List[name]["counter"] >= Gallery.List[name]["imageList"].length) Gallery.List[name]["counter"] = 1;
			document.images[name].src = Gallery.List[name]["imageList"][Gallery.List[name]["counter"]].src;
	 	} 
	else alert ("Error: button image dosn't exist");
}


function galleryOnMouseRightUp (name)
{
	//window.status = "up";
	if (document.images[name+"RightButton"]) document.images[name+"RightButton"].src =  Gallery.List[name]["mouseRightUpOver"].src;
	else alert ("Error: button image dosn't exist");
}



function galleryOnMouseLeftOver (name)
{
	if (document.images[name+"LeftButton"])  document.images[name+"LeftButton"].src =  Gallery.List[name]["mouseLeftUpOver"].src;
	else alert ("Error: button image dosn't exist");
}

function galleryOnMouseLeftOut (name)
{	
	//window.status = "Out";
	if (document.images[name+"LeftButton"]) document.images[name+"LeftButton"].src =  Gallery.List[name]["mouseLeftUp"].src;
	else alert ("Error: button image dosn't exist");
}


function galleryOnMouseLeftDown (name)
{
	if (document.images[name+"LeftButton"]) 
 		{			
 			document.images[name+"LeftButton"].src =  Gallery.List[name]["mouseLeftDown"].src;
			Gallery.List[name]["counter"] -=1;
 			if (Gallery.List[name]["counter"] < 1) Gallery.List[name]["counter"] = Gallery.List[name]["imageList"].length-1;
			document.images[name].src = Gallery.List[name]["imageList"][Gallery.List[name]["counter"]].src;
	 	} 
	else alert ("Error: button image dosn't exist");
}


function galleryOnMouseLeftUp (name)
{
	//window.status = "up";
	if (document.images[name+"LeftButton"]) document.images[name+"LeftButton"].src =  Gallery.List[name]["mouseLeftUpOver"].src;
	else alert ("Error: button image dosn't exist");
}