Codice PHP:
// Set the horizontal and vertical position for the popup
PositionX = 100;
PositionY = 100;
// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)
defaultWidth = 400;
defaultHeight = 400;
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
var isOP=(navigator.appName=="Opera")?1:0;
}
var optOP='location=no,scrollbars=no,status=no,menubar=no,toolbar=no,resizable=no,titlebar=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optNN='location=no,scrollbars=no,status=no,menubar=no,toolbar=no,resizable=no,titlebar=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='location=no,scrollbars=no,status=no,menubar=no,toolbar=no,resizable=no,titlebar=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','PopUp',optNN);}
if (isIE){imgWin=window.open('about:blank','PopUp',optIE);}
if (isOP){imgWin=window.open('about:blank','PopUp',optOP);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>html,body{margin:0px;padding:0px;}</style>');
writeln('<script>\nvar isNN,isIE,isOP;\nif (parseInt(navigator.appVersion.charAt(0))>=4){\nisNN=(navigator.appName=="Netscape")?1:0;\nisIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;\nisOP=(navigator.appName=="Opera")?1:0;}\nfunction reSizeToImage(){\nif (isIE){\nif(navigator.appVersion.search("MSIE 7.0")!=-1){\nwindow.resizeTo(100,100);\nwidth=100-(document.body.clientWidth-document.images[0].width);\nheight=100-(document.body.clientHeight-document.images[0].height);\nwindow.resizeTo(width+150,height);\n}else{\nwindow.resizeTo(100,100);\nwidth=100-(document.body.clientWidth-document.images[0].width);\nheight=100-(document.body.clientHeight-document.images[0].height);\nwindow.resizeTo(width,height);\n}\n}\nif (isNN){\nwindow.innerWidth=document.images["George"].width;\nwindow.innerHeight=document.images["George"].height;\n}\n}\nfunction doTitle(){document.title="Ingrandimento foto";}\nwindow.onload=self.focus()</script>');
writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();">');
writeln('[img]+imageURL+[/img]</body></html>');
close();
}}