
function pressEnter(func, obj)
{
	if(event.keyCode == 13)
	{
		if(eval(func))
		{
			if(obj != '')
			{
				__doPostBack(obj,'');
			}
		}
		return false;
	}
	else{
		return true;
	}
}
function pressEnterKey( buttonID ){
	if(event.keyCode == 13)
	{
		if( document.getElementById(buttonID) != null )
			document.getElementById(buttonID).click();
		return false;
	}
}
function ParseKeyColumnName( colName ){
	var strReturn = colName;
	if( colName.indexOf('(') > 0 && colName.indexOf(')') > 0 )
		strReturn = colName.subString(0,colName.indexOf('('));
	return strReturn;
}
function checkRequiredField(obj, msg)
{
	if(Trim(obj.value) == ""){
		if(msg != ""){
			alert(msg);
		}
		obj.focus();
		return false;
	}
	return true;
}

function Trim(st)
{
	while(st && st.indexOf(" ") == 0) st = st.substring(1);
	while(st && st.lastIndexOf(" ") ==  st.length-1) st = st.substring(0, st.length-1);
	return st;
}

//------ À©µµ¿ì Áß¾Ó¿¡ ÆË¾÷Ã¢ -------//

var win = null;
function NewWindow(mypage,myname,w,h,scroll)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no,status=no'
	win = window.open(mypage,myname,settings)

	win.focus();
}

function NewWindow(mypage,myname,w,h,scroll, resize)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resize+',status=no'
	win = window.open(mypage,myname,settings)

	win.focus();
}
//-----------------------------------//

//---------- ÀÌº¥Æ® À§Ä¡ À©µµ¿ì ------------//
var xCoord, yCoord;
function checkwhere(e)
{
    xCoord = window.event.screenX-70;
    yCoord = window.event.screenY+12;

}
document.onmousedown = checkwhere;

function NewWindowDiary(mypage,myname,w,h,scroll)
{
    LeftPosition = xCoord;
    TopPosition  = yCoord;
    settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+', resizable=0, menubar=0, toolbar=no,status=0';
    win = window.open(mypage,myname,settings)
}
//-------------------------------------------//

//------------- modal À©µµ¿ì -------------------//
function NewModalDialog(mypage, mytitle, w, h, scroll)
{
	var sFeatures="dialogHeight: " + w + "px; dialogWidth:"+ h +"px;  scroll: "+ scroll+ "; resizable: no; help: no; status: no; ";
	var Text = showModalDialog(mypage, mytitle, sFeatures)

	return Text;
}
//----------------------------------------------//

//-------------- ÀÌ¸ÞÀÏ Ã¼Å©-------------------//
function isEmail(strEmail)
{
	var str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
	var arrEmail = strEmail.split('@');

	if(arrEmail.length == 2){
		if(Trim(arrEmail[0]) == "" || Trim(arrEmail[1]) == "")
		{
			return false;
		}
		else{
			var chkEmail = arrEmail[0].split('.');
			if(chkEmail.length > 1){
				for(var i=0; i < chkEmail.length; i++)
				{
					for(var j=0; j < chkEmail[i].length; j++)
					{
						if(str.indexOf(chkEmail[i].charAt(j)) < 0)
						{
							return false;
						}
					}
				}
			}
			else{
				for(var j=0; j < arrEmail[0].length; j++)
				{
					if(str.indexOf(arrEmail[0].charAt(j)) < 0)
					{
						return false;
					}
				}
			}

			chkEmail = arrEmail[1].split('.');
			if(chkEmail.length > 1){
				for(var i=0; i < chkEmail.length; i++)
				{
					for(var j=0; j < chkEmail[i].length; j++)
					{
						if(str.indexOf(chkEmail[i].charAt(j)) < 0)
						{
							return false;
						}
					}
				}
			}
			else{
				for(var j=0; j < arrEmail[0].length; j++)
				{
					if(str.indexOf(arrEmail[0].charAt(j)) < 0)
					{
						return false;
					}
				}
			}

			return true;
		}
	}
	else{
		return false;
	}
}
//-----------------------------------------------//

//------------ ÀüÃ¼ ¼±ÅÃ(Ã¼Å©¹Ú½º) --------------//
function CheckAll()
{
	var i;
	f = document.form;

	if(f.checked_id)
	{
		len = f.checked_id.length;
	    if (document.form.checked_id.length > 1)
    	{
		 	if(f.checked_all.checked==true)
 			{
				for(i=0;i<len;i++)
				{
					f.checked_id[i].checked=true;
				}
			}
			else
			{
				for(i=0;i<len;i++)
				{
					f.checked_id[i].checked=false;
				}
			}
		}
		else
		{
		 	if(f.checked_all.checked==true)
	 		{
				f.checked_id.checked=true;
			}
			else
			{
				f.checked_id.checked=false;
			}
		}
	}
	else
	{
		f.checked_all.checked=false;
	}
}
//---------------------------------------//

