function imgGallery(path,cnt,title) {
	var imgArr = new Array(); 
	var sOut;
	var colPerRow;
	
	if(typeof sGalCols != "undefined") {
		colPerRow = sGallleryCols;
	} else {
		colPerRow = 3;
	}
	
	this.imgPath = path;
	this.galCnt = cnt;
	this.currentImg = 0;
	this.imgCnt = 0;
	this.title = title;
	
	this.addImage = function(imgSrc) {
		imgArr[this.imgCnt] = imgSrc;
		this.imgCnt++;
	}
	
	this.zoomImage = function (imgNo,galCnt) {
		this.currentImg = imgNo;
		PopUpVar("galleryZoom.asp?galCnt=" + galCnt + "&imgNo=" + imgNo,530,580,"left=100,top=100");
	}
	
	this.nextImage = function () {
		wHnd.document.images.galImg.src = "loading.gif"
		if (this.currentImg++ >= this.imgCnt-1) this.currentImg = 0;
		
		wHnd.document.images.galImg.src = this.imgPath + imgArr[this.currentImg]
		wHnd.document.getElementById('imgCnt').innerHTML = this.currentImg + 1 + "/" + this.imgCnt
	}
	
	this.prevImage = function () {
		wHnd.document.images.galImg.src = "loading.gif"
		if (this.currentImg-- <= 0) this.currentImg = this.imgCnt-1;
		wHnd.document.images.galImg.src = this.imgPath + imgArr[this.currentImg]
		wHnd.document.getElementById('imgCnt').innerHTML = this.currentImg + 1 + "/" + this.imgCnt
	}
	
	this.writeGallery = function () {
		sOut = ("<table class='imgGallery' cellspacing='0' cellpadding='0' border='0'><tr>")
		for(var i = 0; i < this.imgCnt; i++) {
			sOut += ("<td class='imgGalleryItem'><table cellspacing='0' cellpadding='0' border='0'><tr><td align='center' valign='middle' class='imgGalleryThumb'><a href=\"javascript:gallery"+this.galCnt+".zoomImage(" + i + "," + this.galCnt + ");\"><img border='0' src='" + this.imgPath + "/thumbs/" + imgArr[i] +"'></a></td></tr></table><div class='imgGalleryThumbMenu'><a href=\"javascript:gallery"+this.galCnt+".zoomImage(" + i + "," + this.galCnt + ");\"><img class='imgGalleryLens' border='0' src='images/lupe.gif'></a></div></td>")
			if (i%colPerRow == colPerRow-1) {
				sOut += (' </tr><tr>')
			}
		}
		sOut += ("<td colspan='" + (colPerRow - i%colPerRow) + "'>&nbsp;</td>")
		sOut += ("</tr></table>")
		document.write (sOut);
	}
	
	this.loadImage = function (imgNo) {
		wHnd.document.images.galImg.src = this.imgPath + imgArr[imgNo]
		wHnd.document.getElementById('imgCnt').innerHTML = imgNo + 1 + "/" + this.imgCnt;
		wHnd.document.getElementById('galTitle').innerHTML = this.title;
	}
	
}
