if(typeof popImg != "function") {
	function popImg(iName,iDesc,iVariant) {
	
		// replace image variant (needed for CMFPhoto Types in rm_macros/macros/view_photos)
		if((iName.indexOf("variant/") != -1) && (typeof iVariant != "undefined")) {
			temp = iName.split("/");
			temp.pop();
			iName = temp.join("/")+"/"+iVariant;
		}
	
		pInfo='menubar=0,';
		pInfo+='scrollbars=no,';
		pInfo+='width=150,';
		pInfo+='height=200';
		pInfo+='dependent=yes';
	
		winId = window.open('','newwin', pInfo);
		winId.document.open();
		winId.document.write("<HTML>");
		winId.document.write("<HEAD>");
		winId.document.write("<TITLE>"+iDesc+"</TITLE>");
		winId.document.write("<script language=\"JavaScript\">");
		winId.document.write("var popImg=new Image(); popImg.src=\""+iName+"\";");
		winId.document.write("if (navigator.userAgent.indexOf('Safari')!=-1) { popImg.onload=FitContent; }");
		winId.document.write("function FitContent() { ");
		winId.document.write("	if ((navigator.userAgent.indexOf('MSIE')!=-1)&&(navigator.userAgent.indexOf('Mac')==-1)) { ");
		winId.document.write("		iWidth = document.images['bild'].width - document.body.offsetWidth; ");
		winId.document.write("		iHeight = document.images['bild'].height - document.body.offsetHeight; ");
		winId.document.write("	} else if (navigator.userAgent.indexOf('Safari')!=-1) { ");
		winId.document.write("		iWidth = document.images['bild'].width - parseInt(window.innerWidth); ");
		winId.document.write("		iHeight = document.images['bild'].height - parseInt(window.innerHeight); ");
		winId.document.write("	} else if ((navigator.userAgent.indexOf('Netscape')!=-1) || ((navigator.userAgent.indexOf('Mozilla')!=-1)&&(navigator.userAgent.indexOf('Gecko')!=-1))) { ");
		winId.document.write("		window.resizeTo(1024,768); ");
		winId.document.write("		iWidth = document.images['bild'].width - window.innerWidth; ");
		winId.document.write("		iHeight = document.images['bild'].height - window.innerHeight; ");
		winId.document.write("	} else { ");
		winId.document.write("		iWidth = document.images['bild'].width - document.body.scrollWidth; ");
		winId.document.write("		iHeight = document.images['bild'].height - document.body.scrollHeight; ");
		winId.document.write("	} ");
		winId.document.write("	window.resizeBy(iWidth, iHeight); ");
		winId.document.write("	self.focus(); ");
		winId.document.write("} ");
		winId.document.write("</script>");
		winId.document.write("</HEAD>");
		winId.document.write("<BODY onload=\"FitContent();\" bgcolor=\"#ffffff\" topmargin=\"0\" marginheight=\"0\" leftmargin=\"0\" marginwidth=\"0\">");
		winId.document.write("<img src='"+iName+"' name=\"bild\" hspace=\"0\" vspace=\"0\">");
		winId.document.write("</BODY>");
		winId.document.write("</HTML>");
		winId.document.close();
	}
}