var win=null;

function wp(url,w,h,title,extra)
{
 css = 'height: '+h+'px; margin: 0px; border: solid 2px #333333; vertical-align: middle;';
 html = '<Html>\n<Head>\n<Title>'+title+'</Title>\n</Head>\n<Body bgcolor="#ffffcc" LeftMargin=0 MarginWidht=0 TopMargin=10 MarginHeight=0>\n<div style="width: 100%;height: 100%;text-align: center;"><img style="'+css+'" src="'+url+'" border=2 Name=nuovaWin alt="'+title+'" title="'+title+'"></div>\n</Body>\n</Html>';

 offsetw=20;
 offseth=90;

 var macie=false;
 var ie=false;
 var agt=navigator.userAgent.toLowerCase();
 var plat=navigator.platform.toLowerCase();

 if (agt.indexOf("msie") != -1 && plat.indexOf("mac") != -1) macie=true;
 if (agt.indexOf("msie")!=-1) ie=true;

// Offset per Internet Explorer
 if(ie){
	offsetw=20;
	offseth=90;
}

 str="height="+(h+offseth)+",width="+(w+offsetw)+","+extra;
 str+=",left="+(screen.width -w)/2+",top="+parseInt((screen.height -h)/3);
 str+=",toolbar=no, location=no,status=no,menubar=no,scrollbars=no,resizable=no";

 if(win==null || !win.open || win.closed){
	win=window.open('','name',str);
	win.resizeTo((w+offseth), (h+offseth));
	with (win.document) {
  		win.document.open();
		win.document.write(html);
		win.document.close();
 	}
 }else{
 if (win && win.open && !win.closed) {
  win.resizeTo((w+offsetw), (h+offseth));
  win.document.open();
  win.document.write(html);
  win.document.close();
 }
}
win.focus();
if(macie) win=null;
}
