﻿// JScript File
function ValidateCheckBoxProdottiUpdate(id1,id2,id3)
{
   el1=document.getElementById(id1);
   el2=document.getElementById(id2);
   el3=document.getElementById(id3);
   //el4=document.getElementById(id4);
    if(el1.checked==true || el2.checked==true || el3.checked==true)
    {
        if(confirm('Sei Sicuro di voler Modificare il Prodotto')) return true;
        else return false;
        
    }
    else
    {
        alert('Selezionare almeno una delle voci: LOTTO - SERIAL NUMBER - ENCODE');
        return false;
    }
}
    
function ValidateCheckBoxProdottiInsert(id1,id2,id3)
{
   el1=document.getElementById(id1);
   el2=document.getElementById(id2);
   el3=document.getElementById(id3);
    if(el1.checked==true || el2.checked==true || el3.checked==true)
    {
        return true;
        
    }
    else
    {
        alert('Selezionare almeno una delle voci: LOTTO - SERIAL NUMBER - ENCODE');
        return false;
    }
} 

function scrollbottom()
{
    var objDiv = document.getElementById('ctl00_ctl00_body_content_divScontrino');
    objDiv.scrollTop = objDiv.scrollHeight;
}
function RiempiRagioneSocialeRivenditore(id, valore1, valore2,table1,table2,table3,control0,control1,control2,control3,control4,control5,control6,control7,modifica_rivenditore_altro) {

    e = document.getElementById(id);
    e1 = document.getElementById(table1);
    e2 = document.getElementById(table2);
    e3 = document.getElementById(table3);

    c0 = document.getElementById(control0);
    c1 = document.getElementById(control1);
    c2 = document.getElementById(control2);
    c3 = document.getElementById(control3);
    c4 = document.getElementById(control4);
    c5 = document.getElementById(control5);
    c6 = document.getElementById(control6);
    c7 = document.getElementById(control7);

    if (valore2 == 0) {
        if (e != null) {
            if (modifica_rivenditore_altro) {
                
            }
            else {
                e.value = '';
            }
            e.disabled = false;
        }
        if (e1 != null) {
            e1.style.display = "block";
        }
        if (e2 != null) {
            e2.style.display = "block";
        }
        if (e3 != null) {
            e3.style.display = "block";
        }
        if (e != null) {
            ValidatorEnable(c0, true);
        }
        if (c1 != null) {
            ValidatorEnable(c1, true);
        }
        if (c2 != null) {
        ValidatorEnable(c2, true);
        }
        if (c3 != null) {
        ValidatorEnable(c3, true);
        }
        if (c4 != null) {
        ValidatorEnable(c4, true);
        }
        if (c5 != null) {
        ValidatorEnable(c5, true);
        }
        if (c6 != null) {
        ValidatorEnable(c6, true);
        }
        if (c7 != null) {
        ValidatorEnable(c7, true);
        }
    }
    else {
        if (e != null) {
            if (modifica_rivenditore_altro) {
            }
            else {
                e.value = valore1;
            }
            e.disabled = true;
        }
        if (e1 != null) {
            e1.style.display = "none";
        }
        if (e2 != null) {
            e2.style.display = "none";
        }
        if (e3 != null) {
            e3.style.display = "none";
        }
        if (c0 != null) {
        ValidatorEnable(c0, false);
        }
        if (c1 != null) {
        ValidatorEnable(c1, false);
        }
        if (c2 != null) {
        ValidatorEnable(c2, false);
        }
        if (c3 != null) {
        ValidatorEnable(c3, false);
        }
        if (c4 != null) {
        ValidatorEnable(c4, false);
        }
        if (c5 != null) {
        ValidatorEnable(c5, false);
        }
        if (c6 != null) {
        ValidatorEnable(c6, false);
        }
        if (c7 != null) {
        ValidatorEnable(c7, false);
    }
        //alert(c1);
    }

}
