var sqlHttp = new Array(); // this initializes our sqlQuery http array
//var h=0; // this starts the http array at 0
//var sqlHttp = getHTTPObject();
var NORMAL_STATE = 4;
function sqlQuery(url, parameters, sqlReady, queryType, h) {
	// url is the sqlquery.php url
	// parameters are the values being passed to the sqlquery.php file
	// sqlReady is the "Ready Function" that is executed after the sqlquery is received by
	//   the js on the client
	// queryType is the type of request to be sent (GET or POST)
	// h is the name used to reference the sqlHttp[h] array
		
	sqlHttp[h] = getHTTPObject();
	
	try {
		sqlHttp[h].onreadystatechange = sqlReady;
		if (queryType == 'GET') {
		//	sqlHttp.open('GET', url + parameters, true);
			sqlHttp[h].open('GET', url + parameters, true);
			sqlHttp[h].setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			sqlHttp[h].setRequestHeader("Content-length", parameters.length);
			sqlHttp[h].setRequestHeader("Connection", "close");
			//sqlHttp.send(parameters);
			sqlHttp[h].send(null);
		}
		else if (queryType == 'POST') {
			sqlHttp.open('POST', url, true);
			sqlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			sqlHttp.setRequestHeader("Content-length", parameters.length);
			sqlHttp.setRequestHeader("Connection", "close");
			sqlHttp.send(parameters);
			//sqlHttp.send(null);
		}
		else { }
		
	}
	catch (e) { }
}