var rootUrl = "http://www.stampshobby.com"; var ajaxRequest, ajaxResponseMethod, ajaxRequestFlag=0; var ajaxPopupID, ajaxListName, ajaxFormName, ajaxFileName, ajaxResponseDataID; function Ajax() { var url, requestMethod, params, formName; this.init = function () { ajaxRequestFlag = 1; this.url = ""; this.requestMethod = "POST"; this.params = ""; this.formName = ""; ajaxResponseMethod = eval("this.defaultResponse"); if(window.XMLHttpRequest) ajaxRequest = new XMLHttpRequest(); else if (window.ActiveXObject) ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); else alert("Your browser does not support XmlHttp"); }; this.setUrl = function (url) {this.url = url;}; this.setMethod = function (requestMethod) {this.requestMethod = requestMethod;}; this.setParams = function (params) {this.params = params;}; this.setResponseMethod = function (responseMethod) {ajaxResponseMethod = eval(responseMethod)}; this.setPopupID = function (popupID) {ajaxPopupID = popupID;}; this.setParamsByForm = function (frmName) { var params = ""; var frm = eval('document.' + frmName); this.setUrl(frm.action); this.setMethod(frm.method); var elementArr = "document." + frmName + ".elements"; elementArr = eval(elementArr); elementCount = elementArr.length; for(var i=0; i