function clearForm(element) {
  element.form.reset();
  return false;
}  

function openWindow(width, height) {
  //var width = 400;
  //var height = 250;

  var x = (800 - width)/2;
  var y = (600 - height)/2;

  if (screen) {
    x = (screen.availWidth - width)/2;
    y = (screen.availHeight - height)/2;
  }

  window.open('about:blank','result','alwaysRaised=yes,scrollbars=yes,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}

function doOnlineFormSubmit(element) {
  //var theForm = element.form; 
  openWindow(400, 250);
  //setTimeout('document.getElementById("' + element.id + '").form.submit()', 80);
  return true;
}

//function doOnlineFormSubmit2(element, newWindowWidth, newWindowHeight) {
//  var formId = element.form.id; 
//  openWindow(newWindowWidth, newWindowHeight);
//  setTimeout('document.getElementById("' + formId + '").submit()', 80);
//  return false;
//}