/* ================================================================ 
This copyright notice must be untouched at all times.

The original version of this script and the associated (x)html
is available at http://www.stunicholls/gallery/left_right_click.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This script and the associated (x)html may be modified in any 
way to fit your requirements.
=================================================================== */

var hideme = null;
clickMenu = function(gallery) 
	{
	var getImg = document.getElementById(gallery).getElementsByTagName("IMG");
	var getLi = document.getElementById(gallery).getElementsByTagName("LI");

	var image_cont = document.getElementsByClassName("image_container");
	for (var x=0; x<image_cont.length; x++) {
				/*image_cont[0].addClassName("display");*/
				image_cont[0].setStyle({'display': 'block'});
			}
				
	for (var j=0; j<image_cont.length; j++) {
			$(getLi[j]).onclick=function() {
				for (var x=0; x<image_cont.length; x++) {
					if ((image_cont[x].className.indexOf('display'))!=-1)	{
						image_cont[x].className=image_cont[x].className.replace("display", "");
					}
					image_cont[x].setStyle({'display': 'none'});
				}
			this.down(2).setStyle({'display': 'block'});
			hideme = this.down(2);
			Stop();
			}
		}	
			
}

restartGallery = function () {
	if (hideme) hideme.fade({duration: 1.5});
	$(image_slide[i]).appear({duration: 1.5});
}
