function popupWindow(wUrl, wName, wWidth, wHeight) {
	var left = (screen.width - wWidth) / 2;
	var top = (screen.height - wHeight) / 2;
	
	var popupWindow = window.open(wUrl, wName, 'scrollbars=0, width=' + wWidth + ', height=' + wHeight + ', top=' + top + ', left=' + left);
	
	popupWindow.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'+
	'<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>'+ wName + '</title></head>');
	popupWindow.document.write('<HTML><BODY style="margin: 0; padding: 0;">');
	popupWindow.document.write('<div style="position:absolute; width:"' + wWidth + '"; height:"' + wHeight + '"; z-index:1; left: 0; top: 0">');
	popupWindow.document.write('<img src="' + wUrl + '" alt="' + wName + '" onclick="window.close();" width="' + wWidth +'" height="' + wHeight + '" />');
	popupWindow.document.write('</div>');
	popupWindow.document.write('</BODY></HTML>');
	popupWindow.document.close();
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {

   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.className == "external") {
     anchor.target = "_blank";
   }
 }
}