function show(id) {
		var e = document.getElementById(id).style.display='block';
}
	function hide(id) {
		var e = document.getElementById(id).style.display='none';
}

function expand_collapse(number)
{
 div = document.getElementById("div_" + number);
 img = document.getElementById("img_" + number);
 if (div.style.display == 'none')
 {
   div.style.display = 'block';
   img.src = "/anniversary/lib/img/minus.gif";
 }
 else if (div.style.display == 'block')
 {
   div.style.display = 'none';
   img.src = "/anniversary/lib/img/plus.gif";
 }
}

function collapse(number)
{
 div = document.getElementById("div_" + number);
 img = document.getElementById("img_" + number);
 if (!(div && img)) return false;
 div.style.display = 'none';
 img.src = "/anniversary/lib/img/plus.gif";
}

function expand(number)
{
 div = document.getElementById("div_" + number);
 img = document.getElementById("img_" + number);
 if (!(div && img)) return false;
 div.style.display = 'block';
 img.src = "/anniversary/lib/img/minus.gif";
}

function collapse_all()
{
 collapse(0);
 collapse(1);
 collapse(2);
 collapse(3);
 collapse(4);
 collapse(5);
 collapse(6);
 collapse(7);
 collapse(8);
 collapse(9);
 collapse(10);
 collapse(11);
 collapse(12);
 collapse(13);
 collapse(14);
 collapse(15);
 collapse(16);
 collapse(17);
 collapse(18);
 collapse(19);
 collapse(20);
 collapse(21);
 collapse(22);
 collapse(23);
 collapse(24);
 collapse(25);
 collapse(26);
}

function expand_all()
{
 expand(0);
 expand(1);
 expand(2);
 expand(3);
 expand(4);
 expand(5);
 expand(6);
 expand(7);
 expand(8);
 expand(9);
 expand(10);
 expand(11);
 expand(12);
 expand(13);
 expand(14);
 expand(15);
 expand(16);
 expand(17);
 expand(18);
 expand(19);
 expand(20);
 expand(21);
 expand(22);
 expand(23);
 expand(24);
 expand(25);
 expand(26);
}

clickMenu = function(gallery) 
	{
	var getImg = document.getElementById(gallery).getElementsByTagName("IMG");
	var getLi = document.getElementById(gallery).getElementsByTagName("LI");

	for (var i=0; i<getImg.length; i++) {
			getImg[i].onclick=function() {
			if ((this.className.indexOf('left'))!=-1) {
				for (var x=getLi.length-1; x>0; x--) {
					if ((getLi[x].className.indexOf('chosen'))!=-1)	{
						getLi[x].className=getLi[x].className.replace("chosen", "");
						x--;
						if (x>-1) {
							getLi[x].className+=" chosen";
								if (x>-1 && x<getLi.length-5){
								getLi[x].className=getLi[x].className.replace("hide", "");
									if ((getLi[x+5].className.indexOf('hide'))==-1)
									{
										getLi[x+5].className+=" hide";
									}
								}
							}
						}
					}
				}

			if ((this.className.indexOf('right'))!=-1) {
				for (var x=0; x<getLi.length-1; x++) {
					if ((getLi[x].className.indexOf('chosen'))!=-1)	{
						getLi[x].className=getLi[x].className.replace("chosen", "");
						x++;
						if (x<getLi.length) {
							getLi[x].className+=" chosen";
								if (x>4 && x<getLi.length) {
								getLi[x].className=getLi[x].className.replace("hide", "");
									if ((getLi[x-5].className.indexOf('hide'))==-1)
									{
										getLi[x-5].className+=" hide";
									}
								}
							}
						}
					}
				}
			}
		}


		for (var i=0; i<getLi.length; i++) {
			getLi[i].onclick=function() {
				for (var x=0; x<getLi.length; x++) {
					if ((getLi[x].className.indexOf('chosen'))!=-1)	{
						getLi[x].className=getLi[x].className.replace("chosen", "");
					}
				}
			this.className+=" chosen";		
			}
		}
	}
