
function onlyNumber(){
	if(event.keyCode < 48 || event.keyCode > 57){
		event.returnValue=false;
	}
}

//·Ñ¿À¹ö ÀÌ¹ÌÁö
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_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

//show/hide ·¹ÀÌ¾î
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() { //v6.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 isEmpty( data, msg ) {
	var data_obj
	data_obj = "document.DmpForm." + data
	for ( var i = 0 ; i < eval(data_obj + ".value").length ; i++ ) {
		if ( eval(data_obj + ".value").substring( i, i+1 ) != " " ) return false;
	}
	alert(msg+"À»(¸¦) ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
	eval(data_obj).focus();
	return true;
}
//------------

function OnDisplayToggle( szObjName )
{
    var objId = document.all[ szObjName ];
	var arMenu = new Array(2);

	arMenu[0] = 'idMenu01';
	arMenu[1] = 'idMenu02';
	for ( var i = 0; i < arMenu.length; i++ ) {
		document.all[ arMenu[i] ].style.display = 'none';
	}

    if ( objId.style.display == '' ) {
        objId.style.display = 'none';
    } else {
        objId.style.display = '';
    }

}

function IsNull( pObj, nLen, strError )
{
    if ( pObj.value.length < nLen ) {
        alert( strError );
        pObj.focus();
        return false;
    }

    return true;
}

function fileCheck1(fileName)
{
	result = true;
	if(fileName != '')
	{
		ext = (fileName.substring(fileName.lastIndexOf(".")+1)).toLowerCase();
		if(ext == 'exe' || ext == 'asp' || ext == 'php' || ext == 'jsp' || ext == 'cgi' || ext == 'dll' || ext == 'bat' || ext == 'htm' || ext == 'html' || ext == 'xml' || ext == 'ini' || ext == 'com' || ext == 'js')	
			result = false;
		}
	return result;
}


function select_all() { 
   var o = document.all['allsel'];
   
   for( var i=0; i< theForm.elements.length; i++) { 
      var m = theForm.elements[i];      
	  if ((m.name != "uid_check") && (m.type=="checkbox")) {
	      m.checked = true; 
	  }
   } 
return; 
} 

function select_del() { 
   var o = document.all['allsel'];

   for( var i=0; i< theForm.elements.length; i++) { 
      var m = theForm.elements[i]; 
	  if ((m.name != "uid_check") && (m.type=="checkbox")) {
          m.checked = false; 
	  }
   } 
return; 
}

function really_all(){
    if (confirm('\nElimination the rehabilitation is impossible.\n\n(Delete Real?)\n')) 
	{ 
	  document.theForm.mode.value = "all_del";
	  document.theForm.action = "ins.html";
	  document.theForm.submit();
	}
    return false;
}

function select_wri(){
	document.theForm.act.value = "ins";
	document.theForm.action = "";
	document.theForm.submit();
}


function OpenWindow(nLink, nTarget, features) {
	if(typeof nLink == "object") url = nLink.href;
	else url = nLink;

	//adjX = xPos ? xPos : (window.screen.width/2 - nWidth/2);
	//adjY = yPos ? yPos : (window.screen.height/2 - nHeight/2 - 50);
	var qResult = window.open( url, nTarget, features );
	if (qResult == null) {
		    if ((navigator.userAgent.indexOf("Windows NT 5.1")!=-1) && (navigator.userAgent.indexOf("SV1")!=-1)) {      // SP2 À¥ ºê¶ó¿ìÀú
		        alert("ÆË¾÷ Ã¢ÀÌ Â÷´ÜµÇ¾ú½À´Ï´Ù.\nºê¶ó¿ìÀúÀÇ »ó´Ü ³ë¶õ»ö [¾Ë¸² Ç¥½ÃÁÙ]À» Å¬¸¯ÇÏ½Å ÈÄ ÆË¾÷ Ã¢À» Çã¿ëÇÏµµ·Ï ¼±ÅÃÇÏ¿© ÁÖ¼¼¿ä.");
		    }
		    else {
			  alert("ÆË¾÷ Ã¢À» ¿ÀÇÂ ÇÒ ¼ö ¾ø½À´Ï´Ù.\nÆË¾÷ Â÷´Ü ÇÁ·Î±×·¥ÀÌ ¼³Ä¡µÇ¾î ÀÖÀ¸¸é ÆË¾÷ Ã¢À» Çã¿ëÇÏ¿© ÆË¾÷ Ã¢À» ¿­¾î ÁÖ¼¼¿ä.");
		    }
		} else {
		    return qResult;
		}
	
}

function down_excel(db){

    if (confirm('Excel Downloads?')) {
	    document.theForm.mode.value = db;
	    document.theForm.target = "hdn";
		document.theForm.action = "../down_excel.html";
	    document.theForm.submit();
	    return true;
	}

	return false;
}

// thisobj ÀÇ Top
function TnT_get_objTop(thisobj){
	if (thisobj.offsetParent==document.body) return thisobj.offsetTop;
	else return thisobj.offsetTop + TnT_get_objTop(thisobj.offsetParent);
}

// thisobj ÀÇ Left
function TnT_get_objLeft(thisobj){
	if (thisobj.offsetParent==document.body) return thisobj.offsetLeft;
	else return thisobj.offsetLeft + TnT_get_objLeft(thisobj.offsetParent);
}

// ¸µÅ©ALT (Ç³¼± µµ¿ò¸»)
function balloon_on(str,obj,mv_right,mv_up){
	var alt_balloon=document.getElementById('TnT_TempLayer');
	alt_balloon.innerHTML="<div style='color:#624c10; font-size:8pt; letter-spacing:-1; font-family:µ¸¿ò; background:url(/A_img/alt_center.gif);'><nobr><img src=/A_img/alt_left.gif align=absmiddle>&nbsp;"+str+"&nbsp;<img src=/A_img/alt_right.gif align=absmiddle></nobr></div>";
	alt_balloon.style.left=TnT_get_objLeft(obj)+mv_right;
	alt_balloon.style.top=TnT_get_objTop(obj)-20-mv_up;
	alt_balloon.style.visibility = 'visible';
}

function balloon_off(){document.getElementById('TnT_TempLayer').style.visibility = 'hidden';}

function image_auto_resize(this_s,width,height){
 var ta_image = new Image();
 ta_image.src = this_s.src;
  if(!width){this_s.removeAttribute('width');
  this_s.style.width='auto';}
  else if(width < ta_image.width){
   this_s.width = width;
  }else{
   this_s.width = ta_image.width;
  }
  if(!height){this_s.removeAttribute('height');
  this_s.style.height='auto';}
  else if(height < ta_image.height){
   this_s.height = height;
  }else{
   this_s.height = ta_image.height;
  } 
}

// ÀÌ¹ÌÁö »çÀÌÁî¿¡ ¸Â°Ô ÆË¾÷Ã¢À¸·Î Ãâ·Â(ÀÌ¹ÌÁöurl,°¡·Î,¼¼·Î,ÀÌ¹ÌÁö¿¡link,Àç±Í)
function imgSize_OPEN(imgURL,Wi,Hi,clickLINK,recnt){
	if(!imgURL) return;
	if(imgURL.match(/\.swf$/i)) popup_win=window.open('','ipupimg','width=400,height=250,resizable=1,scrollbars=1'); // flash
	else{
		if(!recnt){tmpimg= new Image(); tmpimg.src=(imgURL);}
		if(tmpimg.width!=0 && tmpimg.height!=0){
			Wi=tmpimg.width;
			Hi=tmpimg.height;
			var limit_w=screen.width - 80; // ÃÖ´ë»çÀÌÁî w
			var limit_h=screen.height - 100; // ÃÖ´ë»çÀÌÁî h
			var usescroll='';
			if(limit_w<Wi){Wi=limit_w; usescroll=',scrollbars=1';}
			if(limit_h<Hi){Hi=limit_h; usescroll=',scrollbars=1';}
			if(!recnt) popup_win=window.open('','ipupimg','width='+Wi+',resizable=1,height='+Hi+usescroll);
			if(navigator.userAgent.match(/MSIE\s*(7|8|9)/i)) Hi+=22;
			popup_win.resizeTo(Wi+10,Hi+58);
		}
		else{
			if(!recnt)  popup_win=window.open('','ipupimg','width=400,height=400,resizable=1,scrollbars=1');
			if(!clickLINK) clickLINK='';
			recountID=setTimeout("imgSize_OPEN('"+imgURL+"','','','"+clickLINK+"',1)",300);
			return;
		}
	}
	popup_win.focus();
	popup_win.document.write("<html><head><title>Image Viewer</title>");
	popup_win.document.write("<script>dragstart=0;is_left=0;is_top=0;x=0;y=0;"+
		"function move(ev){if(dragstart==1){is_left=temp1+event.clientX-x;is_top=temp2+event.clientY-y;onloadimg.style.left=is_left;"+
		"onloadimg.style.top=is_top;return false;}}function drags(this_img){onloadimg=this_img;"+
		"dragstart=1;temp1=parseInt(onloadimg.style.left+0);temp2=parseInt(onloadimg.style.top+0);x=event.clientX;y=event.clientY;document.onmousemove=move;}"+
		"function dragstop(){dragstart=0;if(is_left==temp1 && is_top==temp2) window.close();}</script>");
	popup_win.document.write("</head><body style='border-width:0; padding:0;' topmargin=0 rightmargin=0 leftmargin=0;");
	if(clickLINK) 	popup_win.document.write(" onclick=location.href='"+clickLINK+"'");
	popup_win.document.write("><table border=0 cellpadding=0 cellspacing=0 width=100% height=100%><tr><td align=center>");
	if(imgURL.match(/\.swf$/i)) popup_win.document.write("<embed src="+imgURL+" width='98%' height='98%'>");
	else popup_win.document.write("<img src="+imgURL+" style='cursor:pointer; position:relative;' border=0 onmousedown=drags(this) onmouseup=dragstop()>");
	popup_win.document.write("</td></tr></table></body></html>");
	popup_win.document.close();
}