function ajax_init(){
	var xmlHttp;
	if(window.XMLHttpRequest) xmlHttp = new XMLHttpRequest();
	else if(window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	return xmlHttp;
}

function ajax_get(mothod, url, send, callbackFunc){
	var xmlHttp;
	xmlHttp = ajax_init();
	xmlHttp.onreadystatechange = ajax_callback;
	xmlHttp.open(mothod, url, true);
	xmlHttp.send(send);

	function ajax_callback(){
		if(xmlHttp.readystate == 4) callbackFunc(xmlHttp);
	}

	return xmlHttp;
}

function getXmlHttpRequest(){
	var xmlhttp = false;
	try{
		xmlhttp = new XMLHttpRequest(); // for FireFox, Opera 8+, Safari, IE 7+
	}catch(e){
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); // for IE 6+
		}catch(e){
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // for IE 5.5+
			}catch(e){
			}
		}
	}
	return xmlhttp;
}

function doAjaxBasic(u,p,f,c){ // f Ajax ¼öÇàÈÄ È£ÃâµÇ´Â ÇÔ¼ö
	var args = doAjaxBasic.arguments;
	var xmlHttp = getXmlHttpRequest();
	xmlHttp.open("POST", u, false);
	xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=euc-kr');
	xmlHttp.setRequestHeader('Cache-Control','no-cache,must-revalidate');
	xmlHttp.setRequestHeader('Pragma','no-cache');
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState==4){
			if(xmlHttp.status==200){
				window[f](xmlHttp, c);
			}
		}
	}
	xmlHttp.send(p); // GET ¹æ½ÄÀÌ¸é null
}

function doAjaxBasicCache(u,p,f,c){ // f Ajax ¼öÇàÈÄ È£ÃâµÇ´Â ÇÔ¼ö
	var args = doAjaxBasic.arguments;
	var xmlHttp = getXmlHttpRequest();
	xmlHttp.open("POST", u, false);
	xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=euc-kr');
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState==4){
			if(xmlHttp.status==200){
				window[f](xmlHttp, c);
			}
		}
	}
	xmlHttp.send(p); // GET ¹æ½ÄÀÌ¸é null
}

function getEscEnc(s){
	return escape(encodeURIComponent(s)); // ÇÑ±Û
}

