// JavaScript Document
// Not all of this is used by cahsc

<!-- 
//some ajaxy stuff for showing directory entries without re-loading page
//a permanent/static link should be utilised in conjunction ith this code - naturally
function createRequestObject() {
  var ro;
  var browser = navigator.appName;
  if(browser == 'Microsoft Internet Explorer') {
    ro = new ActiveXObject("Microsoft.XMLHTTP");
  } else {
    ro = new XMLHttpRequest();
  }
  return ro;
}
var http = createRequestObject();

function sndReq(do_this, location) {
  var string0 = do_this;
  var string1 = location;
  if(string0 == 'entry'){
  	http.open('get', 'http://www.cahsc.org/register/ajax.php?entry='+string1);
  }else if(string0 == 'template'){
	  http.open('get', 'admin_ap.php?'+string0+'='+string1);
  }else{
	 http.open('get', 'admin_ap.php?'+string0+'='+string1);
  }
	//document.getElementById('dir-overlay').style.display = block;
  http.onreadystatechange = handleResponse;
  http.send(null);
}

function handleResponse() {
  if(http.readyState == 4) {
    var response = http.responseText;
	document.getElementById('dir-overlay').style.display = "block";
    document.getElementById('dir-entry').innerHTML = response;
  }
}

function closeWindow() {
	document.getElementById('dir-overlay').style.display = "none";
}
//-->