
function EnviarRecomendacion() {
    var reg1 = new RegExp("[\{\}\';\"]+");

    with (document.opinion) {
    	if (nombre.value=="")
    	{
    	    Avisos("Debes de completar tu nombre.","CerrarPopup()","Aceptar",true);
    	    return false
    	}else if (tuemail.value=="")
		{
		    Avisos("Debes de completar tu e-mail.","CerrarPopup()","Aceptar",true);
            return false
		}else if( tuemail.value.search(regEmail)!=0) {
            Avisos("Formato de e-mail inválido.","CerrarPopup()","Aceptar",true);
            return false
        }else if (emaildest.value=="")
        {
            Avisos("Debes de completar el e-mail del destinatario.","CerrarPopup()","Aceptar",true);
            return false
        }else if( emaildest.value.search(regEmail)!=0) {
            Avisos("Formato de e-mail inválido.","CerrarPopup()","Aceptar",true);
            return false
        }else{
            try
            {
                if(recaptcha_response_field.value=="")
                {
                    Avisos("Debes de completar el codigo de seguridad","CerrarPopup()","Aceptar",true);
                }else{
                    
	   	            command.value="envio";
	   	            Avisos("Enviando recomendación...","location.reload();","Cancelar");
	   	            submit();
                }
             }catch(err){
                command.value="envio";
   	            Avisos("Enviando recomendación...","location.reload();","Cancelar");
   	            submit();
               
             }   
           
    	}
     }   
}

function LengMax(longitud)
{
	var texto=document.opinion.comentario.value
	if (texto.length>longitud)
	{		
		document.opinion.comentario.value=texto.substr(0,longitud)
	    return false
	}else{
	    return true
	}
}

 
function AbrirRecomendar()
{
  
        window.open('/recomienda/default.aspx','_self');
    
}
