function MM_openBrWindow(theURL,winName,features) { //v2.0
  newWindow = window.open(theURL,winName,features);
  newWindow.focus();
  return false;
}

function ltrim(val) {
  var valu = val;
  while (valu.charAt(0) == ' ') {
	valu = valu.substr(1);
  }
  return valu;
}

function validateContact(action) {
  var errors = '';
  var k = 13;
  if (document.ContactForm.elements[0].name == 'PHPSESSID') k = 1;
  if (ltrim(document.ContactForm.elements[k].value) == '') errors += '    First Name is required.\n';
  if (ltrim(document.ContactForm.elements[k+2].value) == '') errors += '    Last Name is required.\n';
  if (ltrim(document.ContactForm.elements[k+4].value) == '') errors += '    Contact E-mail Address is required.\n';  
  if (action == 'Update') {
    if (ltrim(document.ContactForm.elements[k+7].value) == '') errors += '    Password is required.\n'; 
  }
  if (errors != '') {
	alert('The following error(s) occurred:\n'+errors); 
	return false;
  } else {
	return true;
  }
}