﻿function PostLoadHandler()
{
  if (getId("txtPassword").value == "")
  {
    getId("txtPassword").focus();
  }
  else if (getId("txtUsername").value == "")
  {
    getId("txtUsername").focus();
  }
  else 
  {
    getId("txtClientID").focus();
    getId("txtClientID").select();
  }
  UpdateChecks();
}

function UpdateChecks()
{
  if (getId("chkSaveLogin").checked)
  {
    getId("chkSavePassword").disabled = false;
  }
  else
  {
    getId("chkSavePassword").disabled = true;
    getId("chkSavePassword").checked = false;
  }
}

function FocusPassword()
{
  if (getId("txtPassword").value=="[password]")
  {
    getId("txtPassword").value = "";
  }
}

function Click_OK()
{
  if (EmptyField("txtClientID","Client ID")) return false;
  if (EmptyField("txtUsername","Username")) return false;
  if (EmptyField("txtPassword","Password")) return false;
  FormSubmit(getId("LA").value);
}

function ShowLoginInfo()
{
  ShowDynamicDialog("WebManager Login Information", "<iframe src='" + getId("LI").value + "' style='width: 600px; height: 240px; border: 0px;' allowtransparency='true' frameborder='0' scrolling='no'></iframe><br/>");
}

function DialogOkHandler()
{
  getId("xAction").value = getId("xAlertAccept").value;
  FormSubmit(getId("LA").value);
}

function DialogCancelHandler()
{
  return false;
}

function DialogCloseHandler()
{
  if (getId("xAlertAccept").value == "CookiesRequired")
  {
    window.location.reload();
  }
  return false;
}

function PrintServAgmt()
{
  if (document.all)
  {
    document.ServAgmtFrame.focus();
    document.ServAgmtFrame.print();
  }
  else
  {
    window.frames['ServAgmtFrame'].focus();
    window.frames['ServAgmtFrame'].print();
  }
}
