function HTTPClient()
{};
HTTPClient.prototype = {
    xmlhttp: null,
    callback: null,
    loadRemoteContent: function(url, callbackFunction) 
    {
        this.callback = function(self) {
            eval(callbackFunction + '(self.xmlhttp);');
        }
        var self = this;
        if (window.XMLHttpRequest) {
            this.xmlhttp = new XMLHttpRequest();
            this.xmlhttp.onreadystatechange = function() {
                self.processReqChange(self);
            }
            this.xmlhttp.open("GET", url, true);
            this.xmlhttp.send(null);
        } else if (window.ActiveXObject) {
            this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            if (this.xmlhttp) {
                this.xmlhttp.onreadystatechange = function() {
                    self.processReqChange(self);
                };
				//alert(url);
                this.xmlhttp.open("GET", url, true);
                this.xmlhttp.send();
            }
        }
    },
    processReqChange: function(self) 
    {
        if (this.xmlhttp.readyState == 4) {
           if (this.xmlhttp.status == 200) {
              self.callback(self);
            } else {
                alert("There was a problem retrieving the data:\n" + this.xmlhttp.statusText);
            }
        }
    }
}





/* Function for the zoomox registeration*/
function call_zoomox_country_account( continentID, countryID )
{	
		//alert(document.searchbox.Loggedsubmit.value);
		//document.searchbox.Loggedsubmit.disabled=false;
		var r = Math.random();
        var httpClient = new HTTPClient();
		//alert(continentID)
		httpClient.loadRemoteContent("includes/lib/get_zoomox_country_acc.php?continentID="+continentID+"&country="+ countryID +"&t2="+r, 'handlezoomoxCountryAccount');
}

function handlezoomoxCountryAccount(response)
{
    var message = response.responseText;
    var temp;
	AccCountrydiv.innerHTML = message;
}

/* for the state function*/
function call_zoomox_state_account( countryID, stateID )
{
		var r = Math.random();
        var httpClient = new HTTPClient();
		httpClient.loadRemoteContent("includes/lib/get_zoomox_state_acc.php?countryID="+countryID+"&state="+stateID+"&t2="+r, 'handlezoomoxstateAccount');
}

function handlezoomoxstateAccount(response)
{
    var message = response.responseText;
    var temp;
	AccStatediv.innerHTML = message;
}
/* closing for the state function*/


/* for the county function*/
function call_zoomox_county_account( stateID, countryID, countyID, cityID )
{		
		var r = Math.random();
        var httpClient = new HTTPClient();
		httpClient.loadRemoteContent("includes/lib/get_zoomox_county_acc.php?stateID="+stateID+"&countryID="+ countryID +"&countyID="+ countyID +"&cityID="+ cityID +"&t2="+r, 'handlezoomoxcountyAccount');
}

function handlezoomoxcountyAccount(response)
{
    var message = response.responseText;
    var temp;
	temp = message.split("#");
	AccCountydiv.innerHTML = temp[0];

	if(temp[1] <= 0){
		call_zoomox_city_account( '', temp[2], temp[3], temp[4] );
	} else
		call_zoomox_city_account( temp[5], temp[2], temp[3], temp[4] );
	}

/* closing for the county function*/

/* for the city function*/
function call_zoomox_city_account( countyID, stateID, countryID, cityID )
{
		var r3 = Math.random();
        
		
		var httpClient = new HTTPClient();
		httpClient.loadRemoteContent("includes/lib/get_zoomox_city_acc.php?countyID="+countyID+"&stateID="+ stateID +"&countryID="+ countryID +"&cityID="+ cityID +"&n="+r3, 'handlezoomoxcityAccount');
}

function handlezoomoxcityAccount(response)
{
    var message = response.responseText;
    var temp;
	AccCityDiv.innerHTML = message;
	//AccCityDiv.innerHTML = message;
}
/* closing for the state function*/