//------------ ·Ñ¿Àº¸ ÀÌ¹ÌÁö ¹öÆ° ------------//

	dynamicanimAttr = "dynamicanimation"
	animCancel = "skipanim"
	fpanimationPrefix = "fpAnim"
	animateElements = new Array()
	currentElement = 0
	speed = 1
	stepsZoom = 8
	stepsWord = 8
	stepsFly = 17
	stepsSpiral = 16
	stepsSpiralWord = 19
	stepsElastic = 32
	steps = stepsZoom
	step = 0
	cornerPhase=0
	outEffect=0
	function remSuffix(str)
	{
		ind=str.indexOf("FP")
		str = str.substring(0,ind)
		return str
	}
	function dynAnimOut(el)
	{
		outEffect=1
		dynAnimation(el)
		outEffect=0
	}
	function dynAnimation(obj)
	{
		animateElements = new Array()
		var ms = navigator.appVersion.indexOf("MSIE")
		ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)
		if(!ie4)
		{
			if((navigator.appName == "Netscape") &&
				(parseInt(navigator.appVersion.substring(0, 1)) >= 4))
				doc_els=document.layers
			else
				return
		}
		else
			doc_els=document.all
        if(outEffect && !ie4)
            return
		if(ie4)
		{
		    for (index=document.all.length-1; index >= document.body.sourceIndex; index--)
			{
				el = document.all[index]
				if(outEffect && el != obj)
					continue
				if(outEffect)
					animationId = el.id.substring(9,el.id.length)
				else
					animationId = el.id.substring(6,el.id.length)
				animation=remSuffix(animationId)
				if(null != animation)
				{
					altcnt=0
					if(	animation == "dropWord"				||
						animation == "flyTopRightWord"			||
						animation == "flyBottomRightWord"		||
						animation == "waveWords"			||
						animation == "hopWords")
					{
						ih = el.innerHTML
						outString = ""
						i1 = 0
						iend = ih.length
						while(true)
						{
							i2 = startWord(ih, i1)
							if(i2 == -1)
							i2 = iend
							outWord(ih, i1, i2, false, "", outEffect ? obj.id : el.id)
							if(i2 == iend)
								break
							i1 = i2
							i2 = endWord(ih, i1)
							if(i2 == -1)
								i2 = iend
							if (animation == "waveWords")
								outWordAlt(ih, i1, i2, true, animation, altcnt)
							else
								outWord(ih, i1, i2, true, (outEffect ? "Out" : "") + animation,
									outEffect ?  obj.id : el.id)

							if(i2 == iend)
								break
							i1 = i2
							altcnt++
						}
						document.all[index].innerHTML = outString
						document.all[index].style.posLeft = 0
						document.all[index].setAttribute(animCancel, true)
						document.all[index].style.visibility="visible"
					}
				}
			}
		}
		i = 0
		for (index=0; index < doc_els.length; index++)
		{
			el = doc_els[index]
			if(0 != el.id.indexOf(fpanimationPrefix))
				continue
			if (ie4)
			{
				elprops=el.style
				scrollOffsetTop=document.body.scrollTop
				docHeight=document.body.offsetHeight
				docWidth=document.body.offsetWidth
				elW=100
				elH=el.offsetHeight
			}
			else
			{
				elprops=el
				scrollOffsetTop=window.pageYOffset
				docHeight=window.innerHeight
				docWidth=window.innerWidth
				elW=el.clip.width
				elH=el.clip.height
			}
			if(outEffect)
				animationId = el.id.substring(9,el.id.length)
			else
				animationId = el.id.substring(6,el.id.length)
			animation=remSuffix(animationId)
			if(outEffect && (obj != el))
			{
				if(el.SRCID != obj.id)
					continue
			}
			if (null != animation )
			{
				if(ie4 && null!=el.getAttribute(animCancel, false))
					continue
				if(!ie4)
				{
					elprops.posLeft=elprops.left
					elprops.posTop=elprops.top
				}
				el.startL=offsetLeft(el)
				if(animation == "flyLeft")
				{
					elprops.posLeft = -offsetLeft(el)-elW
					elprops.posTop = 0
				}
				else if(animation == "flyRight" || animation=="elasticRight")
				{
					elprops.posLeft = -offsetLeft(el)+docWidth
					elprops.posTop = 0
				}
				else if(animation == "flyTop" || animation == "dropWord")
				{
					elprops.posLeft = 0
					elprops.posTop = scrollOffsetTop-offsetTop(el)-elH
				}
				else if(animation == "flyBottom" || animation == "elasticBottom")
				{
					elprops.posLeft = 0
					elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight
				}
				else if(animation == "flyTopLeft")
				{
					elprops.posLeft = -offsetLeft(el)-elW
					elprops.posTop = scrollOffsetTop-offsetTop(el)-elH
				}
				else if(animation == "flyTopRight" || animation == "flyTopRightWord")
				{
					elprops.posLeft = -offsetLeft(el)+docWidth
					elprops.posTop = scrollOffsetTop-offsetTop(el)-elH
				}
				else if(animation == "flyCorner")
				{
					elprops.posLeft = docWidth*0.2-offsetLeft(el)

					elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight
				}
				else if(animation == "flyBottomLeft")
				{
					elprops.posLeft = -offsetLeft(el)-elW
					elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight
				}
				else if(animation == "flyBottomRight" || animation == "flyBottomRightWord")
				{
					elprops.posLeft = -offsetLeft(el)+docWidth
					elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight
				}
				else if(animation == "spiral")
				{
					elprops.posLeft = -offsetLeft(el)+docWidth
					elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight
				}
				else if((animation.indexOf("waveWords") != -1) || animation=="hopWords")
				{
					if(i)
					{
						prevEl=animateElements[i-1]
						elprops.r = offsetLeft(el)-prevEl.startL
					}
					else
						elprops.r = offsetLeft(el)
				}
				else if(animation == "wipeLR" || animation == "wipeMID")
				{
					if (ie4 && elprops.position=="absolute")
					{
						el.sizeW=el.offsetWidth
						elprops.clip="rect(0 0 0 0)"
					}
					else if (!ie4)
					{
						el.sizeW=el.clip.width
						el.clip.width=0
					}
				}
				else if(animation == "wipeTB")
				{
					if (ie4 && elprops.position=="absolute")
					{
						elprops.clip="rect(0 0 0 0)"
					}
					else if(!ie4)
					{
						el.sizeH=el.clip.height
						el.clip.height=0
					}
				}
				else if(animation == "zoomIn")
				{
					elprops.posLeft = 0
					elprops.posTop = 0
				}
				else if(animation == "zoomOut")
				{
					elprops.posLeft = 0
					elprops.posTop = 0
				}
				else
				{
					continue
				}
				if(!outEffect)
				{
					el.initLeft = elprops.posLeft
					el.initTop  = elprops.posTop
					el.endLeft  = 0
					el.endTop   = 0
					elprops.visibility = "hidden"
				}
				else
				{
					el.initLeft = 0
					el.initTop  = 0
					el.endLeft = elprops.posLeft
					el.endTop  = elprops.posTop
					elprops.posTop = 0
					elprops.posLeft = 0
				}
				if(!ie4)
				{
					elprops.left=elprops.initLeft
					elprops.top =elprops.initTop
				}
				animateElements[i++] = el
			}
		}
		if(animateElements.length > 0)
		{
			if(outEffect)
				window.setTimeout("animate(1);", speed, "Javascript")
			else
				window.setTimeout("animate(0);", speed, "Javascript")
		}
	}
	function offsetLeft(el)
	{
		if(ie4)
		{
			x = el.offsetLeft
			for (e = el.offsetParent; e; e = e.offsetParent)
				x += e.offsetLeft
			return x
		}
		else
		{
			x = el.pageX
			return x
		}
	}
	function offsetTop(el)
	{
		if(ie4)
		{
			y = el.offsetTop
			for (e = el.offsetParent; e; e = e.offsetParent)
				y += e.offsetTop;
			return y
		}
		else
		{
			y = el.pageY
			return y
		}
	}
	function startWord(ih, i)
	{
		for(tag = false; i < ih.length; i++)
		{
			c = ih.charAt(i)
			if(c == '<')
			{
				if(ih.substring(i+1, i+4) == "IMG")
				return i;
				tag = true
			}
			if(!tag)
				return i
			if(c == '>')
				tag = false
		}
		return -1
	}
	function endWord(ih, i)
	{
		nonSpace = false
		space = false
		img = false
		if(ih.charAt(i) == '<')
		{
			img = true
			i++;
		}
		while(i < ih.length)
		{
			c = ih.charAt(i)
			if(c != ' ')
				nonSpace = true
			if(img && c == '>')
				img = false;
			if(nonSpace && !img && c == ' ')
				space = true
			if(c == '<')
				return i
			if(space && c != ' ')
				return i
			i++
		}
		return -1
	}
	function outWord(ih, i1, i2, dyn, anim, srcID)
	{
		if(dyn)
			if(!outEffect)
				outString += "<SPAN ID=\"" +  fpanimationPrefix + anim + "FP\" style=\"position: relative; visibility: hidden;\">"
			else
				outString += "<SPAN SRCID=\"" + srcID + "\"ID=\"" +  fpanimationPrefix + anim + "FP\" style=\"position: relative;\">"
		outString += ih.substring(i1, i2)
		if(dyn)
			outString += "</SPAN>"
	}
	function outWordAlt(ih, i1, i2, dyn, anim, altcnt)
	{
		if(dyn)
		{
			if(altcnt%2)
				outString += "<SPAN ID=\"" +  fpanimationPrefix + anim + "LFP\" style=\"position: relative;  visibility: hidden;\">"
			else
				outString += "<SPAN ID=\"" +  fpanimationPrefix + anim + "RFP\" style=\"position: relative;  visibility: hidden;\">"
		}

		outString += ih.substring(i1, i2)
		if(dyn)
			outString += "</SPAN>"
	}
	function animate(animOut)
	{
		el = animateElements[currentElement]
		if(animOut)
			animationId = el.id.substring(9,el.id.length);
		else
			animationId = el.id.substring(6,el.id.length);
		animation=remSuffix(animationId)
		if (ie4)
			elprops=el.style
		else
			elprops=el

		if(!step && !animOut)
			elprops.visibility="visible"
		step++
		if(animation == "spiral")
		{
			steps = stepsSpiral
			v = step/steps
			rf = 1.0 - v
			t = v * 2.0*Math.PI
			rx = Math.max(Math.abs(el.initLeft), 200)
			ry = Math.max(Math.abs(el.initTop),  200)
			elprops.posLeft = Math.ceil(-rf*Math.cos(t)*rx)
			elprops.posTop  = Math.ceil(-rf*Math.sin(t)*ry)
		}
		else if(animation == "waveWordsL" || animation=="hopWords" || animation == "waveWords")
		{
			steps = stepsSpiralWord
			v = step/steps
			rf = (1.0 - v)
			t = v * 1.0*Math.PI
			elprops.posLeft = Math.ceil(-rf*Math.cos(t)*elprops.r)
			elprops.posTop  = Math.ceil(-rf*Math.sin(t)*elprops.r)
		}
		else if(animation == "waveWordsR")
		{
			steps = stepsSpiralWord
			v = step/steps
			rf = (1.0 - v)
			t = v * 1.0*Math.PI
			elprops.posLeft = Math.ceil(-rf*Math.cos(t)*elprops.r)
			elprops.posTop  = Math.ceil( rf*Math.sin(t)*elprops.r)
		}
		else if(animation == "zoomIn")
		{
			steps = stepsZoom
			elprops.fontSize = Math.ceil(50+50*step/steps) + "%"
			elprops.posLeft = 0
		}
		else if(animation == "zoomOut")
		{
			steps = stepsZoom
			fontSz=Math.ceil(100+200*(steps-step)/steps) + "%"
			elprops.fontSize = fontSz
			elprops.posLeft = 0
		}
		else if(animation == "elasticRight")
		{
			steps = stepsElastic
			v = step/steps
			rf=Math.exp(-v*7)
			t = v * 1.5*Math.PI
			rx =Math.abs(el.initLeft)
			elprops.posLeft = rf*Math.cos(t)*rx
			elprops.posTop  = 0
		}
		else if(animation == "elasticBottom")
		{
			steps = stepsElastic
			v = step/steps
			rf=Math.exp(-v*7)
			t = v * 2.5*Math.PI
			ry =Math.abs(el.initTop)
			elprops.posLeft = 0
			elprops.posTop  = rf*Math.cos(t)*ry
		}
		else if(animation == "wipeLR")
		{
			steps = stepsElastic
			if(ie4 && elprops.position=="absolute")
				elprops.clip = "rect(0 "+ step/steps*100 +"% 100% 0)"
			else if (!ie4)
			{
				elprops.clip.right=step/steps*el.sizeW
			}
		}
		else if(animation == "wipeTB")
		{
			steps = stepsElastic
			if(ie4 && elprops.position=="absolute")
				elprops.clip = "rect(0 100% "+step/steps*el.offsetHeight+"px 0)"
			else
				elprops.clip.bottom=step/steps*el.sizeH
		}
		else if(animation == "wipeMID")
		{
			steps = stepsElastic
			if(ie4 && elprops.position=="absolute")
			{
				elprops.clip = "rect(0 "+el.sizeW/2*(1+step/steps)+"px 100% "+el.sizeW/2*(1-step/steps)+")"
			}
			else if(!ie4)
			{
				elprops.clip.right=el.sizeW/2*(1+step/steps)
				elprops.clip.left=el.sizeW/2*(1-step/steps)
			}
		}
		else if(animation == "flyCorner")
		{
			if(!cornerPhase)
			{
				steps = stepsElastic/2
				v = step/steps
				rf=Math.exp(-v*7)
				t = v * 2.5*Math.PI
				ry =Math.abs(el.initTop)
				elprops.posTop  = rf*Math.cos(t)*ry
			}
			else
			{
				steps = stepsFly
				dl = el.initLeft / steps
				elprops.posLeft = elprops.posLeft - dl
				elprops.posTop = 0
			}
		}
		else
		{
			steps = stepsFly
			if(animation == "dropWord" || animation == "flyTopRightWord" || animation == "flyBottomRightWord")
				steps = stepsWord
			dl = (el.endLeft - el.initLeft) / steps
			dt = (el.endTop  - el.initTop)  / steps
			elprops.posLeft = elprops.posLeft + dl
			elprops.posTop = elprops.posTop + dt
		}
		if (step >= steps)
		{
			if(!(animation == "wipeLR"	||
				animation  == "wipeTB"	||
				animation  == "wipeMID"	||
				(animation == "flyCorner" && !cornerPhase)))
			{
				elprops.posLeft = el.endLeft
				elprops.posTop = el.endTop
			}
			if(animOut)
			{
				elprops.visibility="hidden"
			}

			step = 0
			if(animation=="flyCorner" && !cornerPhase)
				cornerPhase=1
			else
			{
				cornerPhase=0
				currentElement++
			}

		}
		if(!ie4)
		{
			elprops.left=elprops.posLeft
			elprops.top =elprops.posTop
		}
		if(currentElement < animateElements.length)
		{
			if(animOut)
				window.setTimeout("animate(1);", speed, "Javascript")
			else
				window.setTimeout("animate(0);", speed, "Javascript")
		}
		else
			currentElement=0
	}
	function rollIn(el)
	{
		var ms = navigator.appVersion.indexOf("MSIE")
		ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)
		if(ie4)
		{
			el.initstyle=el.style.cssText;el.style.cssText=el.fprolloverstyle
		}
	}
	function rollOut(el)
	{
		var ms = navigator.appVersion.indexOf("MSIE")
		ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)
		if(ie4)
		{
			el.style.cssText=el.initstyle
		}
	}
	function clickSwapStyle(el)
	{
		var ms = navigator.appVersion.indexOf("MSIE")
		ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)
		if(ie4)
		{
			ts=el.style.cssText
			el.style.cssText=el.fprolloverstyle
			el.fprolloverstyle=ts
		}
	}
	function clickSwapImg(el)
	{
        if(document.all || document.layers)
        {
    		ts=el.src
    		el.src=el.lowsrc
    		el.lowsrc=ts
        }
	}
