<!--

function trim(s) {
var ret = s
  while(ret.charAt(0) == " ") {
    ret = ret.substring(1,ret.length)
  }
  while(ret.charAt(ret.length-1) == " ") {
    ret = ret.substring(0,ret.length-1)
  }
  return ret
}
    
function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}

	// Email Validation Javascript
	// copyright 23rd March 2003, by Stephen Chapman, Felgall Pty Ltd

	// You have permission to copy and use this javascript provided that
	// the content of the script is not changed in any way.

	function validateEmail(addr,man,db) {
	if (addr == '' && man) {
		 if (db) alert('email address is mandatory');
		 return false;
	}
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
		 if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
				if (db) alert('email address contains invalid characters');
				return false;
		 }
	}
	for (i=0; i<addr.length; i++) {
		 if (addr.charCodeAt(i)>127) {
				if (db) alert("email address contains non ascii characters.");
				return false;
		 }
	}

	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
		 if (db) alert('email address must contain an @');
		 return false;
	}
	if (atPos == 0) {
		 if (db) alert('email address must not start with @');
		 return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) {
		 if (db) alert('email address must contain only one @');
		 return false;
	}
	if (addr.indexOf('.', atPos) == -1) {
		 if (db) alert('email address must contain a period in the domain name');
		 return false;
	}
	if (addr.indexOf('@.',0) != -1) {
		 if (db) alert('period must not immediately follow @ in email address');
		 return false;
	}
	if (addr.indexOf('.@',0) != -1){
		 if (db) alert('period must not immediately precede @ in email address');
		 return false;
	}
	if (addr.indexOf('..',0) != -1) {
		 if (db) alert('two periods must not be adjacent in email address');
		 return false;
	}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
		 if (db) alert('invalid primary domain in email address');
		 return false;
	}
	return true;
	}
	




  function checklogin()
  {
      var form_username = document.login.form_username.value;

      form_username = trim(form_username);

      if(form_username == "")
      {
        alert('Please Enter Username');
        document.login.form_username.focus();
        return false;
      }

      var form_password = document.login.form_password.value;

      form_password = trim(form_password);

      if(form_password == "")
      {
        alert('Please Enter Password');
        document.login.form_password.focus();
        return false;
      }

      return true;
  }
	
	
-->

