var request = null;
/// <summary>
/// ¿äÃ» ÄÁ³Ø¼ÇÀ» »ý¼ºÇÑ´Ù.
/// </summary>
function FnCreateRequest()
{
	try{
		request = new XMLHttpRequest();
	}catch(trymicrosoft){
		try{
			request = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(othermicrosoft)
		{
			try{
				request = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(failed)
			{
				request = null;
			}
		}
	}
}

/// <summary>
/// ¿äÃ» ÄÁ³Ø¼ÇÀ» »ý¼ºÇÑ´Ù.
/// </summary>
function FnGetCreateRequest()
{
	try{
		obRequest = new XMLHttpRequest();
	}catch(trymicrosoft){
		try{
			obRequest = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(othermicrosoft)
		{
			try{
				obRequest = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(failed)
			{
				obRequest = null;
			}
		}
	}
	return obRequest;
}

/// <summary>
/// RequestÁ¤º¸¸¦ ÇØ´ç URL·Î º¸³½´Ù. (GET, ºñµ¿±âÃ³¸®) 
/// </summary>
function FnSendRequest(url, callBack)
{
	request.onreadystatechange = callBack;
	request.open("GET", url, true);
	request.send("");
}

/// <summary>
/// Request°´Ã¼¸¦ ¹Þ¾Æ¼­ ÇØ´ç Á¤º¸¸¦ ÇØ´ç URL·Î º¸³½´Ù. (POST, ºñµ¿±âÃ³¸®)
/// </summary>
function FnSendRequestPostByRequest(url, callBack, queryString, request)
{
	request.onreadystatechange = callBack;
	request.open("POST", url, true);
	request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	
	request.send(queryString);
	
}

/// <summary>
/// RequestÁ¤º¸¸¦ ÇØ´ç URL·Î º¸³½´Ù. (POST, µ¿±âÃ³¸®)
/// </summary>
function FnSendRequestPost(url, callBack, queryString)
{
	request.onreadystatechange = callBack;
	request.open("POST", url, false);
	request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	
	request.send(queryString);
	
}

/// <summary>
/// À¯Æ¿¸®Æ¼ ¼º°ÝÀ¸·Î ÇØ´ç ¿¤¸®¸ÕÆ®¿¡ ¹®ÀÚ¿­ ÅØ½ºÆ®¸¦ ³Ö´Â´Ù.
/// </summary>
function FnReplaceText(el, text)
{
	if (el != null)
	{
		FnClearText(el);
		var newNode = document.createTextNode(text);
		el.appendChild(newNode);
	}
}

/// <summary>
/// À¯Æ¿¸®Æ¼ ¼º°ÝÀ¸·Î ÇØ´ç ¿¤¸®¸ÕÆ®ÀÇ ÅØ½ºÆ®¸¦ Á¦°ÅÇÑ´Ù.
/// </summary>
function FnClearText(el)
{
	if (el != null)
	{
		if (el.childNodes)
		{
			for (var i = 0; i < el.childNodes.length; i++)
			{
				var childNode = el.childNodes[i];
				el.removeChild(childNode);
			}
		}
	}
}

/// <summary>
/// À¯Æ¿¸®Æ¼ ¼º°ÝÀ¸·Î ÇØ´ç ¿¤¸®¸ÕÆ®ÀÇ ÅØ½ºÆ® ³»¿ëÀ» ÀÐ¾î¿Â´Ù.
/// </summary>
function FnGetText(el)
{
	var text = "";
	if (el != null)
	{
		if (el.childNodes)
		{
			for (var i = 0; i < el.childNodes.length; i++)
			{
				var childNode = el.childNodes[i];
				if (childNode.nodeValue != null)
				{
					text = text + childNode.nodeValue;
				}
			}
		}
	}
	return text;
}

/// <summary>
/// ÁöÁ¤ÇÑ ½Ã°£(MilliSecond ´ÜÀ§)µ¿¾È ¸ØÃá´Ù.
/// </summary>
function FnSleep(milSecond)
{
	var now = new Date();
	var sleepTime = now.getTime() + milSecond;
	while(true)
	{
		now = new Date();
		if (now.getTime() > sleepTime)
		{
			return ;
		}
	}
}