function News(url, cat, mode, short, span, link, id, onready) { // create Ajax-Objects this.browser = navigator.userAgent; this.ie = (document.all)?1:0; this.opera = (this.browser.search(/opera/i) > 0)? 1 : 0; this.mozilla = (this.browser.search(/mozilla/i) > 0)? 1 : 0; this.IEXObjs = ["MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp", "Microsoft.XMLHttp"]; this.myEncodeURIComponent = function(s) { return((encodeURIComponent)? encodeURIComponent(s) : escape(s)); }; this.getRequestObject = function() { var req = null; try { req = new XMLHttpRequest(); } catch(e) {} if (!req) { for (var i = 0; i < this.IEXObjs.length; i++) { try { req = new ActiveXObject(this.IEXObjs[i]); if (req != null) break; } catch (e) {} } } if (!req && window.createRequest) req = window.createRequest(); return req; }; // Sends a XMLHttpRequest to call the specified PHP function on the server this.call = function(sUri, id, onready) { sUri += "&rnd=" + Math.random(); request.reqType = 0; // get request.onreadystatechange = function() { if (request.readyState != 4) document.getElementById(id).innerHTML = 'Loading News ...'; else if (request.status == 200) { document.getElementById(id).innerHTML = request.responseText; if (onready != null) eval(onready); //delete(request); } } request.open("GET", sUri, true); request.send(null); }; // Call Ajax-Loader var request = new Object(); request = this.getRequestObject(); this.call(url+((url.indexOf("?")==-1)? "?":"&")+"cat="+cat+"&mode="+mode+"&short="+short+"&span="+span+"&link="+link, id, onready); }