function runPopup(ImageName){
imgOpen(ImageName,'Photo');
}

function imgOpen(imgLink,Title) {
	if (typeof(window.resizeBy)=='undefined') return true;
	imgWndw=window.open('','_blank','width=100,height=100'+ ',toolbar=no,menubar=no,location=no,status=no,'+ 'resizable=no,scrollbars=no,left='+(screen.width / 3)+ ',top='+(screen.height / 3));
	self.focus();

	var imgTitle=(Title)?Title:imgLink;
	with (imgWndw.document) {
		open();

		var resize = 'function imgResize2() {var w=this.document.images[0].width; if (w>screen.availWidth) {w=screen.availWidth;} var h=this.document.images[0].height; if (h>screen.availHeight) {h=screen.availHeight;} if (w>50 && h>50) { var ww = (this.innerWidth)?this.innerWidth:((document.body)? document.body.clientWidth:null); var wh = (this.innerHeight)?this.innerHeight:((document.body)? document.body.clientHeight:null); if (ww && wh) {this.resizeBy(w-ww,h-wh); this.moveTo(screen.availWidth / 2 - w / 2, screen.availHeight / 2 - h / 2);} focus();}}';
		write('<ht'+'ml><he'+'ad><ti'+'tle>'+imgTitle+'</ti'+'tle>'+ '</he'+'ad><bo'+'dy leftmargin="0" topmargin="0" '+ 'rightmargin="0" bottommargin="0" marginwidth="0" '+ 'style="margin:0;padding:0;position:fixed;overflow:none;" '+ 'marginheight="0"><img src="'+imgLink+'" border="0" '+ ' alt="'+imgTitle+'" title="'+imgTitle+'" class="r" /><script language="JavaScript" type="text/javascript">'+resize+'; setInterval("imgResize2()",100);</script></bo'+ 'dy></ht'+'ml>');

		close();
	}
	return false;
}

function docOpen(link) {
	if (typeof(window.resizeBy)=='undefined') return true;
	imgWndw=window.open(link,'_blank','width=820,height=700'+ ',toolbar=no,menubar=no,location=no,status=no,'+ 'resizable=no,scrollbars=no,left='+(screen.width / 2 - 410)+ ',top='+(screen.height / 2 - 380));
	return false;
}