//****************Create request object
	function createRequestObject() {
		var ro;		
		if (window.XMLHttpRequest) { 				// Mozilla, Safari,...
			ro = new XMLHttpRequest();
			//if (ro.overrideMimeType) {
			//	ro.overrideMimeType('text/xml');
			//}
		}else if (window.ActiveXObject) { 			// IE
			try {
				ro = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
				ro = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}
	
		return ro;
			
	}
	
	
	function getCode(){	
			if(document.frmCodeSearch.theCode.value == ""){
				alert('Please enter a valid postocde')
			
			}else{
					var thePostcode = document.frmCodeSearch.theCode.value
					http = createRequestObject();
					http.open('get', 'getCode.asp?postcode='+ thePostcode); 
					http.onreadystatechange = handleCodeResponse;
					http.send(null);
					//document.getElementById('theTitle').style.display = 'none';
					}
		}
		
		//****************Handles the responce from running Search
	function handleCodeResponse() {
		if(http.readyState == 4){
			var theResponse = http.responseText;
			document.getElementById("schoolSearchResult").innerHTML = theResponse;
				
		}
	}
	
	function showCode(){
		var theLayer = document.getElementById('showCode')
		theLayer.style.display = 'block'
		theLayer.style.marginTop = '-13px'
		
		
		document.getElementById('hideMe').style.display = 'none';
		document.getElementById('isThis').style.display = 'none';
	}
