/*
 * Receives the tab forward event supplied from the previous window supplied.
 */
function receiveTabForwardEvent(theFromWindow, theEvent) {
  window.setTimeout("setFocusToLastName()", 10);
}

/*
 * Receives the tab backward event supplied from the previous window supplied.
 */
function receiveTabBackwardEvent(theFromWindow, theEvent) {
  window.setTimeout("setFocusToSearchButton()", 10);
}

/*
 * Sets focus to the last name.
 */
function setFocusToLastName() {
  window.focus();
  var lastName = xGetElementById("lastName");

  if (lastName != null) {
    lastName.focus();
  }
}

/*
 * Sets focus to the first name.
 */
function setFocusToFirstName() {
  window.focus();
  var firstName = xGetElementById("firstName");

  if (firstName != null) {
    firstName.focus();
  }
}

/*
 * Sets focus to the middle name.
 */
function setFocusToMiddleName() {
  window.focus();
  var middleName = xGetElementById("middleName");

  if (middleName != null) {
    middleName.focus();
  }
}

/*
 * Sets focus to the company name.
 */
function setFocusToCompanyName() {
  window.focus();
  var companyName = xGetElementById("companyName");

  if (companyName != null) {
    companyName.focus();
  }
}

/*
 * Sets focus to the search button.
 */
function setFocusToSearchButton() {
  window.focus();
  var searchButton = xGetElementById("searchButton");

  if (searchButton != null) {
    searchButton.focus();
  }
}

/*
 * Initialize the page with registering hot keys and setting focus to last name.
 */
function initializePage() {

  window.setTimeout("setFocusToLastName()", 10);
}

/*
 * Cleanup the page with unregistering hot keys.
 */
function cleanupPage() {

}

