/*
 *	Scritto da:
 *		Golinelli Davide
 *		E-Mail: webmaster_creation@yahoo.it
 *		Mantova lì: 28 dicembre 2004
*/
dim = Array(4);
dim[0] = Array(2);
dim[1] = Array(2);
dim[2] = Array(2);
dim[3] = Array(2);

dim[0]["x"] = 689;
dim[0]["y"] = 437;
dim[1]["x"] = 678;
dim[1]["y"] = 390;
dim[2]["x"] = 640;
dim[2]["y"] = 391;
dim[3]["x"] = 618;
dim[3]["y"] = 451;

function openHTML(nome,w,h)
	{
	if (w==0) w = screen.availWidth-10;
	if (h==0) h = screen.availHeight-50;
	var w = window.open(nome,
						"CPL",
						"scrollbars,width="+w+",height="+h+",top="+((screen.availHeight-50)-h)/2+",left="+((screen.availWidth-10)-w)/2);
			//"resizable,scrollbars,width="+(screen.availWidth-dim[no].x)/2+",height="+(screen.availHeight-50)+",top=0,left=0");
	}
function openPOPUP(nome,w,h)
	{
	var w = window.open(nome,
						"CPL",
						"resizable,width="+w+",height="+h+",top="+((screen.availHeight-50)-h)/2+",left="+((screen.availWidth-10)-w)/2);
	}
function openImg(no)
	{
	var w = window.open("seduta"+no+".htm",
						"CPL",
						"width="+dim[no].x+",height="+(25+dim[no].y)+",top="+((screen.availHeight-50)-dim[no].y)/2+",left="+((screen.availWidth-10)-dim[no].x)/2);
			//"resizable,scrollbars,width="+(screen.availWidth-dim[no].x)/2+",height="+(screen.availHeight-50)+",top=0,left=0");
	}
function getObj(str)
{
		//document.all.avanti_butt_a explorer
	if (document.all) 
		return document.all[str];
	else if (document.getElementById)
		return document.getElementById(str);
}
function printObj(obj)
{
	document.write("<ul>");
	for (i in obj)
	{
		document.write("<li>");
		document.write("	<big>"+i+"</big>="+obj[i]);
		document.write("</li>");
	}
	document.write("</ul>");
}
function setPrec(str)
{
	return getObj("indietro_butt_a").href = getObj("indietro_butt_b").href = str;
}
function setSucc(str)
{
	return getObj("avanti_butt_a").href = getObj("avanti_butt_b").href = str;	
}
function setImg(str)
{
	return getObj("immagine").src="finc/"+str;
}
function getFotoIndex(nomef)
{
	i = 0;
	while (foto[i]!=nomef && i<=6) i++;
	if (i==7) return -1;
	return i;
}
function inizializza(x)
{
	if (x>0 && nfoto<5) {
		setPrec("javascript:setNum("+(x-1)+")");
		setSucc("javascript:setNum("+(x+1)+")");
	} else if (x==0) {
		setPrec("javascript:window.close()");
		setSucc("javascript:setNum("+(1)+")");
	} else {
		setPrec("javascript:setNum("+(5)+")");
		setSucc("javascript:window.close()");
	}
}
function setNum(x)
{
	if (x>0 && nfoto<5) {
		setPrec("javascript:setNum("+(x-1)+")");
		setSucc("javascript:setNum("+(x+1)+")");
	} else if (x==0) {
		setPrec("javascript:window.close()");
		setSucc("javascript:setNum("+(1)+")");
	} else {
		setPrec("javascript:setNum("+(5)+")");
		setSucc("javascript:window.close()");
	}
	setImg(foto[x]);
}
