function doLoad() {
  // does nothing
}

var firstEl;

function validateForm(frm) {
  errs = "";
  firstEl = null;
  els = frm.elements;
  for(i=0; i<els.length; i++) {
    if(els[i].id == "req")
      errs += checkVal(els[i]);
  }
  if(errs != "") {
    alert("Please make the following changes:\n\n" + errs);
    if(firstEl)
      firstEl.focus();
    return false;
  }
  return true;
}

function checkVal(el) {
  if(el) {
    if(((el.tagName == "INPUT" || el.tagName == "TEXTAREA") && el.value == "")
       || (el.tagName == "SELECT" && el.options[el.selectedIndex].value == "")) {
      if(firstEl == null)
        firstEl = el;
      return "- " + el.title + "\n";
    }
  }
  return "";
}

function toggleImg(img) {
  src = img.src;
  if(src.indexOf('_off') != -1)
    img.src = src.replace('_off', '_on');
  else if(src.indexOf('_on') != -1)
    img.src = src.replace('_on', '_off');
}

function preloadImg(img) {
  src = img.src;
  document.onImg = new Image();
  document.onImg.src = src.replace('_off', '_on');
}

function openPopupWindow(url, width, height, scrolling, name) {
  if (!width) width = 350;
  if (!height) height = 350;
  if (!scrolling) scrolling = "no"; 
  if (!name) name = "win"+Math.round(Math.random()*1000); 
  
  features = "width="+width+","
           + "height="+height+","
           + "toolbar=no,"
           + "location=no,"
           + "status=no,"
           + "menubar=no,"
           + "scrollbars="+scrolling+","
           + "top="+(window.screen.height-height)/2+","
           + "left="+(window.screen.width-width)/2;
  window.open(url,name,features);
}
