// BW*Wizard-built JavaScript

var formSubmitted = "N";
var testuserId = "";
var testuserPassword = "";
var helpWindow
var currentDate = new Date()
var currentYear = currentDate.getYear()
var maxYear = currentYear + 30;

function GoToButton_onClick_func(selIndex) {

   if (helpWindow) {

      helpWindow.close()
      helpWindow = null

   }

   isudTarget = isudSelectionTarget[selIndex]

   if ((isudTarget.substring(0,5) == "http:") 
     || (isudTarget.substring(0,6) == "https:")) {
     
      location.href = isudTarget

   }
   else {
      
      isudSel = isudSelectionSel[selIndex]
      document.MyLogonForm.actionInd.value = "TRANSFER"
      document.MyLogonForm.mappingTarget.value = isudSel;
      document.MyLogonForm.submit()

   }

}


function onKeyPress () {

   var keycode;

   if (window.event) keycode = window.event.keyCode;
   else if (e) keycode = e.which;
        else return true;

   if (keycode == 13) {
       Button_onClick("LOGON");
       return false
   }

   return true

}

function BackButton_onClick_func() {

   window.status = ""

   if (helpWindow) {
     helpWindow.close()
     helpWindow = null
   }


   document.MyLogonForm.mappingTarget.value = "!CANCEL"; 
   document.MyLogonForm.actionInd.value = "TRANSFER"
   document.MyLogonForm.submit()

}

function CancelButton_onClick_func() {

   window.status = ""

   if (helpWindow) {
     helpWindow.close()
     helpWindow = null
   }


   document.MyLogonForm.mappingTarget.value = "!CANCEL"; 
   document.MyLogonForm.actionInd.value = "TRANSFER"
   document.MyLogonForm.submit()

}

function HomeButton_onClick_func() {

   window.status = ""

   if (helpWindow) {
     helpWindow.close()
     helpWindow = null
   }

   document.MyLogonForm.mappingTarget.value = "!HOME"; 
   document.MyLogonForm.actionInd.value = "TRANSFER"
   document.MyLogonForm.submit()

}

function HelpButton_onClick_func(helpField) {

   window.status = ""

   if (helpWindow) {
     helpWindow.close()
     helpWindow = null
   }

   if ((mouseX + 500) > screen.availWidth) {

      mouseX = screen.availWidth - 550
      mouseY = mouseY + 40

   }


   if ((mouseY + 600) > screen.availHeight) {

      mousey = screen.availWidth - 650

   }

   helpWindow = window.open(document.MyLogonForm.webContext.value+"MyLogonHelp.htm?" + helpField,
     "MyLogonHelp",
     "top="+mouseY+",left="+mouseX+",width=500,height=600,"
     + "dependent=yes,resizable=yes,scrollbars=yes")

   helpWindow.focus();

}


function Button_onClick(Command) {

   if (formSubmitted == "Y") {

      alert("Processing........, please wait")
      return

   }

   formSubmitted = "Y";

   if (Command == "LOGON") {
      LogonButton_onClick_func()
      return
   }

   if (Command == "LOGOFF") {
      LogoffButton_onClick_func()
      return
   }

   if (Command == "BACK") {
      BackButton_onClick_func()
      return
   }

   if (Command == "CANCEL") {
      CancelButton_onClick_func()
      return
   }

   if (Command == "HOME") {
      HomeButton_onClick_func()
      return
   }
   formSubmitted = "N";

   if (Command == "HELP") {
      HelpButton_onClick_func()
      return
   }

   alert("Unsupported Option - " + Command)

}


function LogonButton_onClick_func() {

   window.status = "Request being processed"

   document.MyLogonForm.actionInd.value = "LOGON"
   document.MyLogonForm.submit()

}

function LogoffButton_onClick_func() {

   window.status = "Request being processed"

   document.MyLogonForm.actionInd.value = "LOGOFF"
   document.MyLogonForm.submit()

}




function local_opendoc() {

   window.status = ""

    focusNotSet = true;

    for (var i=0;i<document.MyLogonForm.elements.length;i++) {

       if (document.MyLogonForm.elements[i].type!="hidden") {

          eval(" part = document.MyLogonForm."+document.MyLogonForm.elements[i].name+"GUIState");
          //alert("Type - "+document.MyLogonForm.elements[i].type.substring(0,6))
          //alert("Part - " + part);
          //alert("Part name - " + part.name);
          //alert("Part value - " + part.value);

          if ((part)
            && (part.value == true)) {

             if (document.layers) {

                //Netscape 4 only
                document.MyLogonForm.elements[i].onfocus=document.MyLogonForm.elements[i].blur;

             }
             else {

                if (document.MyLogonForm.elements[i].type=="text") {

                   document.MyLogonForm.elements[i].readonly=true;
                   document.MyLogonForm.elements[i].disabled=true;

                }
                else {

                   document.MyLogonForm.elements[i].disabled=true;

                }

             }

          }
          else {

             if (focusNotSet) {

                if (document.MyLogonForm.elements[i].type=="text") {
                   document.MyLogonForm.elements[i].focus();
                   document.MyLogonForm.elements[i].select();
                }

                //document.MyLogonForm.elements[i].select();
                focusNotSet = false;

             }

          }

       }

    }

}


function local_closedoc() {

   if (helpWindow) {
     helpWindow.close()
     helpWindow = null
   }

}


 // end of BW*Wizard-built JavaScript


