function doLoad() {
  // does nothing
}

function addEvent( obj, type, fn ){  // the add event function
  if (obj.addEventListener) obj.addEventListener( type, fn, false );
  else if (obj.attachEvent) {
    obj["e"+type+fn] = fn;
    obj[type+fn] = function() {
      obj["e"+type+fn]( window.event );
    };
    obj.attachEvent( "on"+type, obj[type+fn] );
  }
}

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 "";
}

/** MOUSE OVER EFFECTS **/
function preloadImgs() {
  imgs = document.images;
  for(i=0; i<imgs.length; i++) {
    src = imgs[i].src;
    if(imgs[i].className != 'no-hover' && src.indexOf('_off') != -1) {
      document.onImg = new Image();
      document.onImg.src = src.replace('_off', '_on');
      
      addEvent(imgs[i], "mouseover", toggleImg);
      addEvent(imgs[i], "mouseout", toggleImg);
    }
  }
  imgs = document.getElementsByTagName("input");
  for(i=0; i<imgs.length; i++) {
    if(imgs[i].type.toLowerCase() == 'image') {
      src = imgs[i].src;
      if(imgs[i].className != 'no-hover' && src.indexOf('_off') != -1) {
        document.onImg = new Image();
        document.onImg.src = src.replace('_off', '_on');
        
        addEvent(imgs[i], "mouseover", toggleImg);
        addEvent(imgs[i], "mouseout", toggleImg);
      }
    }
  }
}

addEvent(window, "load", preloadImgs);

function toggleImg() {
  src = this.src;
  if(src.indexOf('_off') != -1)
    this.src = src.replace('_off', '_on');
  else if(src.indexOf('_on') != -1)
    this.src = src.replace('_on', '_off');
}


function fixIE() {
  if(document.all) {
    theObjects = document.getElementsByTagName("object");
    for (var i = 0; i < theObjects.length; i++) {
      theObjects[i].outerHTML = theObjects[i].outerHTML;
    }
  }
}
//addEvent(window, "load", fixIE);


function goTo(u) {
  window.location = u;
}

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=50,"//+(window.screen.height-height)/2+","
           + "left=50";//+(window.screen.width-width)/2;
  win = window.open(url,name,features);
  win.focus();
  //return win;
}

function popUp(u, w, h, s, n) {
  openPopupWindow(u, w, h, s, n);
}

function view(s) {
  openPopupWindow(s, 600, 600, 'yes', 'viewWin');
}

function trackTrans() {
	// override on thanks page
}