// AJAX
function EncodePostText(text1){

	var temptxt=text1.replace(/&/g,"@001@");

	temptxt=temptxt.replace(/'/g,"@002@");

	temptxt=temptxt.replace(/"/g,"@003@");
	
	temptxt=temptxt.replace(/=/g,"@004@");

	return temptxt;

}
function DecodeString(text1){

	var temptxt=text1.replace(new RegExp("\\\\\'","g"),"'");
	
	temptxt=temptxt.replace(new RegExp("\\\\'","g"),"'");
	
	temptxt=temptxt.replace(new RegExp("\\\'","g"),"'");

	temptxt=temptxt.replace(new RegExp("\\'","g"),"'");

	temptxt=temptxt.replace(new RegExp("\'","g"),"'");
	
	//Ë«ÒýºÅ
	temptxt=temptxt.replace(new RegExp('\\\\"',"g"),'"');
	
	temptxt=temptxt.replace(new RegExp('\\\"',"g"),'"');

	temptxt=temptxt.replace(new RegExp('\\"',"g"),'"');

	temptxt=temptxt.replace(new RegExp('\"',"g"),'"');

	return temptxt;

}

function AjaxRequest() {

	var xmlObj = false;

	var CBfunc,ObjSelf;

	ObjSelf=this;

	try { xmlObj=new XMLHttpRequest; }

	catch(e) {

		try { xmlObj=new ActiveXObject("MSXML2.XMLHTTP"); }

		catch(e2) {

			try { xmlObj=new ActiveXObject("Microsoft.XMLHTTP"); }

			catch(e3) { xmlObj=false; }

		}

	}

	if (!xmlObj) return false;

	this.method="POST";

	this.url;

	this.async=true;

	this.content="";

	this.callback=function(cbobj) {return;}

	this.send=function() {

		if(!this.method||!this.url||!this.async) return false;

		xmlObj.open (this.method, this.url, this.async);

		if(this.method=="POST") xmlObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

		xmlObj.onreadystatechange=function() {

			if(xmlObj.readyState==4) {

				if(xmlObj.status==200) {

					ObjSelf.callback(xmlObj);

				}

			}

		}

		if(this.method=="POST") xmlObj.send(this.content);

		else xmlObj.send(null);

	}

}



/*

    var ajaxobj=new AjaxRequest; 

    ajaxobj.method="POST";

    ajaxobj.url="";

	ajaxobj.content="";

    ajaxobj.callback=function(obj) {

		.........

    }

    ajaxobj.send();	

*/
