function VisualLightbox(options) {
	var activeImage = null, badObjects = [ "select", "object", "embed" ], groupName = null, imageArray = [], slideShowTimer = null, startImage = null, descriptionHeight = 50, imgPreloader, resizeEffects, showTimer;
	if (!document.getElementsByTagName) {
		return;
	}
	options = $H( {
		animate : true,
		autoPlay : true,
		borderSize : 39,
		containerID : document,
		enableSlideshow : true,
		googleAnalytics : false,
		imageDataLocation : "south",
		closeLocation : "",
		initImage : "",
		loop : false,
		overlayDuration : 0.2,
		overlayOpacity : 0.7,
		prefix : "",
		classNames : "vlightbox",
		resizeSpeed : 7,
		showGroupName : false,
		slideTime : 4,
		strings : {
			closeLink : "",
			loadingMsg : "loading",
			nextLink : "",
			prevLink : "",
			startSlideshow : "",
			stopSlideshow : "",
			numDisplayPrefix : "",
			numDisplaySeparator : "/"
		},
		featBrowser : true,
		breathingSize : 20,
		startZoom : false,
		floating : true
	}).merge(options);
	if (options.animate) {
		var overlayDuration = Math.max(options.overlayDuration, 0);
		options.resizeSpeed = Math.max(Math.min(options.resizeSpeed, 10), 1);
		var resizeDuration = (11 - options.resizeSpeed) * 0.15;
	} else {
		var overlayDuration = 0;
		var resizeDuration = 0;
	}
	var enableSlideshow = options.enableSlideshow;
	options.overlayOpacity = Math.max(Math.min(options.overlayOpacity, 1), 0);
	var playSlides = options.autoPlay;
	var container = $(options.containerID);
	var classNames = options.classNames;
	updateImageList();
	var objBody = container != document ? container : document
			.getElementsByTagName("body").item(0);
	new Insertion.Top($(objBody), "<div></div>");
	objBody = objBody.childNodes[0];
	var objOverlay = document.createElement("div");
	objOverlay.setAttribute("id", getID("overlay"));
	objOverlay.style.display = "none";
	objBody.appendChild(objOverlay);
	Event.observe(objOverlay, "click", end.bindAsEventListener(this));
	var objLightbox = document.createElement("div");
	objLightbox.setAttribute("id", getID("lightbox"));
	objLightbox.style.display = "none";
	objBody.appendChild(objLightbox);
	Event.observe(objLightbox, "click", end.bindAsEventListener(this));
	var objImageDataContainer = document.createElement("div");
	objImageDataContainer.setAttribute("id", getID("imageDataContainer"));
	objImageDataContainer.className = getID("clearfix");
	var objImageData = document.createElement("div");
	objImageData.setAttribute("id", getID("imageData"));
	objImageDataContainer.appendChild(objImageData);
	var objImageDetails = document.createElement("div");
	objImageDetails.setAttribute("id", getID("imageDetails"));
	objImageData.appendChild(objImageDetails);
	var objCaption = document.createElement("div");
	objCaption.setAttribute("id", getID("caption"));
	objImageDetails.appendChild(objCaption);
	var objNumberDisplay = document.createElement("span");
	objNumberDisplay.setAttribute("id", getID("numberDisplay"));
	objImageDetails.appendChild(objNumberDisplay);
	var objDetailsNav = document.createElement("span");
	objDetailsNav.setAttribute("id", getID("detailsNav"));
	objImageDetails.appendChild(objDetailsNav);
	var objPrevLink = document.createElement("a");
	objPrevLink.setAttribute("id", getID("prevLinkDetails"));
	objPrevLink.setAttribute("href", "javascript:void(0);");
	objPrevLink.innerHTML = options.strings.prevLink;
	objDetailsNav.appendChild(objPrevLink);
	Event.observe(objPrevLink, "click", showPrev.bindAsEventListener(this));
	var objSlideShowControl = document.createElement("a");
	objSlideShowControl.setAttribute("id", getID("slideShowControl"));
	objSlideShowControl.setAttribute("href", "javascript:void(0);");
	objDetailsNav.appendChild(objSlideShowControl);
	Event.observe(objSlideShowControl, "click", toggleSlideShow
			.bindAsEventListener(this));
	var objNextLink = document.createElement("a");
	objNextLink.setAttribute("id", getID("nextLinkDetails"));
	objNextLink.setAttribute("href", "javascript:void(0);");
	objNextLink.innerHTML = options.strings.nextLink;
	objDetailsNav.appendChild(objNextLink);
	Event.observe(objNextLink, "click", showNext.bindAsEventListener(this));
	var objOuterImageContainer = document.createElement("table");
	objOuterImageContainer.setAttribute("id", getID("outerImageContainer"));
	objOuterImageContainer.cellSpacing = 0;
	objLightbox.appendChild(objOuterImageContainer);
	var objOICTop = objOuterImageContainer.insertRow(-1);
	var objOICTL = objOICTop.insertCell(-1);
	objOICTL.className = "tl";
	var objOICTC = objOICTop.insertCell(-1);
	objOICTC.className = "tc";
	var objOICTR = objOICTop.insertCell(-1);
	objOICTR.className = "tr";
	var objOICMiddle = objOuterImageContainer.insertRow(-1);
	var objOICML = objOICMiddle.insertCell(-1);
	objOICML.className = "ml";
	var objLightboxFrameBody = objOICMiddle.insertCell(-1);
	objLightboxFrameBody.setAttribute("id", getID("lightboxFrameBody"));
	objLightboxFrameBody.innerHTML = "&nbsp;";
	var objOICMR = objOICMiddle.insertCell(-1);
	objOICMR.className = "mr";
	var objOICBottom = objOuterImageContainer.insertRow(-1);
	var objOICBL = objOICBottom.insertCell(-1);
	objOICBL.className = "bl";
	var objOICBC = objOICBottom.insertCell(-1);
	objOICBC.className = "bc";
	var objOICBR = objOICBottom.insertCell(-1);
	objOICBR.className = "br";
	if (options.imageDataLocation == "north") {
		objLightboxFrameBody.appendChild(objImageDataContainer);
	}
	var objImageContainer = document.createElement("div");
	objImageContainer.setAttribute("id", getID("imageContainer"));
	objLightboxFrameBody.appendChild(objImageContainer);
	var objLightboxImage = document.createElement("img");
	objLightboxImage.setAttribute("id", getID("lightboxImage"));
	objImageContainer.appendChild(objLightboxImage);
	var objHoverNav = document.createElement("div");
	objHoverNav.setAttribute("id", getID("hoverNav"));
	objImageContainer.appendChild(objHoverNav);
	var objPrevLinkImg = document.createElement("a");
	objPrevLinkImg.setAttribute("id", getID("prevLinkImg"));
	objPrevLinkImg.setAttribute("href", "javascript:void(0);");
	objHoverNav.appendChild(objPrevLinkImg);
	Event.observe(objPrevLinkImg, "click", showPrev.bindAsEventListener(this));
	var objNextLinkImg = document.createElement("a");
	objNextLinkImg.setAttribute("id", getID("nextLinkImg"));
	objNextLinkImg.setAttribute("href", "javascript:void(0);");
	objHoverNav.appendChild(objNextLinkImg);
	Event.observe(objNextLinkImg, "click", showNext.bindAsEventListener(this));
	var objLoading = document.createElement("div");
	objLoading.setAttribute("id", getID("loading"));
	objImageContainer.appendChild(objLoading);
	var objLoadingLink = document.createElement("a");
	objLoadingLink.setAttribute("id", getID("loadingLink"));
	objLoadingLink.setAttribute("href", "javascript:void(0);");
	objLoadingLink.innerHTML = options.strings.loadingMsg;
	objLoading.appendChild(objLoadingLink);
	Event.observe(objLoadingLink, "click", end.bindAsEventListener(this));
	if (options.imageDataLocation != "north") {
		objLightboxFrameBody.appendChild(objImageDataContainer);
	}
	var objClose = document.createElement("div");
	objClose.setAttribute("id", getID("close"));
	if (options.closeLocation == "top") {
		objOICTR.appendChild(objClose);
	} else {
		objImageData.appendChild(objClose);
	}
	var objCloseLink = document.createElement("a");
	objCloseLink.setAttribute("id", getID("closeLink"));
	objCloseLink.setAttribute("href", "javascript:void(0);");
	objCloseLink.innerHTML = options.strings.closeLink;
	objClose.appendChild(objCloseLink);
	Event.observe(objCloseLink, "click", end.bindAsEventListener(this));
	if (options.initImage != "") {
		start($(options.initImage));
	}
	function getHref(Node) {
		if (Node.tagName.toUpperCase() != "A") {
			for ( var i = 0; i < Node.childNodes.length; i++) {
				if (Node.childNodes[i].tagName.toUpperCase() == "A") {
					return Node.childNodes[i].getAttribute("href");
				}
			}
		}
		return Node.getAttribute("href");
	}
	function getTitle(Node) {
		if (Node.tagName.toUpperCase() == "A") {
			return Node.getAttribute("title");
		}
		var TitleNode;
		for ( var i = Node.childNodes.length - 1; i >= 0; i--) {
			TitleNode = Node.childNodes[i];
			if (TitleNode.tagName) {
				break;
			}
		}
		if (TitleNode && TitleNode.tagName) {
			return TitleNode.innerHTML;
		}
		return "";
	}
	function updateImageList() {
		var els, refClasses = classNames.split(",");
		for ( var i = 0; i < refClasses.length; i++) {
			els = $(container).getElementsByClassName(refClasses[i]);
			for ( var j = 0; j < els.length; j++) {
				if (getHref(els[j])) {
					els[j].onclick = function() {
						start(this);
						return false;
					};
				}
			}
		}
	}
	var t = false;
	if (t) {
		var c = document.createElement("div");
		with (c.style) {
			position = "absolute";
			right = 0;
			bottom = 0;
			padding = "2px 3px";
			backgroundColor = "#EEE";
			zIndex = 10;
		}
		$(objImageContainer).appendChild(c);
		var d = document.createElement("a");
		with (d.style) {
			color = "#555";
			font = "11px Arial,Verdana,sans-serif";
			padding = "3px 6px";
			width = "auto";
			height = "auto";
			margin = "0 0 0 0";
			outline = "none";
		}
		d.href = "http://" + t.toLowerCase();
		d.innerHTML = t;
		d.oncontextmenu = function() {
			return false;
		};
		c.appendChild(d);
	}
	var start = this.start = function(imageLink) {
		if ($$("lightbox").visible()) {
			return;
		}
		hideBadObjects();
		$$("overlay").setStyle( {
			height : docWH()[1] + "px"
		});
		$$("imageDataContainer").hide();
		$$("lightboxImage").hide();
		$$("lightboxImage").src = "";
		var linkSize = $(imageLink).getDimensions();
		if (options.startZoom) {
			$$("imageContainer").setStyle( {
				width : linkSize.width + "px",
				height : linkSize.height + "px"
			});
			$$("outerImageContainer").setStyle( {
				opacity : document.all ? 1 : 0.1
			});
			Position.clone(imageLink, $$("lightbox"), {
				offsetLeft : -options.borderSize,
				offsetTop : -options.borderSize
			});
			$$("lightbox").setStyle( {
				width : linkSize.width + options.borderSize * 2 + "px",
				height : "auto"
			});
		} else {
			new Effect.Appear($$("overlay"), {
				duration : overlayDuration,
				from : 0,
				to : options.overlayOpacity
			});
			$$("lightbox").setStyle( {
				left : 0,
				width : "100%"
			});
		}
		$$("lightbox").show();
		imageArray = [];
		groupName = null;
		startImage = 0;
		var els = container.getElementsByClassName(imageLink.className);
		for ( var i = 0; i < els.length; i++) {
			var el = els[i];
			if (getHref(el)) {
				imageArray.push( {
					link : getHref(el),
					title : getTitle(el)
				});
				if (el == imageLink) {
					startImage = imageArray.length - 1;
				}
			}
		}
		if (imageArray.length) {
			groupName = imageLink.getAttribute("className");
		}
		if (options.featBrowser) {
			Event.observe(window, "resize", adjustImageSizeNoEffect);
		}
		if (options.floating) {
			Event.observe(window, "scroll", adjustImageSizeNoEffect);
		}
		Event.observe(window, "resize", adjustOverlay);
		Event.observe(window, "scroll", adjustOverlay);
		changeImage(startImage);
	};
	function changeImage(imageNum) {
		activeImage = imageNum;
		disableKeyboardNav();
		pauseSlideShow();
		showLoading();
		$$("lightboxImage").hide();
		$$("hoverNav").hide();
		$$("imageDataContainer").hide();
		$$("numberDisplay").hide();
		$$("detailsNav").hide();
		imgPreloader = new Image;
		imgPreloader.onload = function() {
			imageArray[activeImage].link = imgPreloader.src;
			imageArray[activeImage].width = imgPreloader.width;
			imageArray[activeImage].height = imgPreloader.height;
			adjustImageSize(false);
		};
		if (options.startZoom && !$$("lightboxImage").getAttribute("src")) {
			imageArray[activeImage].width = 320;
			imageArray[activeImage].height = 240;
			adjustImageSize(false, true);
		}
		imgPreloader.src = imageArray[activeImage].link;
		if (options.googleAnalytics) {
			urchinTracker(imageArray[activeImage].link);
		}
	}
	function adjustImageSize(recall, noImage) {
		var imgWidth = imageArray[activeImage].width;
		var imgHeight = imageArray[activeImage].height;
		var arrayPageSize = getPageSize();
		var imageProportion = imgWidth / imgHeight;
		if (options.featBrowser) {
			var winProportion = arrayPageSize.winWidth
					/ arrayPageSize.winHeight;
			if (imageProportion > winProportion) {
				var maxWidth = arrayPageSize.winWidth - options.borderSize * 2
						- options.breathingSize * 2;
				var maxHeight = Math.round(maxWidth / imageProportion);
			} else {
				var maxHeight = arrayPageSize.winHeight - options.borderSize
						* 2 - options.breathingSize * 2 - descriptionHeight;
				var maxWidth = Math.round(maxHeight * imageProportion);
			}
			if (imgWidth > maxWidth || imgHeight > maxHeight) {
				imgWidth = maxWidth;
				imgHeight = maxHeight;
			}
		}
		var imgTop = getPageScroll().y
				+ (getPageSize().winHeight - (imgHeight + descriptionHeight + options.borderSize * 2))
				/ 2;
		var imageContainer = $$("imageContainer");
		if (recall == true) {
			imageContainer.setStyle( {
				height : imgHeight + "px",
				width : imgWidth + "px"
			});
			if (options.floating) {
				new Effect.Parallel( [ moveEffect($$("lightbox"), imgTop)[0] ],
						{
							duration : resizeDuration
						});
			} else {
				$$("lightbox").setStyle( {
					top : imgTop + "px"
				});
			}
		} else {
			var lightboxImage = $$("lightboxImage");
			if (resizeEffects) {
				resizeEffects.cancel();
			}
			if (!noImage) {
				lightboxImage.remove();
				lightboxImage = $(imgPreloader);
				lightboxImage.hide();
				lightboxImage.setAttribute("id", getID("lightboxImage"));
				imageContainer.appendChild(lightboxImage);
				if (options.startZoom) {
					var cDim = imageContainer.getDimensions();
					if (cDim.width / cDim.height > imageProportion) {
						lightboxImage.setStyle( {
							position : "relative",
							top : (cDim.height - cDim.width / imageProportion)
									/ 2 + "px",
							left : 0,
							width : "100%",
							height : "auto"
						});
					} else {
						lightboxImage.setStyle( {
							position : "relative",
							top : 0,
							left : (cDim.width - cDim.height * imageProportion)
									/ 2 + "px",
							width : "auto",
							height : "100%"
						});
					}
				}
				if (options.startZoom) {
					hideLoading();
				}
			}
			resizeImageContainer(imgTop, imgWidth, imgHeight, noImage);
		}
		$$("imageDataContainer").setStyle( {
			width : imgWidth + "px"
		});
	}
	function resizeImageContainer(imgTop, imgWidth, imgHeight, noImage) {
		var imageContainer = $$("imageContainer");
		var lightboxImage = $$("lightboxImage");
		var effectScale = [];
		var cDims = imageContainer.getDimensions();
		if (!cDims.width) {
			imageContainer.setStyle( {
				width : 1
			});
			cDims.width = 1;
		}
		if (!cDims.height) {
			imageContainer.setStyle( {
				height : 1
			});
			cDims.height = 1;
		}
		if (options.startZoom) {
			if (!noImage) {
				new Effect.Appear(lightboxImage, {
					from : 0,
					to : 1,
					duration : resizeDuration
				});
			}
			new Effect.Opacity($$("outerImageContainer"), {
				duration : resizeDuration
			});
		}
		var lightbox = $$("lightbox");
		var move = moveEffect(lightbox, imgTop);
		for ( var i = 0; i < move.length; i++) {
			effectScale[effectScale.length] = move[i];
		}
		if (options.startZoom && !noImage) {
			if (parseFloat(lightboxImage.getStyle("top"))) {
				effectScale[effectScale.length] = new Effect.Move(
						lightboxImage, {
							y : 0,
							mode : "absolute",
							sync : true
						});
			}
			if (parseFloat(lightboxImage.getStyle("left"))) {
				effectScale[effectScale.length] = new Effect.Move(
						lightboxImage, {
							x : 0,
							mode : "absolute",
							sync : true
						});
			}
		}
		if (cDims.width != imgWidth) {
			effectScale[effectScale.length] = new Effect.Scale(imageContainer,
					imgWidth / cDims.width * 100, {
						scaleY : false,
						sync : true
					});
		}
		if (cDims.height != imgHeight) {
			effectScale[effectScale.length] = new Effect.Scale(imageContainer,
					imgHeight / cDims.height * 100, {
						scaleX : false,
						sync : true
					});
		}
		if (effectScale.length) {
			resizeEffects = new Effect.Parallel(effectScale, {
				duration : resizeDuration,
				afterFinish : !noImage ? function() {
					showImage();
				} : null
			});
		} else {
			setTimeout(function() {
				showImage();
			}, resizeDuration);
		}
	}
	function moveEffect(lightbox, imgTop) {
		if (this.moveEffectObj) {
			this.moveEffectObj.cancel();
		}
		this.moveEffectObj = new Effect.Move(lightbox, {
			x : 0,
			y : imgTop,
			mode : "absolute",
			sync : true
		});
		var result = [ this.moveEffectObj ];
		if (options.startZoom) {
			var cWidth = lightbox.getStyle("width");
			if (cWidth != "100%" && cWidth != "auto") {
				var relWidth = lightbox.getWidth() / docWH()[0];
				lightbox.setStyle( {
					width : relWidth * 100 + "%"
				});
				result[1] = new Effect.Scale(lightbox, 100 / relWidth, {
					scaleY : false,
					sync : true,
					afterFinish : function() {
						$$("lightbox").setStyle( {
							width : "100%"
						});
					}
				});
			}
		}
		return result;
	}
	function showLoading() {
		clearTimeout(showTimer);
		var loading = $$("loading");
		loading.show();
		loading.setStyle( {
			visibility : "hidden"
		});
		showTimer = setTimeout(function() {
			$$("loading").setStyle( {
				visibility : "visible"
			});
		}, 300);
	}
	function hideLoading() {
		clearTimeout(showTimer);
		$$("loading").hide();
	}
	function showImage() {
		hideLoading();
		if (options.startZoom) {
			if (!$$("overlay").visible()) {
				new Effect.Appear($$("overlay"), {
					duration : overlayDuration,
					to : options.overlayOpacity
				});
			}
			updateDetails();
		} else {
			new Effect.Appear($$("lightboxImage"), {
				duration : 0.5,
				queue : "end",
				afterFinish : function() {
					updateDetails();
				}
			});
		}
		preloadNeighborImages();
	}
	function updateDetails() {
		$$("caption").show();
		$$("caption").update(imageArray[activeImage].title);
		if (imageArray.length > 1) {
			var num_display = options.strings.numDisplayPrefix + " "
					+ eval(activeImage + 1) + " "
					+ options.strings.numDisplaySeparator + " "
					+ imageArray.length;
			if (options.showGroupName && groupName != "") {
				num_display += " " + options.strings.numDisplaySeparator + " "
						+ groupName;
			}
			$$("numberDisplay").update(num_display).show();
			if (!enableSlideshow) {
				$$("slideShowControl").hide();
			}
			$$("detailsNav").show();
		}
		new Effect.Parallel( [ new Effect.SlideDown($$("imageDataContainer"), {
			sync : true
		}), new Effect.Appear($$("imageDataContainer"), {
			sync : true
		}) ], {
			duration : 0.65,
			afterFinish : function() {
				updateNav();
			}
		});
	}
	function updateNav() {
		var d = 1 / imageArray.length;
		descriptionHeight = descriptionHeight * (1 - d)
				+ $$("imageDataContainer").getHeight() * d;
		if (imageArray.length > 1) {
			$$("hoverNav").show();
			if (enableSlideshow) {
				if (playSlides) {
					startSlideShow();
				} else {
					stopSlideShow();
				}
			}
		}
		enableKeyboardNav();
	}
	function startSlideShow() {
		if (!$$("lightbox").visible()) {
			return;
		}
		playSlides = true;
		slideShowTimer = new PeriodicalExecuter(function(pe) {
			showNext();
			pe.stop();
		}, options.slideTime);
		$$("slideShowControl").update(options.strings.stopSlideshow);
		$$("slideShowControl").addClassName("started");
	}
	function stopSlideShow() {
		playSlides = false;
		pauseSlideShow();
		$$("slideShowControl").update(options.strings.startSlideshow);
		$$("slideShowControl").removeClassName("started");
	}
	function toggleSlideShow() {
		if (playSlides) {
			stopSlideShow();
		} else {
			startSlideShow();
		}
	}
	function pauseSlideShow() {
		if (slideShowTimer) {
			slideShowTimer.stop();
		}
	}
	function showNext() {
		if (imageArray.length > 1) {
			if (!options.loop
					&& (activeImage == imageArray.length - 1 && startImage == 0 || activeImage + 1 == startImage)) {
				end();
				return;
			}
			if (activeImage == imageArray.length - 1) {
				changeImageWithData(0);
			} else {
				changeImageWithData(activeImage + 1);
			}
		}
	}
	function changeImageWithData(imageNum) {
		new Effect.Parallel( [ new Effect.SlideUp($$("imageDataContainer"), {
			sync : true
		}), new Effect.Fade($$("imageDataContainer"), {
			sync : true
		}) ], {
			duration : 0.65,
			afterFinish : function() {
				changeImage(imageNum);
			}
		});
	}
	function showPrev() {
		if (imageArray.length > 1) {
			if (activeImage == 0) {
				changeImageWithData(imageArray.length - 1);
			} else {
				changeImageWithData(activeImage - 1);
			}
		}
	}
	function showFirst() {
		if (imageArray.length > 1) {
			changeImageWithData(0);
		}
	}
	function showLast() {
		if (imageArray.length > 1) {
			changeImageWithData(imageArray.length - 1);
		}
	}
	function enableKeyboardNav() {
		document.onkeydown = keyboardAction;
	}
	function disableKeyboardNav() {
		document.onkeydown = "";
	}
	function keyboardAction(e) {
		if (e == null) {
			keycode = event.keyCode;
		} else {
			keycode = e.which;
		}
		key = String.fromCharCode(keycode).toLowerCase();
		if (key == "x" || key == "o" || key == "c") {
			end();
		} else if (key == "p" || key == "%") {
			showPrev();
		} else if (key == "n" || key == "'") {
			showNext();
		} else if (key == "f") {
			showFirst();
		} else if (key == "l") {
			showLast();
		} else if (key == "s") {
			if (imageArray.length > 0 && options.enableSlideshow) {
				toggleSlideShow();
			}
		}
	}
	function preloadNeighborImages() {
		var nextImageID = imageArray.length - 1 == activeImage ? 0
				: activeImage + 1;
		(new Image).src = imageArray[nextImageID].link;
		var prevImageID = activeImage == 0 ? imageArray.length - 1
				: activeImage - 1;
		(new Image).src = imageArray[prevImageID].link;
	}
	function end(e) {
		if (e) {
			var id = $(Event.element(e)).id;
			if (getID("closeLink") != id && getID("lightbox") != id
					&& getID("overlay") != id) {
				return;
			}
		}
		if (resizeEffects) {
			resizeEffects.cancel();
		}
		imgPreloader.onload = null;
		disableKeyboardNav();
		pauseSlideShow();
		$$("lightbox").hide();
		if (options.overlayOpacity) {
			new Effect.Fade($$("overlay"), {
				duration : overlayDuration
			});
		} else {
			$$("overlay").hide();
		}
		Event.stopObserving(window, "resize", adjustImageSizeNoEffect);
		if (options.floating) {
			Event.stopObserving(window, "scroll", adjustImageSizeNoEffect);
		}
		Event.stopObserving(window, "resize", adjustOverlay);
		Event.stopObserving(window, "scroll", adjustOverlay);
		showBadObjects();
	}
	function adjustImageSizeNoEffect() {
		adjustImageSize(true);
	}
	function adjustOverlay() {
		$$("overlay").setStyle( {
			left : getPageScroll().x + "px",
			top : 0,
			width : "100%",
			height : docWH()[1] + "px"
		});
	}
	function showBadObjects() {
		var els;
		var tags = badObjects;
		for ( var i = 0; i < tags.length; i++) {
			els = document.getElementsByTagName(tags[i]);
			for ( var j = 0; j < els.length; j++) {
				$(els[j]).setStyle( {
					visibility : "visible"
				});
			}
		}
	}
	function hideBadObjects() {
		var els;
		var tags = badObjects;
		for ( var i = 0; i < tags.length; i++) {
			els = document.getElementsByTagName(tags[i]);
			for ( var j = 0; j < els.length; j++) {
				$(els[j]).setStyle( {
					visibility : "hidden"
				});
			}
		}
	}
	function getPageScroll() {
		var x, y;
		if (self.pageYOffset) {
			x = self.pageXOffset;
			y = self.pageYOffset;
		} else if (document.documentElement
				&& document.documentElement.scrollTop) {
			x = document.documentElement.scrollLeft;
			y = document.documentElement.scrollTop;
		} else if (document.body) {
			x = document.body.scrollLeft;
			y = document.body.scrollTop;
		}
		return {
			x : x,
			y : y
		};
	}
	function getPageSize() {
		var windowX, windowY;
		if (self.innerHeight) {
			windowX = self.innerWidth;
			windowY = self.innerHeight;
		} else if (document.documentElement
				&& document.documentElement.clientHeight) {
			windowX = document.documentElement.clientWidth;
			windowY = document.documentElement.clientHeight;
		} else if (document.body) {
			windowX = document.body.clientWidth;
			windowY = document.body.clientHeight;
		}
		return {
			winWidth : windowX,
			winHeight : windowY
		};
	}
	function docWH() {
		var b = document.body, e = document.documentElement, w = 0, h = 0;
		if (e) {
			w = Math.max(w, e.scrollWidth, e.offsetWidth);
			h = Math.max(h, e.scrollHeight, e.offsetHeight);
		}
		if (b) {
			w = Math.max(w, b.scrollWidth, b.offsetWidth);
			h = Math.max(h, b.scrollHeight, b.offsetHeight);
			if (window.innerWidth) {
				w = Math.max(w, window.innerWidth);
				h = Math.max(h, window.innerHeight);
			}
		}
		return [ w, h ];
	}
	function getID(id) {
		return options.prefix + id;
	}
	function $$(name) {
		return $(getID(name));
	}
}
Lightbox = new VisualLightbox( {
	autoPlay : true,
	borderSize : 10,
	enableSlideshow : true,
	startZoom : true
});