
		/* ------------------------------- GALLERY TOY ----------------------------- */

		function GalleryStart() {
			SwapText("gallerythumbs", "");
			SwapText("gallerycontent", "");
			var theForm = document.frmTitles.id.value;
			theArray = theForm.split("-");
			var theID = theArray[0];
			var theType = theArray[1];
			if (theID > 0) {
				switch (theType) {
					case "0":
						GetItem("../modules/moGalleryFirstPic.php?id=" + theID + "&r=" + Math.random(), "gallerycontent", "");
						GetItem("../modules/moGalleryThumbs.php?id=" + theID + "&r=" + Math.random(), "gallerythumbs", "");
						break;
					case "1":
						GetItem("../modules/moGalleryVids.php?id=" + theID + "&r=" + Math.random(), "gallerycontent", "");
				}
			}
		}

		function GalleryGetPic(pic, picW, picH, maxW, maxH) {
			var popW = picW;
			var popH = picH;
			picW = (picW - 0);
			picH = (picH - 0);
			maxW = (maxW - 0);
			maxH = (maxH - 0);
			var ratio = (picH / picW);
			var orient = "width";
			if (picH > picW) {
				orient = "height";
			}
			switch (orient) {
				case "width":
					if (picW > maxW) {
						picW = maxW;
					}
					var theDim = picW;
					picH = Math.round(picW * ratio);
					if (picH > maxH) {
						picH = maxH;
						theDim = picH;
						orient = "height";
					}

					break;
				case "height":
					if (picH > maxH) {
						picH = maxH;
					}
					var theDim = picH;
			}

			if (orient == "height") {
				var capW = maxW;
			} else {
				var capW = picW;
			}

			var theStuff = "<table cellpadding=\"0\" cellspacing=\"2\"><tr><td class=\"galThumb\">";
			theStuff += "<img src=\"../uploads/" + pic + "\" " + orient + "=\"" + theDim + "\" onClick=\"DoBox('../uploads/" + pic + "', '" + popW + "', '" + popH + "', '30', '30');\" onMouseOver=\"this.className='miscHandOn';\" onMouseOut=\"this.className='';\">";
			theStuff += "</td></tr></table>";
			theStuff += "<table width=\"" + capW + "\" cellpadding=\"0\" cellspacing=\"2\"><tr><td><div id=\"caption\"></div></td></tr></table>";
			theStuff += "<table cellpadding=\"0\" cellspacing=\"2\"><tr><td><img src=\"../graphics/spacer.gif\" width=\"" + maxW + "\" height=\"1\"></td></tr></table>";
			SwapText("gallerycontent", theStuff);
			GetItem("../modules/moGalleryCaption.php?pic=" + pic + "&r=" + Math.random(), "caption", "");
		}

