/*
This function written by Simon Willison:
http://simon.incutio.com/archive/2004/05/26/addLoadEvent
*/

function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
		}
	}
}



// Hide email script, thanks to: http://www.htmldog.com

addLoadEvent(view_address);

function view_address() {
	address_to_replace=document.getElementById("e").firstChild;
	real_address=address_to_replace.nodeValue.replace("@", "@");
	address_to_replace.nodeValue=real_address; 
	address_to_replace.parentNode.setAttribute("href", "mailto:"+real_address); 
}




// Fancy Rules. Thanks to www.sitepoint.com.

addLoadEvent(fancyRules);

function fancyRules() { 
 if (!document.getElementsByTagName) return;  
 var hr = document.getElementsByTagName("hr");   
  for (var i=0; i<hr.length; i++) {           
  var newhr = hr[i]; 
  var wrapdiv = document.createElement('div');    	
  wrapdiv.className = 'line';                     
  newhr.parentNode.replaceChild(wrapdiv, newhr);  
  wrapdiv.appendChild(newhr);                     
 }
} 


// Are you sure.

function rusure(){
	question = confirm("Please note: you are about to view the old site. New site coming soon.")
	if (question !="0"){
		top.location = "http://www.hailltd.org"
	}
}




// AutoDate.

    today=new Date();
    y0=today.getFullYear();


// Simple form check.

function isReady(recv_form) {
  	if (recv_form.email.value != "")
  	  	return true;
  	else {
  	  	alert("Please include a valid email address.");
recv_form.email.focus();
return false;
}
}

// Simple toggle.
function toggle( targetId ){
 if (document.getElementById){
        target = document.getElementById( targetId );
          if (target.style.display == "none"){
             target.style.display = "";
          } else {
             target.style.display = "none";
         }
     }
}


