If (typeof XMLHttpRequest = 'undefined') {XMLHttpRequest = function () {return New activexobject (navigator. useragent. indexof ('msie 5')> 0? 'Microsoft. XMLHTTP ': 'msxml2. XMLHTTP ') ;};/* a complete Ajax function */function Ajax (options) {Options = {type: options. type | 'post', ULR: options. URL | '', timeout: options. timeout | 5000, // set timeout oncomplete: options. oncomplete | function () {}, onerror: options. onerror | function () {}, onsuccess: options. onsuccess | function () {}, data: options. data | ''}; var xml = new XMLHttpRequest (); XML. open (options. type, opti ONS. URL, true); var timeoutlength = options. timeout; var requestdone = false; setTimeout (function () {requestdone = true ;}, timeoutlength); XML. onreadystatechange = function () {If (XML. readystate = 4 &&! Requestdone) {If (httpsuccess (XML) {options. onsuccess (httpdata (XML, options. type);} else {options. onerror () ;}options. oncomplete (); xml = NULL ;}}; XML. send ();/* determine whether the load is successful */function httpsuccess (r) {try {return! R. status & location. protocl = 'file: '| (R. status >=200 & R. status <300) | r. status = 304 | navigator. useragent. indexof ('safari ')> = 0 & typeof R. status = 'undefined';} catch (e) {} return false;};/* determine the file loading type */function httpdata (R, type) {var Ct = R. getResponseHeader ('content-type'); var DATA =! Type & CT. indexof ('xml')> = 0; Data = tpye = 'xml' | data? R. responsexml: R. responsetext; If (type = 'script') {eval. Call (window, data) ;}return data ;}}