Element.equalizeHeight = function(e1, e2) {
  e1 = $(e1); e2 = $(e2);
  e1.style.height = e2.style.height = "";
  e1.style.height = e2.style.height = Math.max(Element.getHeight(e1),Element.getHeight(e2)) + "px";
};

Form.safe_submit = function(form) {
  try {
    if (form.submitted === undefined) {
      form.submitted = true;
      return true;
    }
    alert("Your request is being processed ...");
  } catch (e) {
  }
  return false;
};

function getFirstParam(){
	var pair = window.location.search.substring( 1 );
	var parts = pair.split( '=' );
	var param = parseInt( parts[1] );
	return param;
}

// Got this idea from mozilla.org for how they handle IE downloads
function do_download(link) {
  // If we have IE, use a new window to push the download.
  // We have to do this because other methods did not work in IE.
  if (navigator.appVersion.indexOf('MSIE') != -1) {
    window.open(link, 'download_window', 'toolbar=0,location=no,directories=0,status=0,scrollbars=0,resizeable=0,width=1,height=1,top=0,left=0');
    window.focus();
  }
}