//<![CDATA[

//store names here for login.webops.com
var loginCompanies = ["stryker","crosslink","crosslink medical","amc","team","osteologic","surgitech","surgi-care","k&w"];

//store names here for wright.webops.com
var wrightCompanies = ["wright","peak"];

function evalLogin() {
    
    var companyCheck = checkCompany(document.getElementById("company").value.toLowerCase());
    switch(companyCheck) {
      case 1:
        location.href = "http://login.webops.com/";
        break;
      case 2:
        location.href = "http://wright.webops.com/";
        break;
      default:
        alert("We cannot locate your company in our system.\n" +
              "If you feel that you have reached this message in error,\n" +
              "please contact us at http://www.webops.com/contact");
    }
}

function evalOnReturnKey(evt) {
  evt = (evt) ? evt : event;
  var charCode = (evt.charCode) ? evt.charCode :
      ((evt.which) ? evt.which : evt.keyCode);
  if (charCode == 13 || charCode == 3) {
    evalLogin();
    return false;
  }
  return true;
}

function checkCompany(cname) {
  var returnVal = 0;
  for (var i = 0; i < loginCompanies.length; i++) {
    if (loginCompanies[i] == cname) {
      returnVal = 1;
    }
  }
  for (var i = 0; i < loginCompanies.length; i++) {
    if (wrightCompanies[i] == cname) {
      returnVal = 2;
    }
  }
  return returnVal;
}

//]]>