
function fn_WindowOnLoad()
{
	try
	{
		//  ¿¡·¯ ¸Þ½ÃÁö°¡ ÀÖ´Â °æ¿ì ÆË¾÷ Ãâ·Â
		if ( document.all.errorMessage.value.length > 0 )
			fn_OpenErrorMessage(document.all.errorMessage.value);
			
		//  InformationÀÌ ÀÖ´Â °æ¿ì ÆË¾÷ Ãâ·Â
		if ( document.all.informationMessage.value.length > 0 )
			fn_OpenInformation(document.all.informationMessage.value);
			//fn_Message(document.all.informationMessage.value,"information","Information");
		//  ConfirmÀÌ ÀÖ´Â °æ¿ì ÆË¾÷ Ãâ·Â
		if ( document.all.confirmMessage.value.length > 0 )
			return fn_OpenConfirm(document.all.confirmMessage.value);
		//  ÆË¾÷Ã¢ ´Ý±â
		var strClose = "" 
		strClose = document.all.winClosed.value;
		if ( strClose == "closed" )
		{
			if ( document.all.winClosed.getAttribute("return").length > 0 )
					window.returnValue = document.all.winClosed.getAttribute("return");
			window.close();
			return;
		}
		//  ¹é½ºÆäÀÌ½º·Î ÀÌÀü ÆäÀÌÁö·Î °¡´Â °ÍÀ» ¸·´Â´Ù.
		document.onkeydown = fn_PreventNavigateBack;
		//  ¿À¸¥ÂÊ ¸¶¿ì½º Ã³¸®
		//document.oncontextmenu = fn_PreventRightMouse;
	}
	catch ( exception ) 
	{ 
		fn_OpenErrorMessage(exception.description);
	}
	
	try
	{
		//  Æû Unload È®ÀÎ
		document.onbeforeunload = fn_ClosingCheck;
		//  »ç¿ëÀÚ Á¤ÀÇ Æû ·Îµå ÇÔ¼ö È£Ãâ
		FormLoad();
	}
	catch(exception){} //À§µÎÇÔ¼ö¿¡´Â exceptionÃ³¸®°¡ ÀÖÀ¸¸é ¾ÈµÊ.. ÇÔ¼ö°¡ Á¸ÀçÇÏÁö ¾ÊÀ»¼öµµ ÀÖ±â¶«½Ã...
	
	try
	{
		//  °¢Á¾ È¯°æ ¼³Á¤ ->Firefox´Â ¾ÈµÊ
		//document.title = TITLE;
		//window.top.document.title = TITLE;
		//  »óÅÂ¹Ù Text º¯°æ		window.status = "";
	}
	catch(exception)
	{
		//fn_OpenErrorMessage(exception.description);
	}
		
}

/************************************************************************
Window_OnUnLoad ÀÌº¥Æ® ¹ß»ýÀü¿¡ ¹ß»ýµÇ´Â ÀÌº¥Æ®, ÆäÀÌÁö ´Ý±â Ãë¼Ò¸¦ ÇÒ ¼ö ÀÖ´Ù.
OnBeforeUnLoad ÀÌº¥Æ®¿¡ º°µµÀÇ ÀÌº¥Æ® ÇÚµé·¯¸¦ ¿¬°áÇÏ¿© Ã³¸®ÇÑ´Ù.
ex) window.onbeforeunload = fnClosingChecker;
*************************************************************************/
function fn_ClosingCheck()
{
	try
	{
		var strMsg = FormBeforeUnLoad();
		
		if ( strMsg.length > 0 )
		{
			strMsg = "\n" + strMsg;
			return strMsg;
		}
	}
	catch ( exception )
	{
	}
}

/************************************************************************
ÅØ½ºÆ® ¹Ú½º ÀÌ¿Ü´Â backspace ÀÔ·ÂÀ» Á¦ÇÑÇÑ´Ù
*************************************************************************/
function fn_PreventNavigateBack()
{
	//ÀÛ¾÷Àº ÇÏÁö¸¸.... "µÚ·Î"¹öÆ°À» ´©¸£¸é.. ¿ìÂ¥¸é µÇÁö????
	//¸Þ´ºÀÚÃ¼¸¦ ¾ø¾ÖµçÁö ÇØ¾ßÇÒµíÇÏ³×.... ¸Þ´ºÀÚÃ¼¸¦ ¾ø¾Ö¸é ¶Ç ¹ÝÇ×ÇÒ ¹«¸®µéÀÌ ¸¹À»³¤µ¥... °í¹Î½º·´µû..-_-
	var strTagType;
	if ( window.event.keyCode == 8 )
	{
		if ( window.event.srcElement.tagName.toUpperCase() == "INPUT" )
		{
			strTagType = window.event.srcElement.getAttribute("type").toUpperCase();
			if ( strTagType == "TEXT")
			{
				window.event.returnValue = true;
				return;
			}
		}
		else if( window.event.srcElement.tagName.toUpperCase() == "TEXTAREA" )
		{
			window.event.returnValue = true;
			return;
		}
		else
		{
			// ÀÏ´Ü TextArea¿¡¼­ÀÇ º¤½ºÆäÀÌ½º°¡ ¾ÊµÇ±â ¶§¹®¿¡ ÀÌ ±â´ÉÀ» ¸·´Â´Ù. - Á¤±â³²			window.event.returnValue = false;
		}
	}
	else
	{
		window.event.returnValue = true;
	}
	
}