function _(_id){
  return document.getElementById(_id);
}


function confirm_send(){
    _nombre=_('nombre').value;
    _email=_('email').value;
    _telefono=_('telefono').value;
    _apellido=_('apellido').value;
    _mensajes=_('mensajes').value;

    var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
    if(_nombre==""){
       alert("Para poder suscribirte necesitas escribir tu nombre");
       _('nombre').focus();
       return false;
    }else if(_apellido==""){
       alert("falta introducir tu apellido");
       _('apellido').focus();
       return false;
    }else if (pattern.test(_email)==false){
       alert("Tu email proporcionado es incorrecto");
       _('email').focus();
       return false;
    }else if(_telefono==""){
       alert("Para poder suscribirte necesitas escribir tu telefono");
       _('telefono').focus();
       return false;
    }else if(_mensajes==""){
       alert("falta introducir tu mensaje");
       _('mensajes').focus();
       return false;
    }else{
      alert("Sus datos se han enviado con éxito, gracias.");
      return true;
    }

}

function sendFriend(){
	__url=location.href.toString();
	var docTitle = document.title.toString();
	window.open('http://www.doctorweb.org/enviar/'+b64.encode(__url)+":"+b64.encode(docTitle),'win2','width=410,height=380,menubar=no,resizable=no,scrollbars=no,titlebar=no,directories=no,location=no');
	
}
