// Next Utility Javascript

function apri(cosa,titolo,larghezza,altezza)
{       
		var w1
		var h1
		var str1
		
		if( larghezza == 0 ) { larghezza = 420; }
		if( altezza == 0 )   { altezza = 420; }
		
		w1= (screen.availWidth-larghezza)-50
		str1=',screenX='+w1+',screenY='+h1+',left=50,top=50'
		var aa = window.open(cosa,titolo,'toolbar=no,location=no,directories=no,status=no,menu=no,scrollbars=no,resizable=no,width='+larghezza+',height='+altezza+str1,true);
		return;
}
function checkSize(w,h) {
         window.resizeTo(w,h);
}

function loadCombo(obj, aValues, aText)
{
	var l = obj.options.length;
	for(i=1;i<l;i++)
		obj.options.remove(1);
		
	for(i=0;i<aValues.length;i++)
	{
		var oOption = document.createElement("OPTION");
		obj.options.add(oOption);
		oOption.innerText = aText[i];
		oOption.value = aValues[i];
	}
}

function checkAll(theForm, partName, action) {
        frm = eval('document.'+ theForm)
    for (i=0,n=frm.elements.length;i<n;i++)
        if (frm.elements[i].name.indexOf(partName) !=-1) {
                        if (action == 1)
                    frm.elements[i].checked = true;
                        if (action == 0)
                    frm.elements[i].checked = false;
                        if (action == -1)
                    frm.elements[i].checked = !(frm.elements[i].checked);
                }
}

function switchVisibility(nomeElemento){
	element = document.getElementById(nomeElemento);
    if (element.style.display == 'none')
        element.style.display = 'inline';
    else
        element.style.display = 'none';
}

