
window.onload = function OnLoad()
{
	PatchLink();
	Init();
}

function Init(){}

function PatchLink()
{
	for (var i=0; i<document.links.length; i++)
        if (document.links[i].className.search("target_blank") >= 0)
			document.links[i].target="_blank";
}

function OpenNews(idObject)
{
	window.open("idObject", "News", "width=600,height=400,status=yes,toolbar=no,menubar=no,location=no,resizable=yes").focus(); 
}

function OpenEvento(idObject)
{
	window.open("idObject", "Evento", "width=600,height=400,status=yes,toolbar=no,menubar=no,location=no,resizable=yes").focus(); 
}

function OpenInnerLink(idObject, idDoc, width, height)
{
	if ( isNaN(parseInt(idObject, 10)) )
		return;

	var url = "Box.asp?IdObject=" + idObject;
	if ( !isNaN(parseInt(idDoc, 10)) )
		url += "&IdDoc=" + idDoc;
	
	width = ( width == null ? 600 : width );
	height = ( height == null ? 400 : height );
	
	window.open(url, "Box_"+idObject, "width=" + width + ", height=" + height + ", location=no, menubar=no, toolbar=yes, resizable=yes, scrollbars=yes, status=yes, titlebar=yes").focus();
}

function OpenInnerRef(idObjectUrl, width, height)
{
	if (!isNaN(parseInt(idObjectUrl)))
		return OpenInnerLink(idObjectUrl, null, width, height);

	width = width == null ? 600 : width;
	height = height == null ? 400 : height;

	window.open(idObjectUrl, "_blank", "width=" + width + ", height=" + height + ", location=no, menubar=no, resizable=yes, scrollbars=yes, status=yes, titlebar=yes").focus();
}

function PrintArticolo(idObject)
{
	window.open("Print.asp?IdObject="+idObject, "_blank", "width=600, height=500, location=yes, menubar=yes, resizable=yes, scrollbars=yes, status=yes, titlebar=yes").focus();
}

function OpenImage(idObject, idDoc)
{
	window.open("Image.asp?IdObject="+ idObject +"&IdDoc="+ idDoc, "_blank", "scrollbars=yes,resizable=yes,width=600,height=450");
}

function OpenGallery(idObject)
{
	window.open("Gallery.asp?IdObject="+ idObject, "_blank", "scrollbars=yes,resizable=yes,width=600,height=500");
}

function DoAggiornaCalendario(idMenu)
{
	var mese = document.getElementById("Calendario_SELECT_Month").value;
	var anno = document.getElementById("Calendario_SELECT_Year").value;
	var event = anno +"-"+ mese;
	window.document.location = "Menu.asp?IdMenu="+ idMenu +"&Event="+ event;
}

function DoEventiMeseCorrente(idMenu)
{
	var d = new Date();
	var mese = d.getMonth()+1;
	var anno = d.getFullYear();
	var event = anno +"-"+ mese;
	window.document.location = "Menu.asp?IdMenu="+ idMenu +"&Event="+ event;
}

function DoEventiMese(idMenu)
{
	var mese = document.getElementById("Calendario_SELECT_Month").value;
	var anno = document.getElementById("Calendario_SELECT_Year").value;
	var event = anno +"-"+ mese;
	window.document.location = "Menu.asp?IdMenu="+ idMenu +"&Event="+ event;
}

function DoEventiAnno(idMenu)
{
	var anno = document.getElementById("Calendario_SELECT_Year").value;
	var event = anno;
	window.document.location = "Menu.asp?IdMenu="+ idMenu +"&Event="+ event;
}

/*

var AspIdLanguage = <%= AspIdLanguage %>;

function GetTema()
{
	for (var i=2; i<MenuLeftList.length; i++)
		if (MenuLeftList[i][0] == <%= AspTema %>)
			return MenuLeftList[i][1][AspIdLanguage];
	return "";
}

function OpenNumero(url)
{
	window.open(url);
}

function OpenArticolo(idObject)
{
	window.location = "Articolo.asp?lingua=<%= AspLanguage %>&IdObject="+idObject;
}

// Logout (Admin Toolbar).
function Logout()
{
	CookieDel("<%= AspCookieName %>");
	document.location.reload();
}

*/