//------------------------------------------------------------//
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//--------------- ·¹ÀÌ¾î ----------------//
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->


function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
//---------------------------------------/

//-------------------- ¿À¸¥ÂÊ ¸¶¿ì½º ±ÝÁö ---------------------//
//function clickIE()
//{
//	 if (document.all)
//	 {	(message);return false;
//	 }
//}
//function clickNS(e)
//{
//	if (document.layers||(document.getElementById&&!document.all))
//	{
//		if (e.which==2||e.which==3||e.which==116)
//		{
//			(message);return false;
//		}
//	}
//
//}
//if (document.layers)
//{
//		document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;
//}
//else
//{
//		document.onmouseup=clickNS;document.oncontextmenu=clickIE;
//}
//document.oncontextmenu=new Function("return false")

//-------------------------------------------------------------//


//--------------------------- ´Þ·Â ----------------------------//
var weekend = [0,6];
var weekendColor = "#FFFFFF";
var fontface = "±¼¸²Ã¼";
var fontsize = 2;

var gNow = new Date();
var ggWinCal;
isNav = (navigator.appName.indexOf("Netscape") != -1) ? true : false;
isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;

Calendar.Months = ["<?MC_CAPTION CAPTIONID=416>",
					"<?MC_CAPTION CAPTIONID=417>",
					"<?MC_CAPTION CAPTIONID=418>",
					"<?MC_CAPTION CAPTIONID=419>",
					"<?MC_CAPTION CAPTIONID=420>",
					"<?MC_CAPTION CAPTIONID=421>",
					"<?MC_CAPTION CAPTIONID=422>",
					"<?MC_CAPTION CAPTIONID=423>",
					"<?MC_CAPTION CAPTIONID=424>",
					"<?MC_CAPTION CAPTIONID=425>",
					"<?MC_CAPTION CAPTIONID=426>",
					"<?MC_CAPTION CAPTIONID=427>"];

