// JavaScript Document
function cHttpRequest() {
//------------------------------------------------------------------------------------
	this.getAjaxObj = function(){
		var theObj;
		var browser = navigator.appName;
		if(browser == "Microsoft Internet Explorer"){
			try{
				theObj=new ActiveXObject("Msxml2.XMLHTTP");
			}catch(e){
				alert(e);
				theObj=new ActiveXObject("Microsoft.XMLHTTP");
			}
		//}
		//theObj = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
			theObj = new XMLHttpRequest();
		}
		return theObj;
	}
//------------------------------------------------------------------------------------
	this.getResponse = function(thePage,params){
		var _this = this;
		this.oAjax = this.getAjaxObj();
		this.oAjax.onreadystatechange = function(){_this.handleResponse()};	
		this.oAjax.open('POST', thePage, true);  
		this.oAjax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		this.oAjax.setRequestHeader("Content-length", params.length);
		//this.oAjax.setRequestHeader("Connection", "close");
		this.oAjax.send(encodeURI(params));
	}
//------------------------------------------------------------------------------------
	this.handleResponse = function() {
		if(this.oAjax.readyState == 4){
			setTimeout('try{' + this.name + '_Return()}catch(e){}',1);
		}
	}
//------------------------------------------------------------------------------------
}

function fixStr(inStr){
	
	inStr = inStr.replace(/&#37;/g,'%');
	inStr = inStr.replace(/\r\n/g,'<br>');
	inStr = inStr.replace(/\n/g,'<br>');
	inStr = inStr.replace(/<br><br>/g,'<br>');
	inStr = inStr.replace(/\[quote\]/g,'<div style="border:1px solid #C4C4FF;padding:5px;background-color:#F0F0FF;margin-left:10px;color:#454545;font-style:italic">"'); 
	inStr = inStr.replace(/\[\/quote\]/g,'"</div>'); 
	//alert(inStr);
	
	return(inStr);
}
