function disableClick() {
  alert('sorry');
  return false;
}

function disableForm() {
  var f = document.forms[0];
  for(var i = 0; i < f.length; i++) {
    var e = f.elements[i];
    if(e.type.toLowerCase() == "submit") {
      //e.disabled = true;
      //alert('!');
      e.attachEvent('onClick', disableClick);
    }
  }
}

function doActionButton(id) {
  var element = document.getElementById(id);
  if (element != null) {
	element.disabled = true;
	// make it look disabled too
	element.style.color = "#808080";
  }
}

function doHourglass(text) { 
    var d = window.document;
    
    // find main content container
    var parent = d.getElementById("mainContentContainer");
    if (parent == null){
		parent = d.body;
	}
    
    var c = d.createElement('div');
   
    c.setAttribute("id", "hourglasscontainer");
    c.style.cssText = "display:none;position:relative;left:200px;top:-300px;background-color: white; border: 1px solid black; width: 366px; height: 80px;z-index: 99";

    var c1 = d.createElement('div');
    c.appendChild(c1);
    c1.setAttribute("id", "hourglasscontainer_top");
    c1.style.cssText = '';
    //c1.innerHTML = '<img alt="" id="animatedLogo" border="0" height="52" width="52" src=""><img id="titleLogo" alt="Pharos Reizen van ANWB" border="0" height="52" width="295" src="' + pharosTitleLogo.src + '">';
    c1.innerHTML = '<img alt="" id="animatedLogo" border="0" height="52" width="52" src=""><img id="titleLogo" alt="ANWB Kampeerreizen" border="0" height="52" width="295" src="' + pharosTitleLogo.src + '">';
    
    var c2 = d.createElement('div');
    c.appendChild(c2);
    c2.setAttribute("id", "hourglasscontainer_bottom");
    c2.style.cssText = 'font: 11pt Verdana, Helvetica, Arial, sans-serif; font-weight: bold; padding-left: 56px;';
    c2.innerHTML = text;

	parent.appendChild(c);
	
	// IE7 HACK
	// reset the animated image src property, because otherwise IE7 won't animate it after submitting the page
	// see http://www.eggheadcafe.com/tutorials/aspnet/87272b03-adec-45e1-b157-b21da3714dfd/aspnet-animated-gifs-and.aspx
	//setTimeout('document.getElementById("animatedLogo").src = "images/pharoslogo.gif"', 200);
	setTimeout('document.getElementById("animatedLogo").src = "images/Kampeerreizenanim.gif"', 200);
	
	// display div a little (arbitrary) later, so image could be downloaded
	setTimeout('document.getElementById("hourglasscontainer").style.display = "block"', 500);	
}

// preload title logo
// NB: do not preload animated logo, because it won't spin in IE
pharosTitleLogo = new Image();
//pharosTitleLogo.src = "images/pharostitle2006.gif";
pharosTitleLogo.src = "images/logo_kampeerreizen.gif";
