	/**
	 * AJAX Class
	 * 2008.06.24. by whynot.
	 */
	function AJAX()
	{
		//this.oHttp = null;
		this.isIE = true;
		this.completed = false;
		
		this.Create = function()
		{
			if (window.ActiveXObject)
			{
				try
				{
				//	alert('1')
					return new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1)
				{
					try
					{
				//	alert('2')
						return new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch(e2)
					{
						try
						{
							return new ActiveXObject("Msxml2.XMLHTTP.6.0");
						}
						catch(e3)
						{
							try
							{
								return new ActiveXObject("Msxml2.XMLHTTP.5.0");
							}
							catch(e4)
							{
								try
								{
									return new ActiveXObject("Msxml2.XMLHTTP.4.0");
								}
								catch(e5)
								{
									try
									{
										return new ActiveXObject("Msxml2.XMLHTTP.3.0");
									}
									catch(e6)
									{
										return false;
									}
								}
							}
						}
					}
				}
			}
			else if (window.XMLHttpRequest)
			{
				this.isIE = false;
				return new XMLHttpRequest();
			}
			else
			{
				return false;
			}
		}

		/**
		 * public
		 * @params
		 *		url : string, ¿äÃ» url.
		 *		callback: function, °á°ú¸¦ Ã³¸®ÇÒ ÇÔ¼ö.
		 *		args: string=null, ¿äÃ» url¿¡ Àü´ÞÇÒ °ªµé. a=1&b=2&...
		 *		useTextResult: boolean=true, °á°ú Ã³¸® ÇÔ¼ö¿¡ ÅØ½ºÆ®¸¦ Àü´ÞÇÒ °ÍÀÎ°¡(true), ¿ÀºêÁ§Æ®¸¦ Àü´ÞÇÒ °ÍÀÎ°¡(false)
		 * @returns
		 *		¼º°ø ½Ã true, ½ÇÆÐ ½Ã false.
		 */
		this.Request = function(url, callback, args, useTextResult)
		{
			var oHttp = this.Create();

			if (!oHttp)
			{
				return false;
			}

			if (useTextResult != null && !useTextResult)
			{
				useTextResult = false;
			}
			else
			{
				useTextResult = true;
			}

			var dummy = new Date().getTime();
			if (url.indexOf("?") > 0)
			{
				url = url + "&dummy="+dummy;
			}
			else
			{
				url = url + "?dummy="+dummy;
			}

			oHttp.open("POST", url, true);
			//this.oHttp.setRequestHeader("Content-Type", "text/html; charset=ks_c_5601-1987");
			oHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			//this.oHttp.onreadystatechange = this.OnRetriveComplete;

			//var oThis = this;

			if (this.isIE == true)
			{
				if (useTextResult)
				{
					oHttp.onreadystatechange = function()
					{
						if (oHttp.readyState == 4)// && !oThis.completed)
						{ 
							//oHttp.onreadystatechange = Noop;//function() { return false };
							//oThis.completed = true;

							if (oHttp.status == 200)
							{
								//alert('a');
								//alert(oHttp.responseText);
								callback(oHttp.responseText);
								//return;
							}
							else if(oHttp.status != 12031)
							{
								alert("Ã³¸®Áß ¿¡·¯°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù. ´Ù½Ã ½ÃµµÇØÁÖ¼¼¿ä.");
							}
						} 
					}
				}
				else
				{
					oHttp.onreadystatechange = function()
					{
						if (oHttp.readyState == 4)// && !oThis.completed)
						{ 
							//oThis.completed = true;
							//oHttp.onreadystatechange = function() { return false };

							if (oHttp.status == 200)
							{
								callback(oHttp);
							}
							else 
							{
								alert("Ã³¸®Áß ¿¡·¯°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù. ´Ù½Ã ½ÃµµÇØÁÖ¼¼¿ä.");
							}
						} 
					}
				}
			}
			else
			{
				if (useTextResult)
				{
					oHttp.onload = function() { callback(oHttp.responseText); }
				}
				else
				{
					oHttp.onload = function() { callback(oHttp); }
				}
			}

			oHttp.send(args);

			return true;
		}
	}
	/**
	 * End of AJAX Class
	 */

	var sHttp = null;
	var sHttp_callback = null;
	var sHttpObjArray = new Array("Microsoft.XMLHTTP", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP");
	var sHttp_isWait = false;
	var sHttp_tgURL = null;
	var sHttp_callback2 = null;
	var sHttp_args = null;
	
	function _RequestHttp()
	{
		RequestHttp(sHttp_tgURL, sHttp_callback2, sHttp_args);
	}
	
	function RequestHttp(tgURL, callback, args)
	{
		/*
		if (!IE)
		{
			return;
		}
		*/
		
		if (sHttp_isWait)
		{
			//alert("WAIT");
			//sHttp_isWait = false;
			
			sHttp_tgURL = tgURL;
			sHttp_callback2 = callback;
			sHttp_args = args;
			setTimeout("_RequestHttp()", 500);
			return;
		}
		
		sHttp_isWait = true;
		
		if (sHttp == null)
		{
			for (var i=0; i<sHttpObjArray.length; i++)
			{
				try
				{
					sHttp = new ActiveXObject(sHttpObjArray[i]);
					break;
				}
				catch(ex)
				{
					sHttp = null;
				}
			}
		}

		if (sHttp == null)
		{
			PopMsg("ÁË¼ÛÇÕ´Ï´Ù.<br>ÀÌ¿ëÀÚ´Ô ÄÄÇ»ÅÍ¿¡ ¹®Á¦°¡ ÀÖ¾î ³ªÀÌ½º3355 »çÀÌÆ® ÀÌ¿ë¿¡ ¾î·Á¿òÀÌ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.<br>¹ø°Å·Î¿ì½Ã´õ¶óµµ 02-565-4192 ·Î ÀüÈ­¹®ÀÇ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù. ^^");
			return;
		}
		
		sHttp_callback = callback;

		var dummy = new Date().getTime()
		if (tgURL.indexOf("?") > 0)
		{
			tgURL = tgURL + "&dummy="+dummy;
		}
		else
		{
			tgURL = tgURL + "?dummy="+dummy;
		}
		
		/*
		alert(tgURL);
		return;
		*/
		
		sHttp.open("POST", tgURL, true);
		//sHttp.setRequestHeader("Content-Type:", "text/html; charset=ks_c_5601-1987");
		sHttp.setRequestHeader("Content-Type:", "application/x-www-form-urlencoded");
		sHttp.onreadystatechange = OnRetriveComplete;
    	sHttp.send(args);
		
    	/*
		if (sHttp.status > 200)
		{
			alert("Error: "+sHttp.status);
		}
		*/
	}

	function OnRetriveComplete()
	{ 
		if (sHttp.readyState == 4)
		{ 
			sHttp.onreadystatechange = Noop;
			sHttp_isWait = false;

			if (sHttp.status == 200)
			{
				if (sHttp_callback != null)
				{
					eval(sHttp_callback)(sHttp.responseText);
				}
			}
		} 
	} 

	function Noop()
	{ 
		return false; 
	} 

	function LoadDomDocument(xml, bAsync)
	{
		try
		{
			xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
		}
		catch(e)
		{
			try
			{
				xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			}
			catch (e)
			{
				try
				{
					xmlDoc = new ActiveXObject("Msxml.DOMDocument.3.0");
				}
				catch (e)
				{
					PopMsg("ÁË¼ÛÇÕ´Ï´Ù.<br>ÀÌ¿ëÀÚ´Ô PC¿¡¼­ °ü·Ã ±â´ÉÀ» ·ÎµåÇÏÁö ¸øÇß½À´Ï´Ù.<br>02-501-0628·Î ¹®ÀÇ ºÎÅ¹µå¸³´Ï´Ù.");
					return null;
				}
			}
		}
		
		xmlDoc.async = bAsync;
		xmlDoc.loadXML(xml);
		
		return xmlDoc;
	}
	
	function LoadDomDocument2(xml)
	{
		xmlDoc = new XMLDoc(xml);
		return xmlDoc;
	}

	/*
	Array.prototype.toString = function()
	{
		var retStr = "[";
		for(var x in this)
		{
			if (isNaN(x))
			{
				val = (typeof(this[x]) == 'string') ? "'"+this[x]+"'" : this[x];
				retStr+= x+":" + val + ", ";
			}
			else
			{
				val = (typeof(this[x]) == 'string') ? "'"+this[x]+"'" : this[x];
				retStr+= val + ", ";
			}
		}
		
		return retStr.substring(0,retStr.length-2) + "]";
	}
	*/

	function GetMSIEVersion()
	{
		var ua = window.navigator.appVersion;
		var isIE = ua.indexOf("MSIE");
		if (isIE > 0)
		{
			return parseFloat(ua.substring(isIE+5, ua.indexOf(".", isIE)+2));
		}
		else
		{
			return 0;
		}
	}
	
	function IsWinXPSV2()
	{    
		tmp_MSIE = window.navigator.userAgent.indexOf("MSIE");
		if (tmp_MSIE && window.navigator.userAgent.indexOf("SV1") > tmp_MSIE)
		{   
			return true; 
		}
		else
		{
			return false;
		}
	}
	
	var isXPSV2 = IsWinXPSV2();
	
	/*
	function PopMsg(msg)
	{
		if (isXPSV2)
		{
			alert(msg.replace(/<br>/g, "\n"));
		}
		else
		{
			var rtn = showModalDialog('/common/def_popMsg.htm?mode=msg&msg='+msg, 'hompyMsg', 'dialogWidth: 360px; dialogHeight: 295px; status: no; resizable: no; scroll: no;');
		
			if (rtn != null)
			{
				return rtn;
			}
		}
	}

	function PopConfirm(msg)
	{
		if (isXPSV2)
		{
			return confirm(msg.replace(/<br>/g, "\n"));
		}
		else
		{
			var rtn = showModalDialog('/common/def_popMsg.htm?mode=confirm&msg='+msg, 'hompyMsg', 'dialogWidth: 360px; dialogHeight: 270px; status: no; resizable: no; scroll: no;');
		
			if (rtn == null)
			{
				return false;
			}
			else
			{
				return rtn;
			}
		}
	}
	*/
