var IE = 0, NN = 0
var s = navigator.userAgent
var user = ''
var nouserpass=false

if (s == '')
  IE = 3
else if (s.indexOf('MSIE') != -1)
  IE = parseFloat(s.substring(s.indexOf('MSIE') + 5, s.length))
else if (s.indexOf('Mozilla') != -1)
  NN = parseFloat(s.substring(s.indexOf('Mozilla') + 8, s.length))

if (window.location.search) {
  if (window.location.search.substring(0,12) == '?nouserpass=') {
    nouserpass = true;
    user = window.location.search.substring(12, window.location.search.length);
  }
  else
    user = window.location.search.substring(6, window.location.search.length);
}

function trimLeadingSpaces(str){
  var i=0;
  while (str.charAt(i)==' ') i++
  return str.substring(i)
}

function login() {
  var form
  if (document.forms[0].elements[0].value == '' || document.forms[1].elements[0].value == '') {
    nouserpass = true;
    user = trimLeadingSpaces(document.forms[0].elements[0].value);
    document.location = '?nouserpass='+user;
    return;
  }
  form = document.forms[2]
  form.target = ''
  //bugfix for bug# 5040114 -- Rohit Potnis (05/04/2003)
  form.user.value = trimLeadingSpaces(document.forms[0].elements[0].value)
  form.password.value = document.forms[1].elements[0].value
  document.forms[0].elements[0].value = ''
  document.forms[1].elements[0].value = ''
  form.submit()
}

function post() {
  login()
  return false
}

// which keeps track of the currently selected tab
var which="none";

// Function to 'turn-off' all imx.
function imageoff() {
  //document.documentation.src = documentationoff.src;
  //document.support.src = supportoff.src;
  document.bannerlinkone.src = bannerlinkoneoff.src;

}

// Function to 'turn-on' the target image.
function imageon(imgName) {
  document[imgName].src = eval(imgName + "on.src");
}

// Function to 'load the content page and swap tab imx'.
function loadandswap(imgName, contentName) {
  imageoff();
  imageon(imgName);
  which=imgName;
}

// Function to handle mouse overs
function over(imgName) {
  if (which!=imgName) 
    document[imgName].src= eval(imgName + "over.src");

  else return false;
}

// Function to handle mouse outs
function out(imgName) {
  if (which!=imgName) 
    document[imgName].src= eval(imgName + "off.src");

  else return false;
}