﻿function SendMail_Validator(LanguageId) 
{

    var control = document.getElementById("ctl00_content_txNome");

    if (control.value == "") 
    {
        if(LanguageId == "it-IT")
            alert('Completare il campo \"Nome\" per proseguire.');
        else
            alert('Please enter a value for the \"Name\" field.');
            
        control.focus();
        return (false);
    }

    control = document.getElementById("ctl00_content_txCognome");
    if (control.value == "") 
    {
        if(LanguageId == "it-IT")
            alert('Completare il campo \"Cognome\" per proseguire.');
        else
            alert('Please enter a value for the \"Surname\" field.');
            
        control.focus();
        return (false);
    }

    control = document.getElementById("ctl00_Content_txAzienda");
    if (control.value == "") 
    {
        if(LanguageId == "it-IT")
            alert('Completare il campo \"Azienda\" per proseguire.');
        else
            alert('Please enter a value for the \"Company\" field.');
            
        control.focus();
        return (false);
    }

    control = document.getElementById("ctl00_Content_txIndirizzo");
    if (control.value == "" || control.value == "0") 
    {
       if(LanguageId == "it-IT")
            alert('Completare il campo \"Indirizzo\" per proseguire.');
        else
            alert('Please enter a value for the \"Address\" field.');
            
        control.focus();
        return (false);
    }

    control = document.getElementById("ctl00_Content_txCitta");
    if (control.value == "") 
    {
        if(LanguageId == "it-IT")
            alert('Completare il campo \"Città\" per proseguire.');
        else
            alert('Please enter a value for the \"City\" field.');
            
        control.focus();
        return (false);
    }

    control = document.getElementById("ctl00_Content_txNazione");
    if (control.value == "") {
        if (LanguageId == "it-IT")
            alert('Completare il campo \"Nazione\" per proseguire.');
        else
            alert('Please enter a value for the \"State\" field.');

        control.focus();
        return (false);
    }
    
    control = document.getElementById("ctl00_Content_txCap");
    if (control.value == "") 
    {
        if (LanguageId == "it-IT")
            alert('Completare il campo \"Cap\" per proseguire.');
        else
            alert('Please enter a value for the \"Zip-Code\" field.');

        control.focus();
        return (false);
    }

    

    control = document.getElementById("ctl00_Content_txNumeroTelefonico");
    if (control.value == "") 
    {
        if (LanguageId == "it-IT")
            alert('Completare il campo \"Telefono\" per proseguire.');
        else
            alert('Please enter a value for the \"Telephone\" field.');

        control.focus();
        return (false);
    }

    control = document.getElementById("ctl00_Content_txEmail");
    if (control.value == "") {
        if (LanguageId == "it-IT")
            alert('Completare il campo \"EMail\" per proseguire.');
        else
            alert('Please enter a value for the \"EMail\" field.');

        control.focus();
        return (false);
    }
    
    control = document.getElementById("ctl00_Content_txCommenti");
    if (control.value == "") 
    {
        if (LanguageId == "it-IT")
            alert('Completare il campo \"Commenti\" per proseguire.');
        else
            alert('Please enter a value for the \"Your comments\" field.');

        control.focus();
        return (false);
    }
   
    return (true);
}