// Non-Leap year Month days..
Calendar.DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
// Leap year Month days..
Calendar.lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

function Calendar(p_item, p_WinCal, p_month, p_year, p_format)
{
	if ((p_month == null) && (p_year == null))
		return;

	if (p_WinCal == null)
		this.gWinCal = ggWinCal;
	else
		this.gWinCal = p_WinCal;

	if (p_month == null)
	{
		this.gMonthName = null;
		this.gMonth = null;
		this.gYearly = true;
	} else
	{
		this.gMonthName = Calendar.get_month(p_month);
		this.gMonth = new Number(p_month);
		this.gYearly = false;
	}

	this.gYear = p_year;
	this.gFormat = p_format;
	this.gBGColor = "white";
	this.gFGColor = "black";
	this.gTextColor = "black";
	this.gHeaderColor = "black";
	this.gReturnItem = p_item;
}

Calendar.get_month = Calendar_get_month;
Calendar.get_daysofmonth = Calendar_get_daysofmonth;
Calendar.calc_month_year = Calendar_calc_month_year;
Calendar.print = Calendar_print;

function Calendar_get_month(monthNo)
{
	return Calendar.Months[monthNo];
}

function Calendar_get_daysofmonth(monthNo, p_year)
{
	/*
	Check for leap year ..
	1.Years evenly divisible by four are normally leap years, except for...
	2.Years also evenly divisible by 100 are not leap years, except for...
	3.Years also evenly divisible by 400 are leap years.
	*/
	if ((p_year % 4) == 0)
	{
		if ((p_year % 100) == 0 && (p_year % 400) != 0)
			return Calendar.DOMonth[monthNo];

		return Calendar.lDOMonth[monthNo];
	} else
		return Calendar.DOMonth[monthNo];
}

function Calendar_calc_month_year(p_Month, p_Year, incr)
{
	var ret_arr = new Array();

	if (incr == -1)
	{
		// B A C K W A R D
		if (p_Month == 0)
		{
			ret_arr[0] = 11;
			ret_arr[1] = parseInt(p_Year) - 1;
		}
		else
		{
			ret_arr[0] = parseInt(p_Month) - 1;
			ret_arr[1] = parseInt(p_Year);
		}
	} else if (incr == 1)
	{
		// F O R W A R D
		if (p_Month == 11)
		{
			ret_arr[0] = 0;
			ret_arr[1] = parseInt(p_Year) + 1;
		}
		else
		{
			ret_arr[0] = parseInt(p_Month) + 1;
			ret_arr[1] = parseInt(p_Year);
		}
	}

	return ret_arr;
}

function Calendar_print()
{
	ggWinCal.print();
}

