var req   = null;
var isIng = false;
var sgdiv = null;

function loadAsync(url) {
	if (isIng == false && url != "") {
		isIng = true;
		if (window.XMLHttpRequest) {
			// branch for native XMLHttpRequest object
			req = new XMLHttpRequest();
			req.onreadystatechange = reqChange2;
			req.open("GET", url, true);
			req.send(null);
		}
		else if (window.ActiveXObject) {
			// branch for IE/Windows ActiveX version
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = reqChange2;
				req.open("GET", url, true);
				req.send(null);
			}
		}
	}
}

function reqChange() {
	if (req.readyState == 4 && req.status == 200) {
		isIng = false;
		ajaxResult(req.responseText);
	}
}

function loadAsync2(url) {
	if (isIng == false && url != "") {
		isIng = true;

		if (window.XMLHttpRequest) {
			// branch for native XMLHttpRequest object
			req = new XMLHttpRequest();
			req.onreadystatechange = reqChange;
			req.open("GET", url, true);
			req.send(null);
		}
		else if (window.ActiveXObject) {
			// branch for IE/Windows ActiveX version
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = reqChange2;				
				req.open("GET", url, true);
				req.send(null);
			}
		}
	}
}

function reqChange2() {
	if (req.readyState == 4 && req.status == 200) {
		isIng = false;		
		ajaxResult2(req.responseText);			
	}
}

function loadAsync3(url) {
	if (isIng == false && url != "") {
		isIng = true;

		if (window.XMLHttpRequest) {
			// branch for native XMLHttpRequest object
			req = new XMLHttpRequest();
			req.onreadystatechange = reqChange;
			req.open("GET", url, true);
			req.send(null);
		}
		else if (window.ActiveXObject) {
			// branch for IE/Windows ActiveX version
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = reqChange3;				
				req.open("GET", url, true);
				req.send(null);
			}
		}
	}
}

function reqChange3() {
	if (req.readyState == 4 && req.status == 200) {
		isIng = false;		
		ajaxResult3(req.responseText);			
	}
}


//POST ¹æ½Ä (2007-03-13 Ãß°¡)
function xmlhttpPost(goURL, param)
{
		var a = new ActiveXObject("Msxml2.XMLHTTP");			
    	a.open("POST", goURL, false);
    	a.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=euc-kr');
		  a.send(param);	
		
		if (a.status == 200 )
		{
			return a.responseText;
		}
		else
		{
			return "FAIL";
		}
}