ajaxRequest=function( url , callback , szvalues, obj) { this.timeout = 0; this.url = url; this.szvalues = szvalues; this.status = 0; this.callbackfunction = callback; this.custom = null; this.callbackobj = obj; // if we are sending a object, this means that an instance is calling us. this.init = function init() { if (status == 0) { if ( this.url.substring(0,4) == "http" ) { /* SET TO USE PASSTHRU ACCESS INSTEAD */ this.url = "/" + dbfp + "/ajaxpassthru?openagent&now="+new Date()+"&url=" + this.url; } this.load(); } } this.inform = function() { try { if (this.callbackobj == null) { eval( this.callbackfunction); }else { eval( "this.callbackobj." + this.callbackfunction ) } }catch(oou){} } this.load = function load() { if(navigator.appName == "Microsoft Internet Explorer"){ this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }else{ this.xmlhttp = new XMLHttpRequest(); } if (this.xmlhttp) { var oThis = this; this.xmlhttp.onreadystatechange = function() { oThis.callback() } if (this.szvalues == null) { this.xmlhttp.open("GET",this.url,true) this.xmlhttp.setRequestHeader("Connection", "close"); this.xmlhttp.send(null); }else { this.xmlhttp.open('POST', this.url, true); this.xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); this.xmlhttp.setRequestHeader("Content-length", this.szvalues.length); this.xmlhttp.setRequestHeader("Connection", "close"); this.xmlhttp.send(this.szvalues); } this.status = 1; } } this.callback = function() { if (this.xmlhttp.readyState==4) { if (this.xmlhttp.status==200) { this.status = 200; }else {this.status = 404;} this.inform(); } } } function getForm( szform ) { var szvalues = ""; var elements = document.forms[szform].getElementsByTagName("INPUT"); for (i =0 ; i < elements.length; i++) { field = elements[i]; if (field.type != "file" && field.name != "") { if ( szvalues != ""){szvalues +="&"} szvalues += field.name + "=" + encodeURIComponent (getFieldValue(field.type , field )); } } var elements = document.forms[szform].getElementsByTagName("SELECT"); for (i =0 ; i < elements.length; i++) { field = elements[i]; if ( szvalues != ""){szvalues +="&"} szvalues += field.name + "=" + encodeURIComponent (getFieldValue(field.type , field )); } var elements = document.forms[szform].getElementsByTagName("TEXTAREA"); for (i =0 ; i < elements.length; i++) { field = elements[i]; if ( szvalues != ""){szvalues +="&"} szvalues += field.name + "=" + encodeURIComponent(getFieldValue(field.type , field )); } return szvalues; }