function Calendar_calc_month_year(p_Month, p_Year, incr)
{

	var ret_arr = new Array();

	if (incr == -1)
	{
		// B A C K W A R D
		if (p_Month == 0)
		{
			ret_arr[0] = 11;
			ret_arr[1] = parseInt(p_Year) - 1;
		}
		else
		{
			ret_arr[0] = parseInt(p_Month) - 1;
			ret_arr[1] = parseInt(p_Year);
		}
	}
	else if (incr == 1)
	{
		// F O R W A R D
		if (p_Month == 11)
		{
			ret_arr[0] = 0;
			ret_arr[1] = parseInt(p_Year) + 1;
		}
		else
		{
			ret_arr[0] = parseInt(p_Month) + 1;
			ret_arr[1] = parseInt(p_Year);
		}
	}

	return ret_arr;
}

// This is for compatibility with Navigator 3, we have to create and discard one object before the prototype object exists.
new Calendar();

Calendar.prototype.getMonthlyCalendarCode = function()
{
	var vCode = "";
	var vHeader_Code = "";
	var vData_Code = "";

	// Begin Table Drawing code here..
	vCode = vCode + "<table width=250 border=0 cellspacing=0 cellpadding=0>";
	vCode = vCode + "<tr>";
          vCode = vCode + "<td width=19>";
          vCode = vCode + "<img src='/KNCS/net-common/program-icon/calendar1/calendar_11.gif' width=19 height=152 >";
          vCode = vCode + "</td>";
          vCode = vCode + "<td> ";
          vCode = vCode + "<table width=214 border=0 cellspacing=0 cellpadding=0>";
          vCode = vCode + "<tr align=center>";
          vCode = vCode + "<td colspan=7 height=10>&nbsp;</td>";
          vCode = vCode + "</tr>";

	vHeader_Code = this.cal_header();
	vData_Code = this.cal_data();
	vCode = vCode + vHeader_Code + vData_Code;

	vCode = vCode + "</table>";
          vCode = vCode + "</td>";
          vCode = vCode + "<td width=17><img src='/KNCS/net-common/program-icon/calendar1/calendar_13.gif' width=17 height=152 ></td>";
          vCode = vCode + "</tr>";
          vCode = vCode + "<tr>";
          vCode = vCode + "<td colspan=3><img src='/KNCS/net-common/program-icon/calendar1/calendar_14.gif' width=250 height=18 ></td>";
          vCode = vCode + "</tr>";

          vCode = vCode + "</table>";


	return vCode;
}

Calendar.prototype.show = function() {
	var vCode = "";

	this.gWinCal.document.open();

	// Setup the page...
	this.wwrite("<html>");
	this.wwrite("<head><title>´Þ·Â</title>");
         this.wwrite("<link rel='stylesheet' href='/KNCS/net-common/style/css_style_fix.css' type='text/css'>\n<!--");
	this.wwrite("</head>");

	this.wwrite("<body bgcolor=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>");

	// Show navigation buttons
	var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1);
	var prevMM = prevMMYYYY[0];
	var prevYYYY = prevMMYYYY[1];

	var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1);
	var nextMM = nextMMYYYY[0];
	var nextYYYY = nextMMYYYY[1];

	this.wwrite("<table width=250 border=0 cellpadding=0 cellspacing=0><tr>");
         this.wwrite("<td rowspan=2> <img src='/KNCS/net-common/program-icon/calendar1/calendar_01.gif' width=19 height=49></td>");
         this.wwrite("<td colspan=2> <img src='/KNCS/net-common/program-icon/calendar1/calendar_02.gif' width=62 height=22 ></td>");
         this.wwrite("<td rowspan=2 width=88 height=49 background='/KNCS/net-common/program-icon/calendar1/calendar_03.gif' align=center valign=bottom>");
         this.wwrite("<table width=90 border=0 cellspacing=0 cellpadding=0>");
         this.wwrite("<tr><td height=40 align=center><b><font size=3 color='#000066'>");
         this.wwriteA(this.gYear+"³â " +(this.gMonth+1)+"¿ù");
         this.wwrite("</font></b></td>");
         this.wwrite("</tr>");
         this.wwrite("</table>");
         this.wwrite("</td>");
         this.wwrite("<td colspan=2><img src='/KNCS/net-common/program-icon/calendar1/calendar_04.gif' width=64 height=22 ></td>");
         this.wwrite("<td rowspan=2> <img src='/KNCS/net-common/program-icon/calendar1/calendar_05.gif' width=15 height=49 ></td>");
         this.wwrite("</tr>");
         this.wwrite("<tr>");
         this.wwrite("<td>");
         this.wwrite("<A HREF=\"" +
		"javascript:window.opener.Build(" +
		"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)-1) + "', '" + this.gFormat + "'" +
		");" +
		"\">");
         this.wwrite("<img src='/KNCS/net-common/program-icon/calendar1/calendar_06.gif' width=30 height=27  border=0 ><\/A></td>");
         this.wwrite("<td>");
         this.wwrite("<A HREF=\"" +
		"javascript:window.opener.Build(" +
		"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)+1) + "', '" + this.gFormat + "'" +
		");" +
		"\">");
          this.wwrite("<img src='/KNCS/net-common/program-icon/calendar1/calendar_07.gif' width=32 height=27  border=0 ><\/A></td>");
          this.wwrite("<td>");
          this.wwrite("<A HREF=\"" +
		"javascript:window.opener.Build(" +
		"'" + this.gReturnItem + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "'" +
		");" +
		"\">");
           this.wwrite("<img src='/KNCS/net-common/program-icon/calendar1/calendar_08.gif' width=32 height=27  border=0 ><\/A></td>");
           this.wwrite("<td>");
           this.wwrite("<A HREF=\"" +
		"javascript:window.opener.Build(" +
		"'" + this.gReturnItem + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "'" +
		");" +
		"\">");
            this.wwrite("<img src='/KNCS/net-common/program-icon/calendar1/calendar_09.gif' width=32 height=27  border=0 ><\/A></td>");
            this.wwrite("</tr>");
            this.wwrite("<tr>");
            this.wwrite("<td colspan=7><img src='/KNCS/net-common/program-icon/calendar1/calendar_10.gif' width=250 height=21></td>");
            this.wwrite("</tr>");
             this.wwrite("</table>");


	// Get the complete calendar code for the month..
	vCode = this.getMonthlyCalendarCode();
	this.wwrite(vCode);

         this.wwrite("</body></html>");
	this.gWinCal.document.close();
}

