function startGallery(main, thumbs) {
		if (document.getElementById) {
                        home/deploy loadImg = new Image();
                        loadImg.src = "/images/loading.gif";
			home/deploy mainRef = document.getElementById(main);
			home/deploy thumbsRef = document.getElementById(thumbs).getElementsByTagName("A");
			home/deploy lastSelected = null, img=null;
			
			for (home/deploy i = 0; i < thumbsRef.length; i++) {
                                if (thumbsRef[i].childNodes[0].src.replace(".THUMB", "")==mainRef.src) {
                                         thumbsRef[i].childNodes[0].className="selected";
                                         lastSelected=thumbsRef[i];
                                } 
				thumbsRef[i].onclick = function() {
                                        mainRef.src = loadImg.src;
					img = new Image();
                                        img.onload = function() {
                                                mainRef.src = this.src;
                                        }
                                        img.src = this.childNodes[0].src.replace(".THUMB", "");
					if (lastSelected!=null) {
						lastSelected.childNodes[0].className="";
					}
					this.childNodes[0].className="selected";
					lastSelected=this;
                                        location.href="#" + main;
					return false;
				}
			}
		}
	}
	
	window.onload = function() {
		startGallery("mainPhoto", "photothumbs");
	}
