// JavaScript Document
function riempi() {
	if (window.screen) {
		var w = screen.availWidth;
		var h = screen.availHeight;
		window.moveTo(0, 0);
		window.resizeTo(w, h);
	}
} 

var isopen1=false;
var mw1;
function lancia(pagnews) {
	var w = screen.width;
	var h = screen.height;
	if(w >= "1024"){
		largnews = 710;
		altnews = 690;
	}
	else {
		largnews = 610;
		altnews = 550;
	}
	var xnews = 0;
	var ynews = 0;
	if (!isopen1) {
	mw1=window.open (pagnews, "", 'left=' + xnews + ',screenX=' + xnews + ',top=' + ynews + 'screenY=' + ynews +',width=' + largnews + ',height=' + altnews + ',scrollbars=1,menubar=0,resizable=0, status=0,titlebar=0,toolbar=0');
	isopen1=true;
	mw1.focus();
	} 
	else {
		if (mw1.closed) {
		mw1=window.open (pagnews, "", 'left=' + xnews + ',screenX=' + xnews + ',top=' + ynews + 'screenY=' + ynews +',width=' + largnews + ',height=' + altnews + ',scrollbars=1,menubar=0,resizable=0, status=0,titlebar=0,toolbar=0');
		isopen1=true;
		}
		mw1.focus();
	}
}

var isopen2=false;
var mw2;
function lanciasondaggio(pagsond) {	
	var largsond = 351;
	var altsond = 201;
	var xsond = Math.floor((screen.width-largsond)/2);
	var ysond = Math.floor((screen.height-altsond)/2);
	if (!isopen2) {
		mw2 = window.open (pagsond, "", 'left=' + xsond + ',screenX=' + xsond + ',top=' + ysond + 'screenY=' + ysond +',width=' + largsond + ',height=' + altsond + ',scrollbars=0,menubar=0,resizable=0, status=0,titlebar=0,toolbar=0');
		isopen2=true;
		mw2.focus();
	}
	else {
		if (mw2.closed) {
			mw2=window.open (pagsond, "", 'left=' + xsond + ',screenX=' + xsond + ',top=' + ysond + 'screenY=' + ysond +',width=' + largsond + ',height=' + altsond + ',scrollbars=0,menubar=0,resizable=0, status=0,titlebar=0,toolbar=0');
			isopen2=true;
		}
		mw2.focus();
	}
}

var isopen3=false;
var mw3;
function lanciatessera(pagtessera) {	
	var largtessera = 600;
	var alttessera = 450;
	var xtessera = Math.floor((screen.width-largtessera)/2);
	var ytessera = Math.floor((screen.height-alttessera)/2);
	if (!isopen3) {
		mw3=window.open (pagtessera, '', 'left=' + xtessera + ',screenX=' + xtessera + ',top=' + ytessera + 'screenY=' + ytessera +',width=' + largtessera + ',height=' + alttessera + ',scrollbars=0,menubar=0,resizable=0, status=0,titlebar=0,toolbar=0');
		isopen3=true;
		mw3.focus();
	}
	else {
		if (mw3.closed) {
			mw3=window.open (pagtessera, '', 'left=' + xtessera + ',screenX=' + xtessera + ',top=' + ytessera + 'screenY=' + ytessera +',width=' + largtessera + ',height=' + alttessera + ',scrollbars=0,menubar=0,resizable=0, status=0,titlebar=0,toolbar=0');
			isopen3=true;
		}
		mw3.focus();
	}
}

function zoomfoto(ifile,ix,iy,ititle) { 
var win;
var sWidth;
var sHeight;
var xpos = Math.floor((screen.width-ix)/2);
var ypos = Math.floor((screen.height-iy)/2);
var NS = (document.layers) ? 1 : 0;
win = window.open("","imageviewer","width="+ix+",height="+iy+",left="+xpos+",top="+ypos+",screenX="+xpos+",screenY="+ypos+",menubar=no,toolbar=no");
win.focus();
if (NS) {
sWidth = win.innerWidth;
sHeight = win.innerHeight;
} else {
sWidth = win.document.body.clientWidth;
sHeight = win.document.body.clientHeight;
}
if(sWidth!=ix || sHeight!=iy) {
win.close();
setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"')", 250);
return;
}
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title>");
win.document.write("</head><body>");
win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
win.document.write("<img src="+ifile+"></div></body></html>");
win.document.close();
}