//alternativa al target _blank STRICT
window.addEvent('domready', function(){
 $$('a').each(function(el){
  if (el.get('rel') == 'external')
    el.set('target', '_blank');
 });
});

function SelectAll(id) {
  document.getElementById(id).focus();
  document.getElementById(id).select();
}

// lnk deve essere già "escaped"
function partner(lnk) {
  window.open("http://www.eljardindellibro.com/partner.php?link="+lnk, "_blank");
}

// Nota Bene: Inserire questo controllo sia sull'onSubmit della FORM (x IE) che nell'onSubmit del pulsante di submit (x Mozilla)
function lib_check_mail(address, msg_txt)
  {
  if (msg_txt == null)
    msg_txt = "Atención, dirección e-mail incorrecta.";
  re = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
  if (!re.test(address))
    {
    if (msg_txt != "")
      alert(msg_txt);
    return false;
    }
  else
    return true;
  }