/***********************************************

Yag : This is a program that follows GPL.
Copyright (C) 2006 Miengine Inc.  www.miengine.com,  www.yagne.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.



Yag : 이 프로그램은 GPL을 따르는 프로그램입니다.  
Copyright (C) 2006년 (주)마이엔진,  www.miengine.com, www.yagne.com
 
이 프로그램은 자유 소프트웨어입니다. 소프트웨어의 피양도자는 자유 소프트웨어 재단이 공표한 GNU 일반 공중 사용 허가서 2판 또는 그 이후 판을 임의로 선택해서, 그 규정에 따라 프로그램을 개작하거나 재배포할 수 있습니다. 

이 프로그램은 유용하게 사용될 수 있으리라는 희망에서 배포되고 있지만, 특정한 목적에 맞는 적합성 여부나 판매용으로 사용할 수 있으리라는 묵시적인 보증을 포함한 어떠한 형태의 보증도 제공하지 않습니다. 보다 자세한 사항에 대해서는 GNU 일반 공중 사용 허가서를 참고하시기 바랍니다. 

GNU 일반 공중 사용 허가서는 이 프로그램과 함께 제공됩니다. 만약, 이 문서가 누락되어 있다면 자유 소프트웨어 재단으로 문의하시기 바랍니다. (자유 소프트웨어 재단: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA) 

GPL에 대해서 더 자세한 사항은 www.gnu.org 를 참조하십시오.

***********************************************/

function UFN_NewXMLHttpRequest()
{
	var rtnXmlHttp;

	if (window.ActiveXObject)
	{
		try
		{
			rtnXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				rtnXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e1)
			{
				rtnXmlHttp = null;
			}
		}
	}
	else if (window.XMLHttpRequest)
	{
		try
		{
			rtnXmlHttp = new XMLHttpRequest();
		}
		catch (e2)
		{
			rtnXmlHttp = null;
		}
	}
	else
	{
		rtnXmlHttp = null;
	}

	return rtnXmlHttp;
}

function UFN_XmlHttpOpenSend(argGetPost, argUrlAppl, argTrueFalse, argSendData, argFunction)
{
	var xmlHttp = UFN_NewXMLHttpRequest();

	if (xmlHttp == null)
	{
		return;
	}

	xmlHttp.open(argGetPost, argUrlAppl, argTrueFalse);

	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4)
		{
			if (xmlHttp.status == 200)
			{
				if(argFunction)
				{
					argFunction(xmlHttp);
				}
			} 
			else
			{
				UFN_ExceptionControl(xmlHttp);
			}
		}
	}

	var conType = "application/x-www-form-urlencoded; charset=UTF-8";
	xmlHttp.setRequestHeader("Content-Type", conType);

	xmlHttp.send(argSendData);
}

function UFN_ExceptionControl(argXmlHttp)
{
	var exceptShow = "";
	exceptShow += "상태 코드:" + argXmlHttp.status;
	exceptShow += ",  비정상으로 종료되었습니다.";
}