// popups a new window for provided file
function popWindow(file, width, height) {
  newWindow = window.open(file,'newWindow','toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=no,dependent=yes,left=50,top=50,width='+width+',height='+height);
  newWindow.focus();
}

// popups a new window for provided file
function popWindowCenter(file, width, height) {
  newWindow = window.open(file,'newWindow','toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=no,dependent=yes,width='+width+',height='+height+',top='+(screen.height-height)/2+',left='+(screen.width-width)/2);
  newWindow.focus();
}

// for form validation
function enforcer(name, error) {
  var element = document.getElementById(name);
  if (element.value.length == 0) {
    alert(error);
    element.focus();
    return false;
  }
  else
    return true;
}

// for form validation
function enforcerChar(name, error, charX) {
  var element = document.getElementById(name);
  if (element.value.indexOf(charX) == -1) {
    alert(error);
    element.focus();
    return false;
  }
  else
    return enforcer(name, error);
}