var req;

function loadXMLDoc(url) {
url = 'http://www.recovery-insulation.co.uk/teacher/' + url + '.html';
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = processReqChange;
req.open("GET", url, true);
req.send(null);
// branch for IE/Windows ActiveX version
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processReqChange;
req.open("GET", url, true);
req.send();
}
// branch for less advanced browsers
} else {
window.location.replace(forms[0].pswd.value + ".html");
}
}

function processReqChange() { 
 // only if req shows "loaded" 
 if (req.readyState == 4) { 
  // only if "OK" 
  if (req.status == 200) { 
   window.location.replace(document.forms[0].pswd.value + ".html");  
  } else { 
   alert('Please enter the correct password or e-mail info@recoveryinsulation.co.uk for a replacement');  
  } 
 } 
} 