/*
* Popup Resizable Windows including a page url containing an image
*/
function popupImg(url,commento,max_w,max_h){	
    w = h = 0;
	if(navigator.userAgent.toLowerCase().indexOf('msie') == -1)
	{	w = 20;
		h = 80;
	}
	
	var func = "<script language=\"javascript\">"+
	"function imposta() {"+
	"var NS = (navigator.appName==\"Netscape\")?true:false;"+
	"iWidth = (NS)?window.innerWidth:document.body.clientWidth;"+
	"iHeight = (NS)?window.innerHeight:document.body.clientHeight;"+
	"iWidth = document.images[0].width - iWidth;"+
	"iHeight = document.images[0].height - iHeight;"+
	"window.resizeBy(iWidth, iHeight);"+
	"}"+
	"</scr"+"ipt>";
	var win = window.open('','viewimg','status=no,resizable=yes,width=250,height=250');
	win.document.write('<html><head><title></title>'+func+'</head>');
	win.document.write('<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onload="imposta()">');
	win.document.write('<img id="img" src="'+url+'" border="0" onClick="window.close()" width="'+max_w+'" height="'+max_h+'" align="absmiddle" alt="'+commento+'">');
	win.document.write('</body></html>');
	win.document.close();
}

function popupPage(url){

    var func = "<script language=\"javascript\">"+
	"function imposta() {"+
	"var NS = (navigator.appName==\"Netscape\")?true:false;"+
	"iWidth = (NS)?window.innerWidth:document.body.clientWidth;"+
	"iHeight = (NS)?window.innerHeight:document.body.clientHeight;"+
	"iWidth = document.images[0].width - iWidth;"+
	"iHeight = document.images[0].height - iHeight;"+
	"window.resizeBy(iWidth, iHeight);"+
	"}"+
	"</scr"+"ipt>";
    var win = window.open(url,'viewpage','status=no,resizable=yes,width=900');
	
}  // JavaScript Document