Calendar.prototype.showY = function()
{
	var vCode = "";
	var i;
	var vr, vc, vx, vy;		// Row, Column, X-coord, Y-coord
	var vxf = 285;			// X-Factor
	var vyf = 200;			// Y-Factor
	var vxm = 10;			// X-margin
	var vym;				// Y-margin
	if (isIE)	vym = 75;
	else if (isNav)	vym = 25;

	this.gWinCal.document.open();

	this.wwrite("<html>");
	this.wwrite("<head><title>Calendar</title>");
	this.wwrite("<link rel='stylesheet1 href='/KNCS/net-common/style/css_style_fix.css' type='text/css'>\n<!--");
	for (i=0; i<12; i++) {
		vc = i % 3;
		if (i>=0 && i<= 2)	vr = 0;
		if (i>=3 && i<= 5)	vr = 1;
		if (i>=6 && i<= 8)	vr = 2;
		if (i>=9 && i<= 11)	vr = 3;

		vx = parseInt(vxf * vc) + vxm;
		vy = parseInt(vyf * vr) + vym;

		this.wwrite(".lclass" + i + " {position:absolute;top:" + vy + ";left:" + vx + ";}");
	}
	this.wwrite("-->\n</style>");
	this.wwrite("</head>");

	this.wwrite("<body " +
		"link=\"" + this.gLinkColor + "\" " +
		"vlink=\"" + this.gLinkColor + "\" " +
		"alink=\"" + this.gLinkColor + "\" " +
		"text=\"" + this.gTextColor + "\">");
	this.wwrite("<FONT FACE='" + fontface + "' SIZE=2><B>");
	this.wwrite("Year : " + this.gYear);
	this.wwrite("</B><BR>");

	// Show navigation buttons
	var prevYYYY = parseInt(this.gYear) - 1;
	var nextYYYY = parseInt(this.gYear) + 1;

	this.wwrite("<TABLE WIDTH='100%' BORDER=1 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#e0e0e0' align=center><TR><TD ALIGN=center>");
	this.wwrite("[<A HREF=\"" +
		"javascript:window.opener.Build(" +
		"'" + this.gReturnItem + "', null, '" + prevYYYY + "', '" + this.gFormat + "'" +
		");" +
		"\" alt='Prev Year'>");
          this.wwrite("<IMG SRC='/KNCS/net-common/program-icon/calendar1/calendar_02.gif' WIDTH=62 HEIGHT=49  border=0><\/A>]</TD><TD ALIGN=center>");
	this.wwrite("[<A HREF=\"javascript:window.print();\">Print</A>]</TD><TD ALIGN=center>");
	this.wwrite("[<A HREF=\"" +
		"javascript:window.opener.Build(" +
		"'" + this.gReturnItem + "', null, '" + nextYYYY + "', '" + this.gFormat + "'" +
		");" +
		"\">>><\/A>]</TD></TR></TABLE><BR>");

	// Get the complete calendar code for each month..
	var j;
	for (i=11; i>=0; i--)
	{
		if (isIE)
			this.wwrite("<DIV ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">");
		else if (isNav)
			this.wwrite("<LAYER ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">");

		this.gMonth = i;
		this.gMonthName = Calendar.get_month(this.gMonth);
		vCode = this.getMonthlyCalendarCode();
		this.wwrite(this.gMonthName + "/" + this.gYear + "<BR>");
		this.wwrite(vCode);

		if (isIE)
			this.wwrite("</DIV>");
		else if (isNav)
			this.wwrite("</LAYER>");
	}

	this.wwrite("</font><BR></body></html>");
	this.gWinCal.document.close();
}

Calendar.prototype.wwrite = function(wtext)
{
	this.gWinCal.document.writeln(wtext);
}

Calendar.prototype.wwriteA = function(wtext) {
	this.gWinCal.document.write(wtext);
}

Calendar.prototype.cal_header = function()
{
	var vCode = "";


	return vCode;
}

Calendar.prototype.cal_data = function()
{
	var vDate = new Date();
	vDate.setDate(1);
	vDate.setMonth(this.gMonth);
	vDate.setFullYear(this.gYear);

	var vFirstDay=vDate.getDay();
	var vDay=1;
	var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear);
	var vOnLastDay=0;
	var vCode = "";

	/*
	Get day for the 1st of the requested month/year..
	Place as many blank cells before the 1st day of the month as necessary.
	*/

	vCode = vCode + "<TR align=center>";
	for (i=0; i<vFirstDay; i++)
	{
		vCode = vCode + "<TD height=22 WIDTH='14%'" + this.write_weekend_string(i) + "></TD>";
	}

	// Write rest of the 1st week
	for (j=vFirstDay; j<7; j++)
	{
		vCode = vCode + "<TD height=22 WIDTH='14%'" + this.write_weekend_string(j) + "><FONT  FACE='" + fontface + "'>" +
			"<A HREF='#' " +
				"onClick=\"self.opener.document." + this.gReturnItem + ".value='" +
				this.format_data(vDay) +
				"';window.close();\">" +
				this.format_day(vDay) +
			"</A>" +
			"</FONT></TD>";
		vDay=vDay + 1;
	}
	vCode = vCode + "</TR>";

	// Write the rest of the weeks
	for (k=2; k<7; k++)
	{
		vCode = vCode + "<TR align=center>";

		for (j=0; j<7; j++)
		{
			vCode = vCode + "<TD height=22 WIDTH='14%'" + this.write_weekend_string(j) + "><FONT  FACE='" + fontface + "'>" +
				"<A HREF='#' " +
					"onClick=\"self.opener.document." + this.gReturnItem + ".value='" +
					this.format_data(vDay) +
					"';window.close();\">" +
				this.format_day(vDay) +
				"</A>" +
				"</FONT></TD>";
			vDay=vDay + 1;

			if (vDay > vLastDay)
			{
				vOnLastDay = 1;
				break;
			}
		}

		if (j == 6)
			vCode = vCode + "</TR>";
		if (vOnLastDay == 1)
			break;
	}

	// Fill up the rest of last week with proper blanks, so that we get proper square blocks
	for (m=1; m<(7-j); m++)
	{
		if (this.gYearly)
			vCode = vCode + "<TD height=22 WIDTH='14%'" + this.write_weekend_string(j+m) +
			"><FONT  color='#999999' FACE='" + fontface + "' ></FONT></TD>";
		else
			vCode = vCode + "<TD height=22 WIDTH='14%'" + this.write_weekend_string(j+m) +
			"><FONT  color='#999999' FACE='" + fontface + "' >" + m + "</FONT></TD>";
	}

	return vCode;
}

Calendar.prototype.format_day = function(vday)
{
	var vNowDay = gNow.getDate();
	var vNowMonth = gNow.getMonth();
	var vNowYear = gNow.getFullYear();

	if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear)
		return ("<FONT COLOR=\"FF8000\"><B>" + vday + "</B></FONT>");
	else
		return (vday);
}

