function randomString() {
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = 3;
	var randomstring = '';
	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	return randomstring;
}


function popupImg(myImage, myWidth, myHeight ) {
myHeight += 24;
myWidth += 24;
winW = 0;
winH = 0;

if (parseInt(navigator.appVersion)>3) {
	if (navigator.appName=="Netscape") {
		winW = window.innerWidth-16;
		winH = window.innerHeight-16;

		winW = (winW / 2) - (myWidth / 2);
		winH = (winH / 2);
	}

	if (navigator.appName.indexOf("Microsoft") !=-1 ) {
		winW = document.body.offsetWidth-20;
		winH = document.body.offsetHeight;

		winW = (winW / 2) - (myWidth / 2);
		winH = (winH / 2) - (myHeight / 4);
	}
}

winH = 0;
// If someone opens up multiple images then we want to give them unique window names
// A 3 character suffix should suffice to ensure uniqueness for our purposes...
popupWin = window.open("",'image' + randomString() ,'directories=no,fullscreen=no,height=' + myHeight + ',left=' + winW + ',location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no,top=' + winH + ',width=' + myWidth);
popupWin.document.write( "<img src='" + myImage + "' alt='Click To Close' onclick=\"javascript:self.close();\">")
popupWin.focus();
}
