
        function dbQuery() {
                this.callbackObject = null;
                this.rowArray = new Array();
        }
        dbQuery.prototype.requestData = function(scriptURL,callbackObject,callbackMethod) {
                this.callbackObject = callbackObject;
                this.callbackMethod = callbackMethod;
                var req = null;
                if (window.XMLHttpRequest) {
                        req = new XMLHttpRequest();
                }
                else if (window.ActiveXObject) {
                        req = new ActiveXObject("Microsoft.XMLHTTP");
                }


                req.open('GET', scriptURL);
                var myParent = this;
                req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                req.onreadystatechange = function() {
                        if (req.readyState == 4) {
                                myParent.loadData(req);
                                // delete this;
                        }
                }
                req.send(null);
        }
        dbQuery.prototype.loadData = function(req) {
                var response = req.responseXML.documentElement;
                this.parseData(response);
        }
        dbQuery.prototype.parseData = function(response) {
                for (var i=0;i<response.childNodes.length;i++) {
                        var newRow = new dbObject;
                        newRow.nodeName = response.childNodes[i].nodeName;
                        for (var j=0;j<response.childNodes[i].childNodes.length;j++) {
                                var currentNode = response.childNodes[i].childNodes[j];
                                if (currentNode.childNodes.length > 0) {
                                        // newRow.addProperty(currentNode.nodeName, unescape(currentNode.firstChild.nodeValue), currentNode);
                                        newRow.addProperty(currentNode);
                                }

                        }
                        this.rowArray.push(newRow);
                }
                if ((this.callbackObject)&&(this.callbackMethod)) {
                        this.callbackObject[this.callbackMethod](this);
                }
        }
        dbQuery.prototype.getRecordCount = function() {
                return  this.rowArray.length;
        }
        dbQuery.prototype.getRecord = function(recordPosition) {
                return  this.rowArray[recordPosition];
        }
        dbQuery.prototype.getRecords = function() {
                return this.rowArray;
        }
