var xmlhttp;	
var requestText = "";
var tempElem;
function getReqest(num, elemRef){
	tempElem = elemRef;
	var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	 try {
	  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
		xmlhttp = false;
	  }
	 }
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	 xmlhttp.open("GET", "requestfreq.html?FIELDFORCHECK=" + num ,true);
	 xmlhttp.onreadystatechange=function() {
	  if (xmlhttp.readyState==4) {
		requestText = xmlhttp.responseText;
		tempElem.innerHTML = requestText;
		tempElem.style.visibility = "visible";
		tempElem.style.display = "block";
		//elemRef.innerHTML = requestText;
		//elemRef.style.visibility = "visible";
	  }
	 }
	 xmlhttp.send(null)
}

function checkFrequency( sendValueElemRef, ContainerRef ){
	var tempNumber = sendValueElemRef.value;
	    tempNumber = encodeURI(tempNumber);
	if(tempNumber != ""){
		getReqest(tempNumber,ContainerRef);
		//alert(requestText);
		//ContainerRef.innerHTML = requestText;
		//ContainerRef.style.visibility = "visible";
	}else{
		//ContainerRef.style.visibility = "hidden";
		ContainerRef.style.display = "none";
	}
}
function timoutToHideElement(elemName){
	window.setTimeout("hideElement('" + elemName +"')", 1000);
}
function hideElement(elemName){
	document.getElementById(elemName).style.display = "none";
}
function getFrequency(searchfor){
	document.getElementById('freqLocForm').FIELDFORCHECK.value = searchfor;
	document.getElementById('freqLocForm').submit();
}
