// JScript File
function SaveContact()
{
    errors = "";
    if (trim($("txName").value).length <= 0)
    {
        errors +=  getJSPH("Cariera_CompletatiNume");
    }
    
//    if (trim($("txFirm").value).length <= 0)
//    {
//        errors += getJSPH("Contact_CompletatiFirma");
//    }
//    if (trim($("txPhone").value).length <= 0)
//    {
//        errors += getJSPH("Cariera_CompletatiTelefon");
//    }        

    if (trim($("txPhone").value).length > 0)
    {
        if( !isPhoneValid( $("txPhone").value) )
        {
            errors += getJSPH("Cariera_TelefonValid");
        }
    }

    
    if (trim($("txEmail").value).length > 0)
    {
        if( !isEmail( $("txEmail").value) )
        {
            errors += getJSPH("Contact_EmailValid");
        }
    }
    
    else
    {
        errors += getJSPH("Contact_CompletatiEmail");
    }   
    
//    if ($("ddAddressees").value == 0)
//    {
//        errors += getJSPH("Contact_CompletatiDestinatar");
//    }
    
     if (trim($("txMsg").value).length <= 0)
    {
        errors += getJSPH("Contact_CompletatiMesaj");
    }
    if (errors.length > 0)
    {
        alert(getJSPH("Contact_RemediatiProblemele") +errors);        
    }
    else
    {
        document.getElementById("hAction").value = "SaveContact";    
        document.getElementById("frmMain").submit();
    }
}


