function validarText(id, mensaje)
{
    var text = document.getElementById(id);
    
    if (text.value == '')
    {
        //text.className = cssError;
        alert(mensaje);            
        text.focus();
        return false;
    }
    
    //text.className = css;        
    return true;
}

function validarTextValorDefecto(id, valorDefecto, mensaje)
{
    var text = document.getElementById(id);
    
    if (text.value == valorDefecto)
    {
        //text.className = cssError;
        alert(mensaje);            
        text.focus();
        return false;
    }
    
    //text.className = css;        
    return true;
}

function validarEMail(id, mensaje)
{
    var text = document.getElementById(id);
    
    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

    var address = text.value;

    if(reg.test(address) == false)
    {
       alert(mensaje);
       text.focus();
       return false;
    }

    return true;
}

