	//-- ÀÌ¹ÌÁö ¸®»çÀÌÂ¡ --
	function imgResize(imgW, imgH, maxW, maxH)
	{
		var newW;
		var newH;
		var VarResult = "";
		   
		if(imgW < maxW && imgH < maxH) 
		{ // °¡·Î¼¼·Î°¡ Ãà¼ÒÇÒ °ªº¸´Ù ÀÛÀ» °æ¿ì
			newW = imgW;
			newH = imgH;
		} 
		else
		{
			if( imgW > imgH ) 
			{ // ¿øÅ©±â °¡·Î°¡ ¼¼·Îº¸´Ù Å©¸é
				newW = maxW;
				newH = Math.ceil( imgH * maxW / imgW );
			} 
			else if( imgW <= imgH ) 
			{ //¿øÅ©±âÀÇ ¼¼·Î°¡ °¡·Îº¸´Ù Å©¸é
				newW = Math.ceil(imgW * maxH / imgH);
				newH = maxH;
			}
			else
			{
				newW = maxW;
				newH = maxH;
			}
			
			if(newW > maxW) 
			{ // ±¸ÇØÁø °¡·Î°ªÀÌ Ãà¼Ò °¡·Îº¸´Ù Å©¸é

				newW = maxW;
				newH = Math.ceil(imgH * maxW / imgW);
			}
			
			if(newH > maxH)
			{ // ±¸ÇØÁø ¼¼·Î°ªÀÌ Ãà¼Ò ¼¼·Î°ª°¡·Îº¸´Ù Å©¸é
				newW = Math.ceil(imgW * maxH / imgH);
				newH = maxH;
			}
		}
		   
		if(imgW > maxW || imgH > maxH)
		{
			imgW = newW;
			imgH = newH;
		}
		
		VarResult = imgW +"|"+ imgH;

		return (VarResult);

	 }


	function resizeImg(imgID, maxWidth, maxHeight)
	{

		imgWidth = eval("document." + imgID + ".width");
		imgHeight = eval("document." + imgID + ".height");

		if(imgWidth > maxWidth || imgHeight > maxHeight)
		{
			if(imgWidth > imgHeight)
			{
				reWidth  = maxWidth;
				reHeight = Math.round((imgHeight * reWidth) / imgWidth);
			}
			else
			{
				reHeight = maxHeight;
				reWidth  = Math.round((reHeight * imgWidth) / imgHeight) ;
			}
			}
			else
			{
				reWidth  = imgWidth ;
				reHeight = imgHeight ;
			}

			eval("document." + imgID + ".width = " + reWidth) ;
			eval("document." + imgID + ".height = " + reHeight) ;
	}



	//ÀÌ¹ÌÁö ·¹ÀÌ¾î
	
	function openImageLayerCenter(title,source,e)
	{

		var imgElm=new Image();imgElm.src=source;
		var imageLayer=document.createElement("div");
		
		var imgwidth = imgElm.width;
		var imgheight = imgElm.height;
		
		var TextSplit = imgResize(imgwidth,imgheight,800,600).split("|")
		var TextSplitW = TextSplit[0];
		var TextSplitH = TextSplit[1];
		
		if(!y) var y = event.pageY ? event.pageY : document.body.scrollTop+event.clientY;

		imgwidth = TextSplitW;
		imgheight = TextSplitH;
		
		imageLayer.innerHTML = "<TABLE><TR><TD HEIGHT=\"25\">&nbsp;<STRONG><FONT COLOR='#FFFFFF'>"+ title +"</FONT></STRONG></TD></TR></TABLE>"

		if(imgElm.complete)
		{
			imageLayer.style.cssText="z-index;99999;position:absolute;top:"+(y-300)+";left:"+(((document.body.clientWidth-imgwidth)/2)-70)+";width:"+imgwidth+";height:"+imgheight+";cursor:hand;border:1px solid #555555;padding:4 4 4 4;font:normal 12px lucida console;color:white;background-color:555555;";
		}
		else
		{
			imageLayer.style.cssText="z-index;99999;position:absolute;top:-4000;left:-4000;cursor:hand;border:1px solid deeppink;padding:0 0 0 0;font:normal 12px lucida console;color:white;background-color:555555;";
		}

		with(imageLayer.appendChild(document.createElement("div")))
		{
			style.cssText="padding:1 1 1 1;background-color:888888;";
			with(appendChild(document.createElement("div")))
			{
				style.cssText="padding:5;background-color:white;";
				with(appendChild(document.createElement("img")))
				{
					src=source;
					width = imgwidth;
					height = imgheight;
					if(!imgElm.complete){
						onload=function(){//resize
							with(this.parentNode.parentNode.parentNode.style)
							{
								left=(document.body.clientWidth-this.width)/2;
								top=(document.body.clientHeight-this.height)/2;
								width=this.width;
								height=this.height;
							}
						};//onload
					}

					onclick=function(){//remove
						var win=this.parentNode.parentNode.parentNode;
						win.parentNode.removeChild(win);
					};//onclick
				}//with
			}//with
		}//with
		document.body.appendChild(imageLayer);
	}


	// ÄÁÆß ¸Þ¼¼Áö ¹Ú½º

	function ConfirmJavaScript(JSMessage,JSGotoPageURL) 
	{
			
		var ConFirmTxt = confirm(JSMessage);  

		if(ConFirmTxt){
			document.location.href = JSGotoPageURL;
		}	
		else{
			return;
		}	
	}	


	// ÀÌ¸ÞÀÏ Ã¼Å©

	 function CheckEmail(EmailValue) 
	 {
		var regExp = /[a-z0-9]{2,}@[a-z0-9-]{2,}\.[a-z0-9]{2,}/i;

		if(!regExp.test(EmailValue))
		{
			return false; 
		 }
		else
		{	
			return true; 
		 }
	}

	// ¾ÆÀÌµð ÇÑ±ÛÃ¼Å©

	function IDAlPhaChK(str)
	{
		var ch = str.charAt(0);
		if ( (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') )
			return true;
		else
			return false;
	}

	//¾ÆÀÌµð Ã¹±ÛÀÚ ¼ýÀÚÃ¼Å©
	function IDNumChk( str )
	{
		var result = true;
		for(var i=0; i < str.length;i++)
		{
			var ch=str.charAt(i);

			if ( (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')  || (ch >= '0' && ch <= '9'))
				continue;
			Else
			{
				result = false;
				break;
			}
		}
	    return result;
	}


	// Ã¢ ¶ç¿ì±â

	var DefaultPopupView = null; 
	function DefaultPopup(CurrentOpenPageUrl,PopupName,Width,Height,Scroll)
	{ 
		LeftPosition = (screen.width) ? (screen.width-Width)/2 : 0; 
		TopPosition = (screen.height) ? (screen.height-Height)/10 : 0; 
		PopupSetting = 'height='+Height+',width='+Width+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+Scroll+',resizable=0' 
		DefaultPopupView = window.open(CurrentOpenPageUrl,PopupName,PopupSetting) 
			
		if (DefaultPopupView == null) 
		{
			if ((navigator.userAgent.indexOf("Windows NT 5.1")!=-1) && (navigator.userAgent.indexOf("SV1")!=-1)) {      // SP2 À¥ ºê¶ó¿ìÀú
		        alert("ÆË¾÷ Ã¢ÀÌ Â÷´ÜµÇ¾ú½À´Ï´Ù.\n³»¿ëÀ» º¸½Ã·Á¸é ºê¶ó¿ìÀúÀÇ »ó´Ü ³ë¶õ»ö [¾Ë¸² Ç¥½ÃÁÙ]À» Å¬¸¯ÇÏ½Å ÈÄ\nÆË¾÷ Ã¢À» Çã¿ëÇÏµµ·Ï ¼±ÅÃÇÏ¿© ÆË¾÷ Ã¢À» ¿©½Ê½Ã¿À.");
		    }
		    else {
			  alert("ÆË¾÷ Ã¢À» ¿ÀÇÂ ÇÒ ¼ö ¾ø½À´Ï´Ù.\n³»¿ëÀ» º¸½Ã·Á¸é ÆË¾÷ Â÷´Ü ÇÁ·Î±×·¥ÀÌ ¼³Ä¡µÇ¾î ÀÖ´Â °æ¿ì ÆË¾÷ Ã¢À» Çã¿ëÇÏ¿© ÆË¾÷ Ã¢À» ¿©½Ê½Ã¿À.");
		    }
		} else 
		{
		    DefaultPopupView;
		}
	}	


	//Goto URL Location
	function PageLocationURL(GotoPageURL) 
	{
											
		if (GotoPageURL != "") 
    	{
												
			document.location.href = GotoPageURL;
		}	
												
		else {
												
			alert("URL ¿À·ùÀÔ´Ï´Ù.\n\n»õ·Î°íÄ§ ÈÄ ´Ù½Ã ÀÌ¿ëÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
		}	
											
	}			
		
	//Goto Windows URL Location
	function WindowsLocationURL(GotoPageURL) 
	{
											
		if (GotoPageURL != "") 
		{
												
			document.location.href = GotoPageURL;
		}	
		else 
		{
			alert("URL ¿À·ùÀÔ´Ï´Ù.\n\n»õ·Î°íÄ§ ÈÄ ´Ù½Ã ÀÌ¿ëÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
		}	
	}	
				

	//Document Write	
	function documentwrite(GotoSrcString)
	{
		document.write(GotoSrcString);
	}

	//ÇÃ·¡½¬ ÄÚµå

	function MakeFlashString(FlashFileURL,WIdthSize,HeightSize,WmodeString,FlashNameString,AlignString) 
	{
		if(WmodeString == "1")
		{
			return "<OBJECT classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"  codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" WIDTH=\""+WIdthSize+"\" HEIGHT=\""+HeightSize+"\" id=\""+FlashNameString+"\" ALIGN=\""+AlignString+"\"><PARAM NAME=movie VALUE=\""+FlashFileURL+"\"><PARAM NAME=quality VALUE=high><PARAM NAME=\"allowScriptAccess\" VALUE=\"sameDomain\" /><PARAM NAME=\"wmode\" VALUE=\"transparent\" /><EMBED src=\""+FlashFileURL+"\" quality=high bgcolor=#FFFFFF WIDTH=\""+WIdthSize+"\" HEIGHT=\""+HeightSize+"\" NAME=\""+FlashNameString+"\" ALIGN=\""+AlignString+"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED></OBJECT>";
		}
		else
		{
			return "<OBJECT classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"  codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" WIDTH=\""+WIdthSize+"\" HEIGHT=\""+HeightSize+"\" id=\""+FlashNameString+"\" ALIGN=\""+AlignString+"\"><PARAM NAME=movie VALUE=\""+FlashFileURL+"\"><PARAM NAME=quality VALUE=high><PARAM NAME=\"allowScriptAccess\" VALUE=\"sameDomain\" /><EMBED src=\""+FlashFileURL+"\" quality=high bgcolor=#FFFFFF WIDTH=\""+WIdthSize+"\" HEIGHT=\""+HeightSize+"\" NAME=\""+FlashNameString+"\" ALIGN=\""+AlignString+"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED></OBJECT>";
		}										
	}

	//µ¿¿µ»ó ÄÚµå

	function MakeMovieString(MovieFileURL,WIdthSize,HeightSize) 
	{
		var strObj = "";
		strObj += "<OBJECT id=\"moviePlayer\" width=\""+WIdthSize+"\" height=\""+HeightSize+"\" classid=\"CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95\" standby=\"Loading Microsoft?Windows?Media Player components...\" type=\"application/x-oleobject\">\n";
		strObj += "<param name=\"transparentAtStart\" value=\"True\">\n";
		strObj += "<param name=\"transparentAtStart\" value=\"True\">\n";
		strObj += "<param name=\"Loop\" value=\"True\">\n";
		strObj += "<param name=\"AnimationAtStart\" value=\"False\">\n";
		strObj += "<param name=\"AutoStart\" value=\"true\">\n";
		strObj += "<param name=\"AutoRewind\" value=\"true\">\n";
		strObj += "<param name=\"DisplaySize\" value=\"0\">\n";
		strObj += "<param name=\"AutoSize\" value=\"false\">\n";
		strObj += "<param name=\"ShowDisplay\" value=\"false\">\n";
		strObj += "<param name=\"ShowStatusBar\" value=\"true\">\n";
		strObj += "<param name=\"ShowControls\" value=\"false\">\n";
		strObj += "<param name=\"EnableContextMenu\" value=\"False\">\n";
		strObj += "<param name=\"FileName\" value=\""+MovieFileURL+"\">\n";
		strObj += "<param name=\"Volume\" value=\"60\">\n";
		strObj += "</OBJECT>\n";

		return strObj
	}

	function FunMoviePlay()	
	{
		var FunMovieObj = eval("document.getElementById('moviePlayer')");
		if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) 
		{
			FunMovieObj.Play();
		}
	}
	
	function FunMovieStop()	{

		var FunMovieObj = eval("document.getElementById('moviePlayer')");

		if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) 
		{
			FunMovieObj.Stop();
			FunMovieObj.CurrentPosition=0;
		}
	}

	function FunMoviePause()	{

		var FunMovieObj = eval("document.getElementById('moviePlayer')");

		if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) 
		{
			FunMovieObj.Pause();
		}
	}
	


	//¼ýÀÚ Ã¼Å©
	function NumCheckFun(obj) 
	{ 
		var InNumValue = /^(\d+)$/; 

		if (obj.value != "" && !obj.value.match(InNumValue)) 
		{ 
		    alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù."); 
            obj.value = "";
		} 	
    }
	
	function clearField(field)
	{ 
		if (field.value == field.defaultValue) 
	    { 
			field.value = ""; 
	    } 
	}

	function checkField(field)
	{ 
		if (field.value == "") 
	    { 
			field.value = field.defaultValue; 
	    } 
	}

	//ÀÌ¹ÌÁöµî·ÏÆÄÀÏ È®ÀåÀÚ Ã¼Å©
	function FileExtCheck(FileName)
	{
	
		var FileExtArray = new Array("jpg", "jpeg", "gif", "bmp", "png");
		var CheckValue, FileExtName, i;

		CheckValue = false;
		FileExtName	= FileName.substring(FileName.lastIndexOf(".")+1,FileName.length);
		FileExtName = FileExtName.toLowerCase();
		for(i = 0; i < FileExtArray.length; i++)
		{
			if(FileExtArray[i] == FileExtName)
			{
				CheckValue = true;
				i = FileExtArray.length;
			}
		}
		return CheckValue;
	}

	//¹«ºñµî·ÏÆÄÀÏ È®ÀåÀÚ Ã¼Å©
	function MovieExtCheck(FileName)
	{

		var FileExtArray = new Array("avi", "mov", "asf", "mpg", "wmv", "flv", "swf");
		var CheckValue, FileExtName, i;

		CheckValue = false;
		FileExtName	= FileName.substring(FileName.lastIndexOf(".")+1,FileName.length);
		FileExtName = FileExtName.toLowerCase();
		for(i = 0; i < FileExtArray.length; i++)
		{
			if(FileExtArray[i] == FileExtName)
			{
				CheckValue = true;
				i = FileExtArray.length;
			}
		}
		return CheckValue;
	}

	//¸ÞÀÎ ÇÖÅ¬¸³ ÀÌ¹ÌÁö È®ÀåÀÚ Ã¼Å©
	function JpgFileExtCheck(FileName)
	{
	
		var FileExtArray = new Array("jpg", "jpeg");
		var CheckValue, FileExtName, i;

		CheckValue = false;
		FileExtName	= FileName.substring(FileName.lastIndexOf(".")+1,FileName.length);
		FileExtName = FileExtName.toLowerCase();
		for(i = 0; i < FileExtArray.length; i++)
		{
			if(FileExtArray[i] == FileExtName)
			{
				CheckValue = true;
				i = FileExtArray.length;
			}
		}
		return CheckValue;
	}
	// ÇÑ±Û ±ÛÀÚ Á¦ÇÑ
	function TextLenByteChk(obj,TextMaxLen)
	{
		var ls_str=obj.value;
		var li_str_len=ls_str.length;
		var li_max= TextMaxLen * 2;
		var i= 0;	
		var li_byte=0;
		var li_len=0;	
		var ls_one_char= "";
		var ls_str2= "";	
		for(i=0; i< li_str_len; i++) 
		{
			ls_one_char = ls_str.charAt(i);
			if (escape(ls_one_char).length > 4) li_byte += 2;
			else li_byte++;
				if (li_byte <= li_max) li_len = i + 1;
		}
		
		if(li_byte > li_max) 
		{
			alert("ÁË¼ÛÇÕ´Ï´Ù.\n\nÇÑ±Û " +  TextMaxLen + "±ÛÀÚ¸¦ ÃÊ°ú ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù.\nÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿À¸·Î »èÁ¦ µË´Ï´Ù.");
			ls_str2 = ls_str.substr(0, li_len);
			obj.value = ls_str2;
		}
		obj.focus();
	}

	
	
    function XMLSelectFun(XmlFile,SelectIDValue,SelectCodeValue)
    {

		var xmlDOC = getXmlDom();
		xmlDOC.async = false;
    
		xmlDOC.load ("/Commonness/XML/"+XmlFile);
    
    
        var objIndex = xmlDOC.getElementsByTagName("XmlNodeData");
        var objSelect = eval("document.Cmd_MainForm."+SelectIDValue);

        for (i=0;i< objIndex.length;i++ )
        {
            ArrayDataCode =  xmlDOC.getElementsByTagName("XmlDataCode")[i].firstChild.nodeValue;
            ArrayDataName = xmlDOC.getElementsByTagName("XmlDataName")[i].firstChild.nodeValue;
            
            objSelect.options[objSelect.length] = new Option( ArrayDataName, ArrayDataCode );
            
            if(ArrayDataCode == SelectCodeValue)
            {
				objSelect.value = ArrayDataCode;
            }
        }
    }
	
    function getXmlDom() 
    {
        var xmlDomProgIDs = ["MSXML2.DOMDocument.6.0",
                             "MSXML2.DOMDocument.5.0",
                             "MSXML2.DOMDocument.4.0",
                             "MSXML2.DOMDocument.3.0",
                             "MSXML2.DOMDocument",
                             "Microsoft.XmlDom"];

        for(var i = 0; i < xmlDomProgIDs.length; i++)
        {
            try
            {
                var xmlDom = new ActiveXObject(xmlDomProgIDs[i]);
                return xmlDom;
            }
            catch(e)
            {
                // ¹«½Ã
            }
		}
        throw new "MSXML ÀÌ ¼³Ä¡µÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù!";
    }

	
	function CommaReplace(Str) 
	{ 
		 return Str.replace(/^\$|,/g, '');
    }

	function ChkNum(Str)
	{ 
		var NumValue =/(^\d+$)|(^\d+\.\d+$)/ ;

		if (NumValue.test(Str)) 
		{
			return true; 
		}
		else
		{ 
			return false; 
		} 
	} 

	//3ÀÚ¸® ÄÞ¸¶ Âï±â
	function CommaPrint(obj)  
	{ 
		var NumValue = obj.value;
		 NumValue = CommaReplace(NumValue.trim());
		
		if(!ChkNum(NumValue))
		{
			alert("¼ýÀÚ·Î ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.\nÀÔ·Â¹®ÀÚ : "+obj.value);
			obj.value = "";
		}
		else
		{
			obj.value = commaSplit(NumValue);
		}
	} 
	/*
		.trim()
	*/
	String.prototype.trim = function() {
		return this.replace(/(^ *)|( *$)/g, "");
	}

	/*
		.ltrim()
	*/
	String.prototype.ltrim = function() {
		return this.replace(/(^ *)/g, "");
	}

	/*
		.rtrim()
	*/
	String.prototype.rtrim = function() {
		return this.replace(/( *$)/g, "");
	}

	function CommaReMove(obj) 
	{ 
		obj.value = obj.value.replace(/^\$|,/g, '');
    }

	
	function commaSplit(srcNumber) 
	{
		var txtNumber = '' + srcNumber;

		var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
		var arrNumber = txtNumber.split('.');
		arrNumber[0] += '.';
		do{
			arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
		} 
		while (rxSplit.test(arrNumber[0]));
		if (arrNumber.length > 1) {
			return arrNumber.join('');
		}
		else {
			return arrNumber[0].split('.')[0];
	    }
	}
 

	function LogINConfirm(NextGotoPageURL) 
	{
			
		var ConFirmTxt = confirm("È¸¿øÀü¿ë °Ô½ÃÆÇÀÔ´Ï´Ù. È¸¿ø·Î±×ÀÎÀÌ ÇÊ¿äÇÕ´Ï´Ù.\nÈ¸¿ø ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î ?");  

		if(ConFirmTxt)
		{
			
			ModalDefaultPopup('/Front/Member/Member_LogIN.asp?NextGotoPageURL='+NextGotoPageURL, 403, 151, 0, 0, 0);

		}	
		else
		{
			return;
		}	
	}

	
	function ModalDefaultPopup(CurrentOpenPageUrl, Width, Height, Vresizable, Vstatus, VScroll)
	{ 

		var NewHeight, NewWidth;

		if(navigator.userAgent.indexOf("MSIE 6.0") > 0)
		{
			NewHeight = parseInt(Height) + 30;
			NewWidth = parseInt(Width);
		}
		else
		{
			NewHeight = Height;			
			NewWidth = Width;
		}

		if(window.showModalDialog)
		{ 
			var PopupSetting = 'dialogHeight : '+parseInt(NewHeight)+'px; dialogWidth : '+parseInt(NewWidth)+'px; resizable : '+Vresizable+'; help : 0; status : '+Vstatus+'; scroll : '+VScroll;
			var ModalPopupView = window.showModalDialog(CurrentOpenPageUrl,document,PopupSetting);
		}
		else
		{
			DefaultPopup(CurrentOpenPageUrl, "DefaultPop", NewWidth, NewHeight, VScroll);
		}
	}	

	function newXMLHTTP() 
	{
		if(window.XMLHttpRequest) 
		{
			try 
			{
				xmlhttp = new XMLHttpRequest();
			} 
			catch(e) 
			{
				alert("XMLHTTP¸¦ ÃÊ±âÈ­ÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return false;
			}
		} 
		else if(window.ActiveXObject) 
		{
			try 
			{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch(e) 
			{
				try 
				{
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				} 
				catch(e) 
				{
					alert("XMLHTTP¸¦ ÃÊ±âÈ­ÇÒ ¼ö ¾ø½À´Ï´Ù.");
					return false;
				}
			}

		} else 
		{
			alert("XMLHTTP¸¦ ÃÊ±âÈ­ÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return false;
		}

		return xmlhttp;
	}

	function commonFormPost(frmObj)
	{
		var str = '';
        var elm;
        var endName ='';
		
		for( i = 0,k = frmObj.length; i < k; i++ )
		{
			elm = frmObj[i];            
			switch( elm.type )
			{
				case 'text':
                case 'hidden':
                case 'password':
                case 'textarea':
                case 'select-one':
					str += elm.name + '=' + escape(elm.value) + '&';
                    break;
				case 'select-multiple':
					sElm = elm.options;
                    str += elm.name + '='
                    for( x = 0, z = sElm.length; x <z; x++ )
					{
						if( sElm[x].selected )
						{
							str += escape(sElm[x].value) + ',';
                        }
					}
                    str = str.substr(0, str.length -1 ) + '&';
                    break;
				
				case 'radio':
					if( elm.checked )
					{
						str += elm.name + '=' + escape(elm.value) + '&';
					}
					break;
				
				case 'checkbox':					
					if(elm.checked)
					{
						if(elm.name == endName)
						{
							if( str.lastIndexOf('&') == str.length-1)
							{
								str = str.substr(0, str.length -1 );
							}
                            str += ',' + escape(elm.value);
                         }
						 else
						 {
							str += elm.name + '=' + escape(elm.value);
                         }
                         str += '&';
                         endName = elm.name;
                     }
                     break;
			}
		}
		return str.substr(0, str.length - 1 );
	}

	function SendXMLDataFun(obj, ActionURL, ActionFlag) 
	{			
		var xmlhttp = newXMLHTTP();
		var i, senddata;
		if(!xmlhttp)
		{
			return false;
		}	
		
		commonFormPost(obj)
		
		senddata = commonFormPost(obj);

		xmlhttp.open("POST",ActionURL,true);
		xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
		xmlhttp.send(senddata);

		xmlhttp.onreadystatechange = function() 
		{
			if(xmlhttp.readyState == 4) 
			{
				if(xmlhttp.status == 200) 
				{ 
					if(ActionFlag == "1")
					{
						PopupCallBackResult(xmlhttp);
					}
					else if(ActionFlag == "2")
					{
						PassFindCallBackResult(xmlhttp);
					}
				} 
				else 
				{
					alert("! ÀÚ·á Àü¼Û Áß ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù:\n\n"+xmlhttp.status+" "+xmlhttp.statusText);
				}
			}
		}  
	}

	function PopupCallBackResult(xmlhttp) 
	{
		var xmlDoc = xmlhttp.responseXML;
		var XmlDataFlag = eval("xmlDoc.getElementsByTagName('XmlDataFlag')[0]").firstChild.nodeValue;
		var XmlDataMsg, XmlDataGotoURL;

		if(XmlDataFlag == "1")//Error Message
		{
			XmlDataMsg = eval("xmlDoc.getElementsByTagName('XmlDataMsg')[0]").firstChild.nodeValue;
			XmlDataMsg = XmlDataMsg.replace(/\¦±/g,"\n");

			alert(XmlDataMsg);
		}
		else if(XmlDataFlag == "2")//Goto URL WIndows Close
		{
			XmlDataMsg = eval("xmlDoc.getElementsByTagName('XmlDataMsg')[0]").firstChild.nodeValue;
			XmlDataMsg = XmlDataMsg.replace(/\¦±/g,"\n");
			XmlDataGotoURL = eval("xmlDoc.getElementsByTagName('XmlDataGotoURL')[0]").firstChild.nodeValue;
			
			if(XmlDataMsg != "")
			{
				alert(XmlDataMsg);
			}

			WindowLocationClose(XmlDataGotoURL);
		}
		else if(XmlDataFlag == "3")//Goto URL WIndows Close
		{
			XmlDataMsg = eval("xmlDoc.getElementsByTagName('XmlDataMsg')[0]").firstChild.nodeValue;
			XmlDataMsg = XmlDataMsg.replace(/\¦±/g,"\n");
			XmlDataGotoURL = eval("xmlDoc.getElementsByTagName('XmlDataGotoURL')[0]").firstChild.nodeValue;
			
			if(XmlDataMsg != "")
			{
				alert(XmlDataMsg);
			}

			ModalPageLocationURL(document.Cmd_MainForm, XmlDataGotoURL);
		}
	}

	//Goto Windows URL Location Close
	function WindowLocationClose(GotoPageURL) 
	{
		if (GotoPageURL != "") 
		{
			if(window.dialogArguments)
			{	
				window.dialogArguments.location.href = GotoPageURL;
				if(window.close())
				{
					window.close();
				}
				else
				{
					self.close();
				}
			}
			else
			{	
				window.parent.opener.document.location.href = GotoPageURL;
				if(window.close())
				{
					window.close();
				}
				else
				{
					self.close();
				}
			}
		}	
		else 
		{
			alert("!URL ¿À·ùÀÔ´Ï´Ù.\n\n»õ·Î°íÄ§ ÈÄ ´Ù½Ã ÀÌ¿ëÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
		}	
	}	

	function ModalPageLocationURL(form, GotoPageURL) 
	{
		if (GotoPageURL != "") 
   		{
			if (window.showModelessDialog) 
			{
				form.target = "ModalFrm"; 
				form.action = GotoPageURL;
				form.submit();
			}
			else
			{
				form.action = GotoPageURL;
				form.submit();
			}
		}	
		else
		{
			alert("!URL ¿À·ùÀÔ´Ï´Ù.\n\n»õ·Î°íÄ§ ÈÄ ´Ù½Ã ÀÌ¿ëÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
		}	
	}	

	function ConfirmSubmit(JSMessage, JSGotoPageURL, FormName, TargetName)
	{ 
		var ConFirmTxt = confirm(JSMessage);  

		if(ConFirmTxt)
		{
			if (JSGotoPageURL != "") 
			{
				FormName.target = TargetName; 
				FormName.action = JSGotoPageURL;
				FormName.submit();
			}	
			else
			{										
				alert("!URL ¿À·ùÀÔ´Ï´Ù.\n\n»õ·Î°íÄ§ ÈÄ ´Ù½Ã ÀÌ¿ëÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
				return;
			}
		}	
		else
		{
			return;
		}	
	}
