function Search(query,start,count,searchOrder)//Object to manage ajax calls { this.query = query; this.start = start; this.count = count; this.searchOrder = searchOrder; if(typeof Search._intialized == "undefined") { Search.prototype.getSearchURL = function()//Function used to build url with Search { var urlSuffix = new Array(); urlSuffix.push('&query=' + this.query); if(this.start)urlSuffix.push('&start=' + this.start); if(this.count)urlSuffix.push('&count=' + this.count); if(this.searchOrder)urlSuffix.push('&SearchOrder=' + this.searchOrder); return (Search._urlSearchPrefix + urlSuffix.join('')); }; Search.prototype.getCountSearchURL = function()//Function used to build url with Search { var urlSuffix = new Array(); urlSuffix.push('&query=' + this.query); if(this.searchOrder)urlSuffix.push('&SearchOrder=' + this.searchOrder); return (Search._urlCountSearchPrefix + urlSuffix.join('')); }; Search.prototype.loadAjax = function()//Function used to make the ajax call { var oXHR = createXHR(); oXHR.open('GET',this.getSearchURL(),false); oXHR.send(null); return oXHR.responseText; }; Search.prototype.loadCountAjax = function()//Function used to make the ajax call { var oXHR = createXHR(); oXHR.open('GET',this.getCountSearchURL(),false); oXHR.send(null); return oXHR.responseText; }; } Search._initialiazed = true; Search._urlSearchPrefix = '/primary31/site/search.js?open'; // static var used to store the url search prefix of search Search._urlCountSearchPrefix = '/primary31/site/countsearch.js?open'; // static var used to store the url count search prefix of search }