//
var fin=null;

function ImgPopUp(img, titolo, width, height) {
	if (fin && !fin.closed){		// chiude le finestre aperte
		fin.close()
	}

	var basehref = "http://www.flycastelluccio.at/cms/";

	if (!img.match(/^(http:\/\/|\/)/g)) img = basehref + img;

	var xc = screen.width;
	var yc = screen.height;
	fin="";

	var cntxc = Math.round(( xc / 2 ) - ( width / 2 ));
	var cntyc = Math.round(( yc / 2 ) - (( height * 9 ) / 10 ));

	if(height < 481){var scroll = "no";} else {var scroll = "yes";height = 450;width = Math.round(width + 18);}
	if(width > xc){width = Math.round(( xc ) - ( xc / 4 ));}

	fin=open ('','_blank','scrollbars=' + scroll + ',status=no,menubar=no,toolbar=no,location=no,directories=no,resizable=yes,copyhistory=no,left=' + cntxc + ',top=' + cntyc + ',width=' + width + ',height=' + Math.round(height+18));
	fin.document.open();
	fin.document.write("<html><head><title>");
	fin.document.write(titolo);
	fin.document.write("</title></head><body bgcolor=#000000 topmargin=5 marginheight=5 leftmargin=5 marginwidth=0>");
	fin.document.write("<a href=\"javascript:window.close()\"><img src=\""+img+"\" border=0 align=top><br><a href=#><img src=\"http://www.flycastelluccio.at/cms/upload/exit.gif\" border=0 vspace=4 hspace=5 onclick=\"javascript:window.close();\" align=right></a>");
	fin.document.write("</body></html>");
	fin.focus();
}

//
function PagPopUp(pag,width, height) {

	var xc = screen.width;
	var yc = screen.height;

	var cntxc = Math.round(( xc / 2 ) - ( width / 2 ));
	var cntyc = Math.round(( yc / 2 ) - (( height * 9 ) / 10 ));

	window.open (pag,'_blank','scrollbars=yes,status=yes,menubar=no,toolbar=no,location=no,directories=no,resizable=yes,copyhistory=no,left=0,top=0,width=' + width + ',height=' + height);
}
//
	function PopUp(url, width, height) {

	var xc = screen.width;
	var yc = screen.height;

	var cntxc = Math.round(( xc / 2 ) - ( width / 2 ));
	var cntyc = Math.round(( yc / 2 ) - (( height * 9 ) / 10 ));

	window.open (url,'_blank','scrollbars=yes,status=no,menubar=no,toolbar=no,location=no,directories=no,resizable=yes,copyhistory=yes,left=' + cntxc + ',top=' + cntyc + ',width=' + width + ',height=' + height);
}
//self.onerror = function() { return true } // Elimina eventuali messaggi di errore nella pagina.
//
// ciao ciao
