
function gallery(imgDir)
{
    this.imgDir = imgDir ;

    this.showPic = function (whichpic) { 
	    if (document.getElementById) { 
	        var Image = document.getElementById('image') ;

            var link = document.createElement("a") ;
            link.setAttribute("href", this.imgDir +"/" + whichpic.alt) ;
            var imag = document.createElement("img") ;
            imag.setAttribute("src", this.imgDir + "/" + whichpic.alt) ;
            imag.setAttribute("alt", "") ;
            link.appendChild(imag) ;
	        
	        var oldLink = Image.firstChild ;
	        Image.replaceChild(link, oldLink) ;
		    return false; 
	    } else { 
		    return true; 
	    } 
    } ;
}


