function oxml() {
	var divObj;
	var dialogObj;
	var formObj;
	var self=this;
	var oXML;
	
	//this.init=function init() {
	this.oXML=this.getOXML();
	//}
	
	this.setResponseHTML=function setResponseHTML() {

		if (self.oXML.readyState==4) {
		//if (this.oXML.readyState==4) {

			if(self.oXML.status == 200) {
			 //if(this.oXML.status == 200) {
		
				self.divObj.innerHTML=self.oXML.responseText;
				//this.divObj.innerHTML=self.oXML.responseText;

				if(self.dialogObj) {
					self.dialogObj.hide();
					initForm(self.formObj);
				}

				//if(this.dialogObj)
				//	this.dialogObj.hide();
					
			} else if(self.oXML.status == 500) {
				
				self.divObj.innerHTML=self.oXML.responseText;

				if(self.dialogObj) {
					self.dialogObj.hide();
					initForm(self.formObj);
				}

			}
			
			self.oXML.onreadystatechange=function () { return false; };
			
		}

	}
	
}
	
oxml.prototype.getOXML = function() {
//	this.getOXML=function getOXML() {

	var xmlObj = false;

	// branch for native XMLHttpRequest object
	if(window.XMLHttpRequest) {
		try {
		xmlObj = new XMLHttpRequest();
		} catch(e) {
		xmlObj = false;
		}
	// branch for IE/Windows ActiveX version
	} else if(window.ActiveXObject) {
	
		try {
				xmlObj = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
				try {
					xmlObj = new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e) {
					xmlObj = false;
			}
		}
	
	}

	return xmlObj;
}

oxml.prototype.getQueryData = function(url) {
//this.getQueryData=function getQueryData(url) {
	var rtn;

	this.oXML.open("GET",url+this.getTimeStamp(),false);
	this.oXML.send("");

	if(this.oXML.readyState==4) {

		if (this.oXML.status == 200) {
			rtn = this.oXML.responseText;
			return rtn;
		} else {
			rtn = this.oXML.responseText;
			return rtn;
		}
	}
}

oxml.prototype.getQueryDataAsync = function(url,callback) {
//this.getQueryDataAsync=function getQueryDataAsync(url) {
	var rtn;

	this.oXML.open("GET",url+this.getTimeStamp(),true);
	this.oXML.send("");
	
	if(callback)
		this.oXML.onreadystatechange=callback;

}

oxml.prototype.getQueryXML = function(url) {
//this.getQueryXML=function getQueryXML(url) {
	var xmldoc;
	
	this.oXML.open("GET",url+this.getTimeStamp(),false);

	this.oXML.send("");
	if(this.oXML.readyState==4) {
		if (this.oXML.status == 200) {
			xmldoc = this.oXML.responseXML;
			return xmldoc;
		} else {
			rtn = this.oXML.responseText;
			return rtn;
		}
	}
}

oxml.prototype.sendPostData = function(url,form) {
//this.sendPostData=function sendPostData(url,form) {
	var rtn;

	this.oXML.open("POST",url+this.getTimeStamp(),false);
	this.oXML.setRequestHeader('Content-Type', 
		'application/x-www-form-urlencoded');

	this.oXML.send(this.formData2QueryString(form));

	if(this.oXML.readyState==4) {

		if (this.oXML.status == 200) {
			rtn = this.oXML.responseText;
			return rtn;
		} else {
			rtn = this.oXML.responseText;
			return rtn;
		}
	}
}

oxml.prototype.sendPostDataAsync = function(url,formObj,divObj,dialogObj) {
//this.sendPostDataAsync=function sendPostDataAsync(url,form,divObj,dialogObj) {

	var rtn;
	this.divObj=divObj;
	this.dialogObj=dialogObj;
	this.formObj=formObj;

	this.oXML.open("POST",url+this.getTimeStamp(),true);
	this.oXML.setRequestHeader('Content-Type', 
		'application/x-www-form-urlencoded');
	this.oXML.send(this.formData2QueryString(formObj));
	this.oXML.onreadystatechange=this.setResponseHTML;
}

/*
oxml.prototype.setResponseHTML = function() {
//this.setResponseHTML=function setResponseHTML() {

	//if (self.oXML.readyState==4) {
	if (this.oXML.readyState==4) {
	
		//if(self.oXML.status == 200) {
		 if(this.oXML.status == 200) {
	
			//self.divObj.innerHTML=self.oXML.responseText;
			this.divObj.innerHTML=self.oXML.responseText;
			
			//if(self.dialogObj)
			//	self.dialogObj.hide();
			
			if(this.dialogObj)
				this.dialogObj.hide();
				
		} else if(self.oXML.status == 500) {
			
			self.divObj.innerHTML=self.oXML.responseText;

			if(self.dialogObj)
				self.dialogObj.hide();

		}
		
		self.oXML.onreadystatechange=function () { return false; };
		
	}

}
*/

oxml.prototype.sendPostXML = function(url,form) {
//this.sendPostXML=function sendPostXML(url,form) {
	var rtn;

	this.oXML.open("POST",url+this.getTimeStamp(),false);
	this.oXML.setRequestHeader('Content-Type', 
		'application/x-www-form-urlencoded');

	this.oXML.send(this.formData2QueryString(form));

	if(this.oXML.readyState==4) {

		if (this.oXML.status == 200) {
			rtn = this.oXML.responseXML;
			return rtn;
		} else {
			rtn = this.oXML.responseText;
			return rtn;
		}
	}
}

oxml.prototype.getTimeStamp = function() {
//this.getTimeStamp=function getTimeStamp() {
	return "&tts="+new Date().getTime();
}

oxml.prototype.formData2QueryString = function(docForm) {
//this.formData2QueryString=function formData2QueryString(docForm) {

	var strSubmit= '';
	var formElem;
	var strLastElemName = '';
	
	for (i = 0; i < docForm.elements.length; i++) {

		formElem = docForm.elements[i];

		if(formElem.disabled && formElem.type !="hidden")
			continue;
		
		switch (formElem.type) {
			// Text, select, hidden, password, textarea elements
			case 'text':
			case 'file':
			case 'select-one':
			case 'select':
			case 'hidden':
			case 'password':
			case 'textarea':
					strSubmit += formElem.name + 
//					'=' + escape(formElem.value) + '&';
					'=' + encodeURI(formElem.value) + '&';
			break;
			case 'checkbox':
			case 'radio':
				if (formElem.checked) { 
					strSubmit += formElem.name + 
					'=' + escape(formElem.value) + '&';
//					'=' + encodeURI(formElem.value) + '&';
				}
			break;
		}
	}

	return strSubmit;
}
	
	/*
	this.formData2QueryString=function getFormAsString(formElements){
			
	  //Setup the return String
	  var returnString ="";
			
	  //loop through the array, building up the url
	  //in the format '/strutsaction.do&name=value'
	 
	  for(var i=formElements.length-1;i>=0; --i ){
			//we escape (encode) each value
			returnString+="&" 
			+escape(formElements[i].name)+"=" 
			+escape(formElements[i].value);
	 }

	 //return the values
	 return returnString; 
	}
	*/

//}


