/*
 * MappaTo JavaScript Library v1.0.0
 * http://www.comune.torino.it/
 * Copyright (c) 2009 Comune di Torino
 * Module licensed under GNU Affero GPL licenses.
 * http://www.gnu.org/licenses/agpl.html
 * Date: 2009
 */
function CheckContext()
{
	this.formCheckContext = null;
	this.check1_1 = null;
	this.check1_2 = null;
	this.check1_3 = null;
	this.send = function(ev, obj)
	{
		//objLibs.printMsgBox("***********************");
		//objLibs.printMsgBox("clickH3 - start");
		if(!objLibs.isObj(obj)) obj = this;
		if(objLibs.isObj(obj))
		{
			//objLibs.printMsgBox(this.formCheckContext.action);
			//objCheckContext.formCheckContext.action = objLabels.currentServer+'include.php';
			//objLibs.printMsgBox(this.formCheckContext.action);
			objCheckContext.formCheckContext.submit();
		}
		//objLibs.printMsgBox("clickH3 - end");
		return false;
	};
	this.initEvents = function()
	{
		if(objLibs.isObj(objCheckContext.check1_1))
			objCheckContext.check1_1.onclick = objCheckContext.send;
		if(objLibs.isObj(objCheckContext.check1_2))
			objCheckContext.check1_2.onclick = objCheckContext.send;
		if(objLibs.isObj(objCheckContext.check1_3))
			objCheckContext.check1_3.onclick = objCheckContext.send;
	};
	this.init = function()
	{
		this.formCheckContext = document.getElementById("formFunzioniCalendari");
		this.check1_1 = document.getElementById("check1_1");
		this.check1_2 = document.getElementById("check1_2");
		this.check1_3 = document.getElementById("check1_3");
		this.initEvents();
	};
}

/* Initialize CheckContext sigleton */
function initCheckContext()
{
	objCheckContext = new CheckContext();
	objCheckContext.init();
}

function initCheckContextOnLoad()
{
	if (typeof oldOnLoadCheckContext == 'function') oldOnLoadCheckContext();
	initCheckContext();
}

/* Var sigleton instance*/
var objCheckContext;

/* Event initialize */
var oldOnLoadCheckContext;
if (typeof window.onload == 'function') 
	oldOnLoadCheckContext = window.onload;
window.onload = initCheckContextOnLoad;
