/**
 * Bridge XMLHTTP to XMLHttpRequest in pre-7.0 Internet Explorers
 */
if( typeof XMLHttpRequest == "undefined" ) XMLHttpRequest = function()
{ try{ return new ActiveXObject("Msxml2.XMLHTTP.6.0") }catch(e){}
  try{ return new ActiveXObject("Msxml2.XMLHTTP.3.0") }catch(e){}
  try{ return new ActiveXObject("Msxml2.XMLHTTP") }catch(e){}
  try{ return new ActiveXObject("Microsoft.XMLHTTP") }catch(e){}
  throw new Error("This browser does not support XMLHttpRequest or XMLHTTP.")
};

function auth ()
{ var login = document.getElementById("login")
  var pwd = document.getElementById("pwd")
  var oReq = new XMLHttpRequest
  oReq.open("GET","login.asp?login=" + login.value + "&pwd=" + pwd.value,false)
  oReq.send('')
  var result = oReq.responseText.substr(0,2)
  pwd.value = ""
  pwd.focus()
  if (oReq.statusText != "OK")
  { alert(oReq.statusText) }
  else if (result == "OK")
  { window.open(contentpath + oReq.responseText.substr(4),'_blank') }
  else if (result == "AD")	// ADMIN login
  { window.open('admin/listOpps.asp','Administration') }
  else
  { alert (oReq.responseText) }
}
