﻿
function openPopup(pURL,pAttributi) {
    var l = (640 - screen.width) / 2;
    var t = (600 - screen.height) / 2;

    var fin = window.open(pURL, null, pAttributi + ',status=1,resizable=yes,scrollbars=1,width=550,height=500');

    //fin.resizeTo(640, 600);
    fin.focus();
}


function showHide(pId) 
{
    var obj = document.getElementById(pId);
    if (obj == null)
        return;

    if (obj.style.display == 'block')
        obj.style.display = 'none';
    else
        obj.style.display = 'block';
    
}

function Espandi(pId)
{
    showHide('p' + pId);
    var obj = document.getElementById('i' + pId);
    if(obj.className == 'apri')
        obj.className = 'chiudi';
    else
        obj.className = 'apri';
}


function select_deselectAll (chkVal, idChk) 
{ 
    var frm = window.document.forms[0];
    for (i=0; i<frm.length; i++) 
        if (frm.elements[i].name.indexOf(idChk) > -1)
            frm.elements[i].checked = chkVal == true;

}


function chiudi() {
    window.opener.location.reload();
    window.Close();
}



function SoloNumeri(e) {
    var keynum;
    var checker = new RegExp("\\d|[.,]");

    if (window.event) // IE
    {
        keynum = e.keyCode;
        window.event.returnValue = checker.test(String.fromCharCode(keynum));
    }
    else if (e.which) {
        // Netscape/Firefox/Opera
        keynum = e.which;
        if (keynum == 8) //--- back o spazio 
            return true;
        else
            return checker.test(String.fromCharCode(keynum));
    }
}

