function setFocus(){if(!$F("imapuser")){$("imapuser").focus()}else{$("pass").focus()}}
function imp_reload(){window.top.document.location=autologin_url+$F("server_key")}
function submit_login()
{
  if(show_list&&$F("server").startsWith("_"))
  {return false}
  if(!$F("imapuser") || $F("imapuser").indexOf("@") < 1)
  {
    alert(IMP.text.login_username);
    $("imapuser").focus();return false
  }
  else
  {
    if(!$F("pass"))
    {
      alert(IMP.text.login_password);
      $("pass").focus();
      return false
    }
    else
    {
      $("loginButton").disable();
      if(ie_clientcaps)
      {
        try
        {
          $("ie_version").setValue(objCCaps.getComponentVersion("{89820200-ECBD-11CF-8B85-00AA005B4383}","componentid"))
        }
        catch(A){}
      }
      $("imp_login").submit();return true
    }
  }
}
function selectLang(){if(!$F("imapuser")&&!$F("pass")){var A={new_lang:$F("new_lang")};if(lang_url!==null){A.url=lang_url}self.location="login.php?"+Object.toQueryString(A)}}
function updatePort(){var A=$F("protocol");if(protocols[A]){$("port").setValue(protocols[A])}}
function serverChangeHandler(){if(change_smtphost){$("smtphost").setValue($F("server"))}}
function removeHash(A){return(Object.isString(A)&&A.startsWith("#"))?A.substring(1):A}document.observe("dom:loaded",function(){if(imp_auth){if(parent.frames.horde_main){if(nomenu){parent.location=self.location}else{document.imp_login.target="_parent"}}}if(location.hash){$("anchor_string").setValue(removeHash(location.hash))}});
