﻿// Funzione per Redirect
function Redirect(url)
{
	document.location.href = url;
}

// Funzione per mostra/nascondi Menu
function ToggleMenu(voceMenu)
{
	divMenu = document.getElementById(voceMenu);
	
	if(divMenu.style.display == 'none')
		divMenu.style.display = 'inline';
	else
		divMenu.style.display = 'none';
}

// Funzione per visualizzazione allegati News
function OpenDocument(filePath)
{
    var xLen = screen.width - 100;
    var yLen = screen.height - 100;
	var xPos = (screen.width - xLen) / 2;
	var yPos = (screen.height - yLen) / 2;
	
	var win = window.open(filePath, 'News', 'width=' + xLen + ', height=' + yLen + ', left=' + xPos + ', top=' + yPos + ', scrollbars=0, resizable=1');
	
	win.focus();
}

// Funzione per visualizzazione PopUp Foto Gallery
function OpenPhoto(filePath, xLen, yLen)
{
	var xPos = (screen.width - xLen) / 2;
	var yPos = (screen.height - yLen) / 2;
	
	var win = window.open(filePath, 'Foto', 'width=' + xLen + ', height=' + yLen + ', left=' + xPos + ', top=' + yPos + ', scrollbars=0, resizable=1');

	win.focus();
}

// Funzione per conferma azione
function Confirm(text)
{
    if (!confirm(text))
        return false;
}