Calendar.prototype.write_weekend_string = function(vday)
{
	var i;

	// Return special formatting for the weekend day.
	for (i=0; i<weekend.length; i++)
	{
		if (vday == weekend[i])
			return (" BGCOLOR=\"" + weekendColor + "\"");
	}

	return "";
}

Calendar.prototype.format_data = function(p_day)
{
	var vData;
	var vMonth = 1 + this.gMonth;
	vMonth = (vMonth.toString().length < 2) ? "0" + vMonth : vMonth;
	var vMon = Calendar.get_month(this.gMonth).substr(0,3).toUpperCase();
	var vFMon = Calendar.get_month(this.gMonth).toUpperCase();
	var vY4 = new String(this.gYear);
	var vY2 = new String(this.gYear.substr(2,2));
	var vDD = (p_day.toString().length < 2) ? "0" + p_day : p_day;

	switch (this.gFormat)
	{
		case "YYYY-MM-DD" :
			vData = vY4 + "-" + vMonth + "-" + vDD;
			break;

		case "MM\/DD\/YYYY" :
			vData = vMonth + "\/" + vDD + "\/" + vY4;
			break;
		case "MM\/DD\/YY" :
			vData = vMonth + "\/" + vDD + "\/" + vY2;
			break;
		case "MM-DD-YYYY" :
			vData = vMonth + "-" + vDD + "-" + vY4;
			break;
		case "MM-DD-YY" :
			vData = vMonth + "-" + vDD + "-" + vY2;
			break;

		case "DD\/MON\/YYYY" :
			vData = vDD + "\/" + vMon + "\/" + vY4;
			break;
		case "DD\/MON\/YY" :
			vData = vDD + "\/" + vMon + "\/" + vY2;
			break;
		case "DD-MON-YYYY" :
			vData = vDD + "-" + vMon + "-" + vY4;
			break;
		case "DD-MON-YY" :
			vData = vDD + "-" + vMon + "-" + vY2;
			break;

		case "DD\/MONTH\/YYYY" :
			vData = vDD + "\/" + vFMon + "\/" + vY4;
			break;
		case "DD\/MONTH\/YY" :
			vData = vDD + "\/" + vFMon + "\/" + vY2;
			break;
		case "DD-MONTH-YYYY" :
			vData = vDD + "-" + vFMon + "-" + vY4;
			break;
		case "DD-MONTH-YY" :
			vData = vDD + "-" + vFMon + "-" + vY2;
			break;

		case "DD\/MM\/YYYY" :
			vData = vDD + "\/" + vMonth + "\/" + vY4;
			break;
		case "DD\/MM\/YY" :
			vData = vDD + "\/" + vMonth + "\/" + vY2;
			break;
		case "DD-MM-YYYY" :
			vData = vDD + "-" + vMonth + "-" + vY4;
			break;
		case "DD-MM-YY" :
			vData = vDD + "-" + vMonth + "-" + vY2;
			break;

		default :
			vData = vMonth + "\/" + vDD + "\/" + vY4;
	}

	return vData;
}

function Build(p_item, p_month, p_year, p_format)
{
	var p_WinCal = ggWinCal;
	gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format);

	// Customize your Calendar here..
	gCal.gBGColor="white";
	gCal.gLinkColor="black";
	gCal.gTextColor="black";
	gCal.gHeaderColor="black";

	// Choose appropriate show function
	if (gCal.gYearly)
		gCal.showY();
	else
		gCal.show();
}

function show_calendar()
{
	/*
		p_month : 0-11 for Jan-Dec; 12 for All Months.
		p_year	: 4-digit year
		p_format: Date format (mm/dd/yyyy, dd/mm/yy, ...)
		p_item	: Return Item.
	*/

	p_item = arguments[0];
	if (arguments[1] == null)
		p_month = new String(gNow.getMonth());
	else
		p_month = arguments[1];
	if (arguments[2] == "" || arguments[2] == null)
		p_year = new String(gNow.getFullYear().toString());
	else
		p_year = arguments[2];
	if (arguments[3] == null)
		p_format = "YYYY-MM-DD";
	else
		p_format = arguments[3];

	vWinCal = window.open("", "Calendar",
		"width=250,height=240,status=no,resizable=no,top=100,left=500");
	vWinCal.focus();
	vWinCal.opener = self;
	ggWinCal = vWinCal;

	Build(p_item, p_month, p_year, p_format);
}

function show_yearly_calendar(p_item, p_year, p_format)
{
	// Load the defaults..
	if (p_year == null || p_year == "")
		p_year = new String(gNow.getFullYear().toString());

	if (p_format == null || p_format == "")
		p_format = "YYYY-MM-DD";

	var vWinCal = window.open("", "Calendar", "scrollbars=no");
	vWinCal.opener = self;
	ggWinCal = vWinCal;

	Build(p_item, null, p_year, p_format);
}

//-----------------------------------------------------------------------------//

//----------------- À©µµ¿ì È®Àå ---------------------------------//
function ExpandWnd(nPxX, nPxY)
{
	window.resizeTo(nPxX+10,nPxY+ 29);
	//document.all._frameName.style.width = document.body.clientWidth - 150;
	//document.all._frameName.style.height = document.body.clientHeight - 36;
}
//---------------------------------------------------------------//

//------------ textarea Áß°£ »ðÀÔ -------------------//
function insertHTML(objname, str1)
{
	var editor_obj = document.all[objname];

	document.all[objname].focus();
    var sRange  = document.selection.createRange();
    var sText   = sRange.text;

	sRange.text = str1;

	sRange.collapse(false); // move to end of range
	sRange.select();        // re-select
}
//--------------------------------------------------//

//---- ¸®½ºÆ® °­Á¶ -----//
function hL(E)
{
	while (E.tagName!="TR")
	{
		E=E.parentElement;
	}
	E.className = "H";
}

function dL(E)
{
	while (E.tagName!="TR")
	{
		E=E.parentElement;
	}
	E.className = "";
}
//----------------------//
function Confirm(_sStr)
{
	if(confirm(_sStr))		return true;
	else					return false;
}

