--- ./lightbox.js.dist	2006-01-27 08:15:14.000000000 -0800
+++ ./lightbox.js	2006-01-27 08:17:31.000000000 -0800
@@ -39,9 +39,6 @@
 var closeButton = 'close.gif';		
 
 
-
-
-
 //
 // getPageScroll()
 // Returns array with x,y page scroll values.
@@ -162,14 +159,17 @@
 //
 function showLightbox(objLink)
 {
+
 	// prep objects
 	var objOverlay = document.getElementById('overlay');
 	var objLightbox = document.getElementById('lightbox');
 	var objCaption = document.getElementById('lightboxCaption');
 	var objImage = document.getElementById('lightboxImage');
+	var objImageLink = document.getElementById('lightboxImageLink');
 	var objLoadingImage = document.getElementById('loadingImage');
 	var objLightboxDetails = document.getElementById('lightboxDetails');
 
+        var imgAlt = objLink.getAttribute("alt");
 	
 	var arrayPageSize = getPageSize();
 	var arrayPageScroll = getPageScroll();
@@ -185,11 +185,17 @@
 	objOverlay.style.height = (arrayPageSize[1] + 'px');
 	objOverlay.style.display = 'block';
 
+        if (imgAlt) {
+               objImageLink.setAttribute("href", objLink.getAttribute("href"));
+               objImageLink.setAttribute("title", objLink.getAttribute("title"));
+               objImageLink.setAttribute("onclick","");
+        }
+
 	// preload image
 	imgPreload = new Image();
 
 	imgPreload.onload=function(){
-		objImage.src = objLink.href;
+		objImage.src = (imgAlt) ? imgAlt : objLink.href;
 
 		// center lightbox and make sure that the top and left values are not negative
 		// and the image placed outside the viewport
@@ -217,14 +223,6 @@
 		} 
 
 		if (objLoadingImage) {	objLoadingImage.style.display = 'none'; }
-
-		// Hide select boxes as they will 'peek' through the image in IE
-		selects = document.getElementsByTagName("select");
-        for (i = 0; i != selects.length; i++) {
-                selects[i].style.visibility = "hidden";
-        }
-
-	
 		objLightbox.style.display = 'block';
 
 		// After image is loaded, update the overlay height as the new image might have
@@ -238,8 +236,7 @@
 		return false;
 	}
 
-	imgPreload.src = objLink.href;
-	
+	imgPreload.src = (imgAlt) ? imgAlt : objLink.href;
 }
 
 
@@ -258,13 +255,7 @@
 	// hide lightbox and overlay
 	objOverlay.style.display = 'none';
 	objLightbox.style.display = 'none';
-
-	// make select boxes visible
-	selects = document.getElementsByTagName("select");
-    for (i = 0; i != selects.length; i++) {
-		selects[i].style.visibility = "visible";
-	}
-
+	
 	// disable keypress listener
 	document.onkeypress = '';
 }
@@ -281,7 +272,7 @@
 //
 function initLightbox()
 {
-	
+
 	if (!document.getElementsByTagName){ return; }
 	var anchors = document.getElementsByTagName("a");
 
@@ -362,11 +353,19 @@
 	
 	// create link
 	var objLink = document.createElement("a");
+        objLink.setAttribute("id","lightboxImageLink");
 	objLink.setAttribute('href','#');
 	objLink.setAttribute('title','Click to close');
 	objLink.onclick = function () {hideLightbox(); return false;}
 	objLightbox.appendChild(objLink);
 
+	var closeLink = document.createElement("a");
+        closeLink.setAttribute("id","lightboxCloseLink");
+	closeLink.setAttribute('href','#');
+	closeLink.setAttribute('title','Click to close');
+	closeLink.onclick = function () {hideLightbox(); return false;}
+	objLightbox.appendChild(closeLink);
+
 	// preload and create close button image
 	var imgPreloadCloseButton = new Image();
 
@@ -378,7 +377,7 @@
 		objCloseButton.setAttribute('id','closeButton');
 		objCloseButton.style.position = 'absolute';
 		objCloseButton.style.zIndex = '200';
-		objLink.appendChild(objCloseButton);
+		closeLink.appendChild(objCloseButton);
 
 		return false;
 	}
@@ -388,6 +387,7 @@
 	// create image
 	var objImage = document.createElement("img");
 	objImage.setAttribute('id','lightboxImage');
+
 	objLink.appendChild(objImage);
 	
 	// create details div, a container for the caption and keyboard message
@@ -432,6 +432,4 @@
 
 }
 
-
-
-addLoadEvent(initLightbox);	// run initLightbox onLoad
\ No newline at end of file
+ addLoadEvent(initLightbox);	// run initLightbox onLoad
\ No newline at end of file
