// Preload script for images
var myimages = new Array(); 
// uses global var preloadImgs
function preloading(){ 
  for (x=0; x<preloadImgs.length; x++){ 
alert('fun');
    myimages[x] = new Image(); 
    myimages[x].src = preloadImgs[x]; 
  }
}

function submitForm(ele) {
  var frm;
  if (ele == '') frm = document.forms[0];
  else frm = document.getElementById(ele);

  frm.submit();
}

/**
 * Adds a function to the window onload event
 */
function addLoadEvent(func) {
  var oldOnload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  }
  else {
    window.onload = function() {
      oldOnload();
      func();
    }
  }
}