//--------------------- cookie --------------------------//
function setCookie(name,value, expiredays)
{
	//setCookie ÇÔ¼öÀÇ ¸Å°³º¯¼ö °³¼ö ±¸ÇÏ±â
	var argc = setCookie.arguments.length
	//setCookie ÇÔ¼öÀÇ ¸Å°³º¯¼ö ¹è¿­ ±¸ÇÏ±â
	var argv=setCookie.arguments

    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + expiredays );

	var expires=(argc>2) ? argv[2] : null


	//¸Å°³º¯¼ö°¡ 4°³ ÀÌ»óÀÌ¸é 4¹øÂ° ¸Å°³º¯¼ö´Â path¸¦ À§ÇÑ °ª
	var path=(argc>3) ? argv[3] : null

	//¸Å°³º¯¼ö°¡ 5°³ ÀÌ»óÀÌ¸é 5¹øÂ° ¸Å°³º¯¼ö´Â domain¸¦ À§ÇÑ °ª
	var domain=(argc>4) ? argv[4] : null

	//¸Å°³º¯¼ö°¡ 6°³ ÀÌ»óÀÌ¸é 6¹øÂ° ¸Å°³º¯¼ö´Â secure¸¦ À§ÇÑ °ª
	var secure=(argc>5) ? argv[5] : null

	//cookie Æ¯¼º¿¡ Á¤º¸ ¼³Á¤
	document.cookie=name+"="+escape(value)+
	//((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
	((expires==null) ? "" : ("; expires="+todayDate))+
	((path==null) ? "" : ("; path="+path))+
	((domain==null) ? "" : ("; domain="+domain))+
	((secure==true) ? "; secure" : "")

}

function getCookie(name)
{
	var Found=false
	var start,end
	var i=0
	//cookie ¹®ÀÚ¿­ ÀüÃ¼¸¦ °Ë»ö
	while(i<=document.cookie.length)
	{
		start=i
		end=start+name.length
		//name°ú µ¿ÀÏÇÑ ¹®ÀÚ°¡ ÀÖ´Ù¸é
		if(document.cookie.substring(start,end)==name){
			Found=true
			break
		}
		i++
	}
	//name¹®ÀÚ¿­À» cookie¿¡¼­ Ã£¾Ò´Ù¸é
	if(Found==true)
	{
		start=end+1
		end=document.cookie.indexOf(";",start)
		//¸¶Áö¸·ºÎºÐÀÌ¶ó´Â °ÍÀ» ÀÇ¹Ì(¸¶Áö¸·¿¡´Â ';'°¡ ¾ø´Ù)
		if(end<start)
			end=document.cookie.length
		//name¿¡ ÇØ´çÇÏ´Â value°ªÀ» ÃßÃâÇÏ¿© ¸®ÅÏÇÑ´Ù.
		return document.cookie.substring(start,end)
	}
	//Ã£Áö ¸øÇß´Ù¸é
	return ""
}

function delCookie(name)
{
	var today=new Date()
	//°ú°Å ½Ã°£ ¸¸µé±â
	today.setTime(today.getTime()-1)
	//name Á¤º¸ Ã£±â
	var value=getCookie(name)
	if(value!="")
	 document.cookie=name+"="+value+"; expires="+today.toGMTString()
}
//------------------------------------------------------//

function CheckVersion1()
{
	NewModalDialog("/KNCS/net-common/version.aspx", "", "250", "670", "no");
}

function CheckVersion()
{
	NewModalDialog("net-common/version.aspx", "", "250", "670", "no");
}

//--------------------- ÆäÀÌÁö Ã³¸® ------------------------//
function GoSelf(_page)
{
	document.form.target		= "_self";
	document.form.method		= "post"
	document.form.action		= "list_view.aspx";
	document.form.iPage.value   = _page;

	document.form.submit();
}

function GoList()
{
	document.form.target = "_self";
	document.form.method = "post";
	document.form.action = "list_view.aspx";
	document.form.submit();
}
//---------------------------------------------------------//

//------------------¼ýÀÚ¸¸ÀÔ·Â°¡´ÉÇÑ textbox----------------//
function checkNumber(){
    var objEv = event.srcElement;
    var numPattern = /([^0-9])/;
    numPattern = objEv.value.match(numPattern);
    if(numPattern != null){
//        alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
        objEv.value="";
        objEv.focus();
        return false;
    }
}
//----------------------Æ¯¼ö¹®ÀÚÃ¼Å©----------------------//
function containsChars(input,chars) {
	for (var inx = 0; inx < input.value.length; inx++) {
	if (chars.indexOf(input.value.charAt(inx)) != -1)
		return true;
	}
	return false ;
}
//---------------------------------------------------------//

//----------------------Á¤º¸º¯°æ POPUP----------------------//
function GoMemberInfoModify()
{
	var sUrl = "/WebNDS/client/common/popupMemberModify_form.aspx" ;
	NewWindow(sUrl,"Á¤º¸º¯°æ","400","170","Y");
}
//---------------------------------------------------------//

function Reset()
{

	var frm = document.forms[0];
	frm.reset();
}

function showObject(obj)
{
	if (ns4) obj.visibility = "show";
	else if (ie4) obj.visibility = "visible";
}

function hideObject(obj)
{
	if(document.layers)
	{
		var ns4 = true;
	}

	if(document.all)
	{
		var ie4 = true;
	}

	if (ns4)
	{
		obj.visibility = "hide";
	}

	if (ie4)
	{
		obj.visibility = "hidden";
	}
}

function hideLoding()
{
	if( document.all.splashScreen != null )
		hideObject(document.all.splashScreen.style);
}

function NewSite(url)
{
	var frm = document.forms[0];
	if(url.value != "0")
	{
		frm.target = "_blank";
		frm.action = url.value;
		frm.submit();
	}
}
//SelectControl ¾ÆÀÌÅÛ ¿Å±â±â
function SelectControl_Move( selectControl, targetIdx ) {
	var index = selectControl.options.selectedIndex;
	selectControl.remove = SelectControl_Remove;
	if ( index < 0 || targetIdx < 0 ) {
		return;
	}
	if( targetIdx >= selectControl.options.length ){
		targetIdx = selectControl.options.length - 1;
	}
	var theItem = selectControl.options[ index ];
	var oldText = theItem.text;
	var oldValue = theItem.value;
	var newOption = new Option(oldText, oldValue);
	newOption.value = oldValue;
	newOption.text = oldText;
	newOption.innerText = oldText;
	selectControl.remove( index );
	selectControl.insertBefore( newOption, selectControl.options[ targetIdx ] );
	selectControl.options.selectedIndex = targetIdx ;
}
function SelectControl_Remove( index ) {
	var selectControl = document.getElementById('lstProcessOrder')
	selectControl.options[index] = null;
}

