<!--
// Ajax functions to entering NZB Number; returning palyer's name.

function xmlhttpPost(strURL,id,nzcba_no) {
    var xmlHttpReq = false;
    var self = this;

    // Mozilla/Safari
    if (window.XMLHttpRequest) {	
        self.xmlHttpReq = new XMLHttpRequest();	
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
//alert("id="+id);
	var nzcba_no = document.getElementById(id).value;
//alert(strURL+"?nzcba_no="+nzcba_no);	
    self.xmlHttpReq.open('POST', strURL+"?nzcba_no="+nzcba_no, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText,id);
        }
    }
    self.xmlHttpReq.send(getquerystring(id));
}

function getquerystring(id) {
    var word = document.getElementById(id)
    qstr = 'w=' + escape(word);  // NOTE: no '?' before querystring
    return qstr;
}

function updatepage(str,id){
    document.getElementById("display_"+id).innerHTML = str;
}

function inputstr(id,search_field){
	var ValidChars = "0123456789";
	var IsNumber = true;
	var i;
//alert("id="+id+"\nsearch_field="+search_field);
	for (i=0; i<document.getElementById(id).value.length && IsNumber==true; i++)
	{
		Char = document.getElementById(id).value.charAt(i);
		if (ValidChars.indexOf(Char) == -1)
		{
			IsNumber = false;
		}
	}

	if (IsNumber == false)
	{
		alert("Can only enter numbers!");
		document.getElementById(id).value = '';
		return false;
	}	
	else if (document.getElementById(id).value.length > 2)
	{
       JavaScript:xmlhttpPost("get_nzcba_no_ss.php",id,search_field);
    }
}
-->