/**
 * ¹®ÀÚ¿­(ÇÑ±Û==2) ±æÀÌ ±¸ÇÏ±â
 * @param string
 * @return
 */
/*
function getByteLength( string ) {
    var len = 0;
    var str = string.substring(0);

    if ( str == null ) return 0;

    for(var i=0; i < str.length; i++) {
        var ch = escape(str.charAt(i));

        if( ch.length == 1 )
        	len++;
        else if( ch.indexOf("%u") != -1 ) 
        	len += 2;// ÇÑ±ÛÀº 3¹ÙÀÌÆ®
        else if( ch.indexOf("%") != -1 ) 
        	len += parseInt( ch.length / 3);
    }

    return len;
}
*/
function getBytes(string)
{
    return encodeURIComponent(string).replace(/%../g, 'x').length;
}

/**
 * SELECT ÅÂ±×ÀÇ °ªÀÌ ÀÏÄ¡ÇÏ´Â °Í¿¡ "selected=true" ¼³Á¤ÇÏ±â
 * @param sSelect SELECT ÅÂ±× id
 * @param sValue ºñ±³ÇÒ °ª
 * @return
 */
function setSelect( sSelect, sValue )
{
	var oSelect = document.getElementById( sSelect );

	for( var i = 0; i < oSelect.options.length; i++ ) {
		if( oSelect.options[i].value == sValue ) {
			oSelect.options[i].selected = true;
			break;
		}
	}
}

/**
 * INPUT-RADIO ÅÂ±×ÀÇ °ªÀÌ ÀÏÄ¡ÇÏ´Â °Í¿¡ "checked=true" ¼³Á¤ÇÏ±â
 * @param sRadio INPUT-RADIO ÅÂ±× name
 * @param sValue ºñ±³ÇÒ °ª
 * @return
 */
function setRadio( sRadio, sValue )
{
	var oRadioList = document.getElementsByName( sRadio );
	var i = 0;
	while(oRadio = oRadioList[i++]) {
		if( oRadio.value == sValue ) {
			oRadio.checked = true;
			break;
		}
	}
}

function getRadio( sRadio )
{
	var oRadioList = document.getElementsByName( sRadio );
	var i = 0;
	while(oRadio = oRadioList[i++]) {
		if( oRadio.checked == true ) {
			return oRadio.value;
			break;
		}
	}
}

/**
 * INPUT-CHECKBOX ÅÂ±×ÀÇ °ªÀÌ ÀÏÄ¡ÇÏ´Â °Í¿¡ "checked=true" ¼³Á¤ÇÏ±â
 * @param sCheckbox INPUT-CHECKBOX ÅÂ±× name
 * @param stringArray ºñ±³ÇÒ °ª(String ÀÌ³ª String[])
 * @return
 */
function setCheckbox( sCheckbox, stringArray )
{
	var oCheckboxList = document.getElementsByName( sCheckbox );
	var i = 0;
	var isArray = isArray( stringArray );
	while(oCheckbox = oCheckboxList[i++]) {
		
		// »ý°¢ÇØº¸´Ï Ã¼Å©¹Ú½º °ªÀÌ 1°³¸¸ ³Ñ¾î¿À°Ô UI¸¦ ¸¸µé ÀÌÀ¯°¡ ÀÖÀ¸·Á³ª? ¾øÀ»°Å °°Àºµ¥..
		if( !isArray ) {
			if( oCheckbox.value == stringArray ) {
				oCheckbox.checked = true;
			}
		}
		else {
			for(var j = 0; j < stringArray.length; j++ ) {
				if( oCheckbox.value == stringArray[i] ) {
					oCheckbox.checked = true;
				}
			}
		}
	}
}

function trim( str )
{
	return str.replace(/^\s+|\s+$/g,"");
}
function ltrim( str )
{
	return str.replace(/^\s+/,"");
}
function rtrim( str )
{
	return str.replace(/\s+$/,"");
}


function isArray(obj) 
{
   if (obj.constructor.toString().indexOf("Array") == -1)
      return false;
   else
      return true;
}

function openZipcode( zipcode, addr )
{
	var winZipcode = window.open( "/jsp/zipcode/list.action?zipcode=" + zipcode + "&addr=" + addr, "zipcodeSearch", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0,width=530,height=450");
}

function openCultureZipcode( zipcode, addr )
{
	var winZipcode = window.open( "/jsp/zipcode/list.action?type=culture&zipcode=" + zipcode + "&addr=" + addr, "zipcodeSearch", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0,width=530,height=455");
}

function isNumeric(input)
{
	var pattern =/^[0-9]+$/;
	return pattern.test( input );
}

function isAlpha(input)
{
	var pattern =/^[a-zA-Z]+$/;
	return pattern.test( input ); 
}

function isInt(input) {
	return (input.toString().search(/^-?[0-9]+$/) == 0);
}

function toInt(input) {
	if(input == "")
		return 0;
	
	if( isInt( input ) )
		return parseInt( input );
	else
		return 0;
}

/**
 * check Unsigned Integer
 * @param input
 * @return
 */
function isUInt(input) {
	return (input.toString().search(/^[0-9]+$/) == 0);
}

function isEmail( input )
{
	 var pattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
	 return pattern.test( input ); 
	  
}

function isPost( post )
{

}

function isUrl( url )
{
	
}

function removeTag( html )
{
	return html.replace(/<[^>]+>/g, "");
}

function toComma( val )
{
	var input = String( val ); 
	var reg = /(\-?\d+)(\d{3})($|\.\d+)/; 
	if(reg.test(input)){ 
	  return input.replace(reg, function(str, p1,p2,p3) { 
              									 	return toComma(p1) + "," + p2 + "" + p3; 
          											 }     
      ); 
	}else{ 
	  return input; 
	} 

}

//======================================== TTS ÅÂ±× ½ÃÀÛ
//½ºÅ©¸³Æ®°¡ Àû¿ëµÉ ÅÂ±×
var tgs = new Array('table','tr','td','div','span','font','a','p');

try {
	document.onkeydown = tts_on_off;
} catch(E) {}

// Å°´Ù¿î Ã³¸®
function tts_on_off()
{
	try {
		switch(event.keyCode)
		{
			case 123:	// F12
			{
				SoundOnOff();
				break;
			}
			case 118:	// F7
			{
				SpeedDown();
				break;
			}
			case 119:	// F8
			{
				SpeedUp();
				break;
			}	
		}
	} catch(E) {}
}

function SoundOnOff()
{
	if (Sound.value == "À½¼ºÄÑ±â(F12)")
	{
		//Sound.value = "À½¼º²ô±â(F12)";
		activevoice1.SoundOnOff = 1;
	}
	else
	{
		//Sound.value = "À½¼ºÄÑ±â(F12)";
		activevoice1.SoundOnOff = 0;
	}
}

function SoundOn()
{
	activevoice1.SoundOnOff = 1;
}
function SoundOff()
{
	activevoice1.SoundOnOff = 0;
}

function SetSpeaker(nSpeaker)
{
	activevoice1.Speaker = nSpeaker;
	str = activevoice1.Speaker;
}

function SpeedDown()
{
	str = activevoice1.Speed-1;
	/*if (activevoice1.SetSpeed(str))
	{		
		Speed.innerText="¼Óµµ " + str;
	}*/
}

function SpeedUp()
{
	str = activevoice1.Speed+1;
	/*if (activevoice1.SetSpeed(str))		
	{
		Speed.innerText="¼Óµµ " + str;
	}*/
}

function ZoomIn()
{
	if (document.getElementById("wrapper").style.zoom == "")
	{	document.getElementById("wrapper").style.zoom = "100%";}
	document.getElementById("wrapper").style.zoom = parseInt(document.getElementById("wrapper").style.zoom)+20+"%";
//	screen_size.innerText="È­¸éÅ©±â "+document.getElementById("wrapper").style.zoom;
}

function ZoomOut()
{
	if (document.getElementById("wrapper").style.zoom == "")
	{	document.getElementById("wrapper").style.zoom = "100%";}

	document.getElementById("wrapper").style.zoom = parseInt(document.getElementById("wrapper").style.zoom)-20+"%";
//	screen_size.innerText="È­¸éÅ©±â "+document.getElementById("wrapper").style.zoom;
}

function on_mouse(obj) 
{
	if (obj.style.zoom == "")
		obj.style.zoom = "100%";
	obj.style.zoom = parseInt(obj.style.zoom)+10+"%";		
}

function out_mouse(obj) 
{
	if (obj.style.zoom == "")
		obj.style.zoom = "100%";
	obj.style.zoom = parseInt(obj.style.zoom)-10+"%";
}


function ch_fontcolor(trgt, obj) 
{
	var index = obj.value;

	if (!document.getElementById) return;
	var d = document,cEl = null,i,j,cTags;
	
	if (!(cEl = d.getElementById(trgt))) cEl = d.getElementsByTagName(trgt)[0];

	for (i = 0 ; i < tgs.length ; i++)
	{
		cTags = cEl.getElementsByTagName(tgs[i]);
		for (j = 0 ; j < cTags.length ; j++ )
		{

			cTags[j].style.color = index;
		}
	}
	
//	document.all[trgt].style.color =index;
}		
//======================================== TTS ÅÂ±× ³¡

function toPage(mcode){
	document.location.href = "/page.action?mCode="+mcode;
}

function toPage2(mcode, cidx){
	document.location.href = "/page.action?mCode="+mcode+"&cidx="+cidx;
}

function toPageInCulture(mcode, cidx){
	document.location.href = "/culture/page.action?mCode="+mcode+"&cidx="+cidx;
}


function Depth2View(id) {
	for(num=1; num<=7; num++) document.getElementById('depth02_0'+num).style.display='none'; //¸ðµç ¸Þ´º  ¼û±è
	document.getElementById(id).style.display='block'; //ÇØ´ç ID¸¸ º¸ÀÓ
}
function openStation(){
	window.open("/station/linemap.action", "station","top=0, left=0, width=all, height=all");
}
function openMap(){
	window.open("/station/stationmap.action", "station","top=0, left=0, width=all, height=all");
}
function openStationInfo(){
	window.open("/station/stationinfo.action", "station","top=0, left=0, width=all, height=all");
}
function openTrainSchedule(){
	window.open("/station/trainschedule.action?stationId=0226&mainLine=2", "station","top=0, left=0, width=all, height=all");
}
//use DEPT ORDER_CD
function toDeptToCd(deptId, step1, step2){
	document.location.href = "/jsp/dept/search.action?mCode=C050010000&searchYn=Y&&sDeptId="+deptId+"&searchStep1="+step1+"&searchStep2="+step2;
}
//use DEPT DEPT_ID
function toDeptToId(deptId){
	document.location.href = "/jsp/dept/search.action?mCode=C050010000&searchYn=Y&sDeptId="+deptId;
}

//°Ë»ö
function search_form_check()	{
	if( document.searchForm.qt.value == "" ){
		alert("Å°¿öµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		document.searchForm.qt.focus();
		return false;
	}
}




/* ------------------------------------------------------
 * ¾Æ·¡ºÎÅÍ´Â ¿î¿µÁßÀÎ »çÀÌÆ®ÀÇ common.js ÀüÃ¼ ³»¿ë
 * Ã»·Åºñ¸®¼¾ÅÍ(/abs/) ¼Ò½º¸¦ ±»ÀÌ ¿­¾îº¸°í ½ÍÁö ¾ÊÀ½.
 * ------------------------------------------------------
 */

var    _intValue   = '0123456789.-';
var    _intValue2   = '0123456789';
var    _upperValue = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var    _lowerValue = 'abcdefghijklmnopqrstuvwxyz';
var    _etcValue   = ' ~`!@#$%%^&*()-_=+\|[{]};:\'\",<.>/?';
var    _etcValueNoSpace   = '~`!@#$%%^&*()-_=+\|[{]};:\'\",<.>/?';
var    _phoneValue = '0123456789-';
var    _enterValue = '\r\n';      
var     WINIMAGE_STUDENT = null;
var     WINOBJECT = null;
var    submit_timer = null;
var    control = 1; 
var    report_designer_path = ""; 

   /**!!
   *  °³¿ä : Select °´Ã¼¿¡ ¼±ÅÃµÈ ÄÚµå¸í ¹ÝÈ¯
   *  @param           psCol Select°´Ã¼¸í
   *  @return       ÄÚµå¸í
   !!**/
   function getSelectedText(psCol) 
   {    
         var Colval = document.forms[0].elements[psCol].options[document.forms[0].elements[psCol].selectedIndex].text;
         var startIdx = Colval.indexOf(".");
         if (startIdx < 0 )
         {
            return Colval;
         }else
         {
            return Colval.substring(startIdx+1,Colval.length);
         }
   }

   /**!!
   *  °³¿ä : Opnere Select °´Ã¼¿¡ ¼±ÅÃµÈ ÄÚµå¸í ¹ÝÈ¯
   *  @param           psCol Select°´Ã¼¸í
   *  @return       ÄÚµå¸í
   !!**/
   function getOpenerSelectedText(psCol) 
   {    
      var Openform = window.opener.document.page;
      var Colval = Openform.elements[psCol].options[Openform.elements[psCol].selectedIndex].text;

      var startIdx = Colval.indexOf(".");
      if (startIdx < 0 )
      {
         return Colval;
      }else
      {
         return Colval.substring(startIdx+1,Colval.length);
      }
   }

   /**!!
   *  °³¿ä : data TypeÀÌ intÇüÀÎÁö  ÆÇÁ¤
   *  @param           value ¿øº» ¹®ÀÚ¿­
   *  @return       true : int false : not int
   !!**/
   function isInt(value) {    
       var   j;
       var tmpValue;
       for(i=0;i<value.length;i++) 
       {
          tmpValue= value.substring(i,i+1);
          if(_intValue.indexOf(tmpValue) < 0) 
            return false;
       }
       return true;
   }

   /**
   *  ³¯Â¥¿©ºÎ Check
   *  @param          psValue : ³¯Â¥ 8ÀÚ¸®
   *  @return       true : Date false : not Date
   */
   function isDate(psValue)
   {
      var checkstr = "0123456789";
      var s_date_val = "";
      var s_date_tmp = "";
      var s_sepe_str = "/";
      var day;
      var month;
      var year;
      var leap = 0;
      var err = 0;
      var i;
      err = 0;
      s_date_val = psValue;

      /* ¼ýÀÚ°¡ ¾Æ´Ñ ¹®ÀÚ »èÁ¦ */
      for (i = 0; i < s_date_val.length; i++) 
      {
         if (checkstr.indexOf(s_date_val.substr(i,1)) >= 0) 
         {
            s_date_tmp = s_date_tmp + s_date_val.substr(i,1);
         }
      }
      s_date_val = s_date_tmp;

      if(s_date_val.length != 8)
      {
         return false;
      }

      /* ¿ùÀÇ À¯È¿¼º Ã¼Å© */
      month = s_date_val.substr(4,2);
      if ((month < 1) || (month > 12)) 
      {
         return false;
      }
      /* ³¯Â¥ÀÇ À¯È¿¼º Ã¼Å© */
      day = s_date_val.substr(6,2);
      if (day < 1) 
      {
         return false;
      }
      /* À±³â/2¿ù Ã¼Å© */
      year = s_date_val.substr(0,4);
      if (year % 4 == 0) {
	  if (year % 100 == 0){
	      if (year % 400 == 0){
		  leap = 1;
	      }
	  }else{
	      leap = 1;
	  }
      }
      /*if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) 
      {
         leap = 1;
      }*/
      if ((month == 2) && (leap == 1) && (day > 29)) 
      {
         return false;
      }
      if ((month == 2) && (leap != 1) && (day > 28)) 
      {
         return false;
      }
      /* ±âÅ¸ ¿ùÀÇ À¯È¿¼º Ã¼Å©  */
      if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) 
      {
         return false;
      }
      if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) 
      {
         return false;
      }
      /* 00 ÀÔ·Â½Ã ÀÔ·Â³»¿ë »èÁ¦ */
      if ((day == 0) && (month == 0) && (year == 00)) 
      {
         return false;
      }
      return true;
   }

   /**!!
   *  °³¿ä : Cookie°ª setÇÏ´Â method
   *  @param           name  CookieÀÌ¸§ 
   *                 value Cookie°ª
   *  @return        
   !!**/
   function setCookie(name, value)
   {
      var argv = setCookie.arguments;
      var argc = setCookie.arguments.length;

      var expires = (argc > 2) ? argv[2] : null;
      var path = (argc > 3) ? argv[3] : "/";
      var domain = (argc > 4) ? argv[4] : null;
      var secure = (argc > 5) ? argv[5] : false;
      document.cookie = name + "=" + escape (value) +
                     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
                     ((path == null) ? "" : ("; path=" + path)) +
                     ((domain == null) ? "" : ("; domain=" + domain)) +
                     ((secure == true) ? "; secure" : "");
   }

   /**!!
   *  °³¿ä : Cookie°ª GetÇÏ´Â method
   *  @param           name  CookieÀÌ¸§ 
   *                 
   *  @return        Cookie value
   !!**/
   function getCookie(Name) 
   {
      var a = document.cookie.indexOf(Name + "=");
      var b = 0;
      if (a != -1) 
      {
         a += Name.length + 1; 
         b = document.cookie.indexOf(";", a);
         if (b == -1) 
            b = document.cookie.length;
      }
      return unescape(document.cookie.substring(a, b));
   }

   /**!!
   *  °³¿ä : °¢Á¾ ¸Þ¼¼Áö Set
   *  @param           
   *  @return       
   !!**/
   function setCondenseValue(psColName, psColValue) 
   {
      var sValue = "$"+psColName+"=" +psColValue+"$*";
      return sValue;
   }

   /**!!
   *  °³¿ä : °¢Á¾ ¸Þ¼¼Áö ¹ÝÈ¯
   *  @param           
   *  @return       
   !!**/
   function getCondenseValue(page_info, psMsgNm) 
   {
      var msgNm= "$"+psMsgNm+"=";
      var msg_tmp = page_info.indexOf(msgNm);
      var msg_start = msg_tmp + msgNm.length;
      var msg_end = page_info.indexOf("$*",msg_start)
      return page_info.substring(msg_start,msg_end);
   }


   /**!!
   *  °³¿ä : Page loadingÈÄ Error Message ¹× Popup Window¿¡ ´ëÇÑ Á¤º¸ Ã³¸®(ÀÏ¹ÝJSP)
   *  @param           
   *  @return       
   !!**/
   function pageCheck() 
   {
      var page_info = document.forms[0].elements["PAGE_INFO"].value;
      var file_path = getCondenseValue(page_info, "FILE_PATH");
      var file_name = getCondenseValue(page_info, "FILE_NAME");
      var focusCol = getCondenseValue(page_info, "FOCUS_COLUMN");
      var status_msg = getCondenseValue(page_info, "SHOW_MESSAGE");
      var confirm_msg = getCondenseValue(page_info, "CONFIRM_MESSAGE");
      var confirm_yes = getCondenseValue(page_info, "CONFIRM_YES_TASK");
      var confirm_no = getCondenseValue(page_info, "CONFIRM_NO_TASK");
      var page_action = getCondenseValue(page_info, "PAGE_ACTION");

      if(confirm_msg != "" && confirm_msg != null)
      {
         result = confirm(confirm_msg);
         if ( result == true)
         {
            if(confirm_yes != "-1")   {   executeSubmit(confirm_yes); }
         }else
         {
            if(confirm_no != "-1")   {   executeSubmit(confirm_no); }
         }
      }


      if(file_path != "" && file_path != null)
      {
         self.location.href="/k1ss/work/fileDownload.jsp?filepath="+file_path+"&filename="+file_name;
      }

      if(focusCol != "" && focusCol != null)
      {
         document.forms[0].elements[focusCol].focus();
      }

      window.status = status_msg;
      checkMessage();
      checkOpenWindow();
      checkPageAction(page_action);
   }

   /**!!
   *  °³¿ä : ErrorMessage À¯¹« Check
   *  @return       
   !!**/
   function checkMessage()
   {
      var page_info = document.forms[0].elements["PAGE_INFO"].value;
      var psErrLine = getCondenseValue(page_info, "ERROR_LINE");
      var psErrCol  = getCondenseValue(page_info, "ERROR_COLUMN");
      var psErrMsg  = getCondenseValue(page_info, "ERROR_MESSAGE");
      if (psErrMsg != "" &&  psErrMsg != null)
      {      
            if(psErrCol != "" && psErrCol != null)
            {
                  openMessage1(psErrLine,psErrCol, psErrMsg);
            }else
            {
                  openMessage2(psErrLine,psErrMsg);
            }
      }
   }

   /**!!
   *  °³¿ä : °æ°íÃ¢¿¡ ErrorMessage¸¦ ¶ç¿ì°í focus ÀÌµ¿
   *  @param           Error Line ¹øÈ£
   *                 Error Line ÄÃ·³¸í
   *                  Error Message
   *  @return       
   !!**/
   function openMessage1(psErrLine,psErrCol, psErrMsg)
   {
         alert(psErrMsg);
         document.forms[0].elements[psErrCol].focus();
   }

   /**!!
   *  °³¿ä : °æ°íÃ¢¿¡ ErrorMessage¸¦ ¶ç¿ò
   *  @param           Error Line ¹øÈ£
   *                  Error Message
   *  @return       
   !!**/
   function openMessage2(psErrLine,psErrMsg)
   {
         alert(psErrMsg);
   }

   /**!!
   *  °³¿ä : Pop Up Window°¡ Á¸ÀçÇÏ´ÂÁö Check
   *  @param           psWindow   Window¸í
   *  @return       
   !!**/
   function checkOpenWindow()
   {
      var page_info = document.forms[0].elements["PAGE_INFO"].value;

      var psWndow_info = getCondenseValue(page_info, "OPEN_WINDOW");
      if (psWndow_info != "")
      {
         openWindow1(psWndow_info);
      }
   }


   /**!!
   *  °³¿ä : Window È£Ãâ
   *  @param   PopupWindow     È£ÃâÇÒ Window¸í
   *  @param   psTaskId        task_id
   *  @param   psArg              argument
   !!**/
   function openWindow(PopupWindow, psTaskId, psArg)
   {
      if ( WINOBJECT != null) 
      {
         WINOBJECT.close();
      }

      WINOBJECT = window.open(PopupWindow+"?HELP_TASK_ID="+psTaskId+psArg,'HELP', 'left=210,top=1,width=600,height=500,titlebar=no,toolbar=no,location=no,direction=no,status=no,menubar=no,scrollbars=no,resizable=no');
      WINOBJECT.focus();
   }

   /**!!
   *  °³¿ä : Window È£Ãâ
   *  @param           È£ÃâÇÒ Window¸í
   !!**/
   function openWindow1(PopupWindow)
   {
      if ( WINOBJECT != null) 
      {
         WINOBJECT.close();
      }

      WINOBJECT = window.open(PopupWindow,'HELP', 'left=210,top=1,width=600,height=500,titlebar=no,toolbar=no,location=no,direction=no,status=no,menubar=no,scrollbars=no,resizable=no');
//      WINOBJECT = window.open(PopupWindow,'HELP', 'left=210,top=1,width=600,height=500,titlebar=yes,toolbar=yes,location=yes,direction=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
      WINOBJECT.focus();
   }

   /**!!
   *  °³¿ä : ÃÖÁ¾ ÆäÀÌÁö actionCheck
   *  @param   String action ±¸ºÐÀÚ
   *  @return       
   !!**/
   function checkPageAction(psValue)
   {
      if(psValue != "" && psValue != null)
      {
         if(psValue == "LAST_ACTION")  {   pageLastActionScript();   }
      }
   }

   /**!!
   *  °³¿ä : ´Þ·Â window È£Ãâ
   *  @param     field1      date°¡ settingµÉ ÄÃ·³¸í 
   *  @return       
   !!**/
   function openCalender(field1)
   {
      var px = event.screenX - 165;
      var py = event.screenY + 11;
      
      if ( WINOBJECT != null) 
      {
         WINOBJECT.close();
      }

      WINOBJECT = window.open('/k1ss/help/Calender.jsp?fieldName='+field1,'HELP','toolbars=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left='+px+',top='+py+', width=155,height=220');
      WINOBJECT.focus();
   }

   /**!!
   *  °³¿ä : ´Þ·Â window È£Ãâ
   *  @param     field1      date°¡ settingµÉ ÄÃ·³¸í 
   *  @param     piTaskId   TaskId
   *  @return       
   !!**/
   function openCalender2(field1,piTaskId)
   {
      var px = event.screenX - 165;
      var py = event.screenY + 11;
      
      if ( WINOBJECT != null) 
      {
         WINOBJECT.close();
      }

      WINOBJECT = window.open('/k1ss/help/Calender.jsp?fieldName='+field1+'&HELP_TASK_ID='+piTaskId,'HELP','toolbars=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left='+px+',top='+py+', width=155,height=220');
      WINOBJECT.focus();
   }

   /**!!
   *  °³¿ä : ´Þ·Â window È£Ãâ
   *  @param     field1      date°¡ settingµÉ ÄÃ·³¸í 
   *  @param     piTaskId   TaskId
   *  @return       
   !!**/
   function openCalender3(field1,piIdx)
   {
      var px = event.screenX - 165;
      var py = event.screenY + 11;
      
      if ( WINOBJECT != null) 
      {
         WINOBJECT.close();
      }

      WINOBJECT = window.open('/k1ss/help/Calender.jsp?fieldName='+field1+'&MULTI_YN=Y&ROW='+piIdx,'HELP','toolbars=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left='+px+',top='+py+', width=155,height=220');
      WINOBJECT.focus();
   }

   /**!!
   *  °³¿ä : ´Þ·Â window È£Ãâ
   *  @param     field1      date°¡ settingµÉ ÄÃ·³¸í 
   *  @param     piTaskId   TaskId
   *  @return       
   !!**/
   function openCalender4(field1,piIdx,piTaskId)
   {
      var px = event.screenX - 165;
      var py = event.screenY + 11;
      
      if ( WINOBJECT != null) 
      {
         WINOBJECT.close();
      }

      WINOBJECT = window.open('/k1ss/help/Calender.jsp?fieldName='+field1+'&MULTI_YN=Y&ROW='+piIdx+'&HELP_TASK_ID='+piTaskId,'HELP','toolbars=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left='+px+',top='+py+', width=155,height=220');
      WINOBJECT.focus();
   }


   /**!!
   *  °³¿ä : Multy RowÈ­¸é¿¡¼­ help button Click½Ã ClickµÈ row¼ö Ã³¸®
   *  @param           
   *  @return       
   !!**/
   function getRowNum(sCol)
   {
      var RowNum = document.forms[0].elements[sCol].value;
      if(RowNum == null || RowNum == "")
      {
         document.forms[0].elements[sCol].value ="";
         return;
      }
         
      if (parseInt(RowNum,10) < 0)
      {
         document.forms[0].elements[sCol].value ="";
         return;
      }
   }


   /**!!
   *  °³¿ä : Multy RowÈ­¸é¿¡¼­ help button Click½Ã ClickµÈ row¼ö Setting
   *  @param           
   *  @return       
   !!**/
   function setRowNum(psCol,piIdx)
   {
      if (psCol == null || psCol == "")
      {
         return;
      }
      document.forms[0].elements[psCol].value =piIdx;
   }
   /**!!
   *  °³¿ä : ´Ü¼ø Á¶È¸¿ë È­¸é¿¡¼­ line¿¡ µû¶ó »ö±òÀ» º¯°æ½ÃÅ°´Â method
   *  @param    piIndex  RowIndex(0ºÎÅÍ½ÃÀÛ)
   *  @return       
   !!**/
   function getLineColor(piIndex)
   {
//      var RowNum = document.forms[0].ARG_NUM.value;
      var sLineColor = "<tr>";
//      if (piIndex == RowNum)
//      {
//         sLineColor = "<tr class='TR_SELECTED'>";
//         return sLineColor;
//      }
      if (piIndex % 2 == 1) 
      { 
         sLineColor = "<tr class='TR_LINE'>";
         return sLineColor;
      }
      return "<tr>";
   }

   /**!!
   *  °³¿ä : submit method
   *  @param    psTaskId  TASK_ID
   *  @return       
   !!**/
   function executeFileSubmit(psTaskId)
   {
      document.forms[0].encoding = "multipart/form-data";
      document.forms[0].TASK_ID.value = psTaskId;
      document.forms[0].submit();
   }

   /**!!
   *  °³¿ä : ¸Þ¼¼Áö Ã³¸®°¡ Æ÷ÇÔµÈ submit method
   *  @param    psTaskId  TASK_ID
   *            psMsgNm   Message°¡ ÀÖ´Â Text°´Ã¼¸í
   *  @return       
   !!**/
   function executeSubmitMessage(psTaskId, sMessage)
   {
      if (sMessage == null || sMessage == "")
      {
//         submit_timer = setTimeout("executeSubmit("+psTaskId+")",700);
         executeSubmit(psTaskId);
         return;
      }
      result = confirm(sMessage);
      if ( result == true)
      {
//         submit_timer = setTimeout("executeSubmit("+psTaskId+")",700);
         executeSubmit(psTaskId);
      }
   }


   /**!!
   *  °³¿ä : submit method
   *  @param    psTaskId  TASK_ID
   *  @return       
   !!**/
   function executeSubmit(psTaskId)
   {
      var preTaskId = document.forms[0].TASK_ID.value;
      eval('processingbar.style.visibility="visible"');
      eval('processingbar.style.display="block"');
      if(preTaskId != "-1" && preTaskId != "" && preTaskId != null)
      {
         document.forms[0].TASK_ID.value = preTaskId;
      }else
      {
         document.forms[0].TASK_ID.value = psTaskId;
      }
      document.forms[0].submit();
   }

   /**!!
   *  °³¿ä : Multy RowÃ³¸®È­¸é¿¡¼­ ÇöÀç ÀÛ¾÷ÁßÀÎ LineÀ» set
   *  @param    argColumn    Line Á¤º¸¸¦ setÇÒ ÄÃ·³¸í
   *             argLine        SetÇÒ LineÁ¤º¸
   *  @return       
   !!**/
   function setGridLine(argColumn, argLine)
   {
      if (argColumn == null || argColumn == "")
      {
         return;
      }
       document.forms[0].elements[argColumn].value =argLine;
   }

   /**!!
   *  °³¿ä : Multy RowÃ³¸®È­¸é¿¡¼­ data º¯°æ½Ã dataflagÀÇ Á¤º¸º¯°æ
   *  @param    arg    º¯°æÀÌ ¹ß»ýÇÑ ÄÃ·³¸í
   *  @return       
   !!**/
   function setDataFlag(arg)
   {
      var dat_flag = document.forms[0].elements[arg].value;
      if (dat_flag == "S")
      {
         dat_flag = "U";
      }
       document.forms[0].elements[arg].value =dat_flag;
   }

   /**!!
   *  °³¿ä : Check °´Ã¼ Click½Ã ¹ß»ýÇÏ´Â Event·Î Check °´Ã¼ÀÇ °ª ¼³Á¤
   *  @param    psSou        Check°´Ã¼
   *            psObj        Hidden ÄÃ·³¸í(checkµÈ ÄÃ·³ÀÇ value save)
   *            psTrueValue  check µÆÀ»¶§ÀÇ value
   *            psFalseValue uncheck µÆÀ»¶§ÀÇ value
   *  @return       
   !!**/
   function setCheckFlag(psSou, psObj, psTrueValue, psFalseValue)
   {
      if (document.forms[0].elements[psSou].checked)
      {
         document.forms[0].elements[psObj].value =psTrueValue ;
      }else
      {
         document.forms[0].elements[psObj].value =psFalseValue ;
      }
   }

   /**!!
   *  °³¿ä : radio °´Ã¼ Click½Ã ¹ß»ýÇÏ´Â Event·Î radio °´Ã¼ÀÇ °ª ¼³Á¤
   *  @param    psSou        Check°´Ã¼
   *            psObj        Hidden ÄÃ·³¸í
   *            psValue  check µÆÀ»¶§ÀÇ value
   *  @return       
   !!**/
   function setRadioFlag(psSou, psObj, psValue)
   {
      if (document.forms[0].elements[psSou].checked)
      {
         document.forms[0].elements[psObj].value =psValue ;
      }
   }

   /**!!
   *  °³¿ä : Single & Multy È­¸é¿¡¼­ »ç¿ëÇÏ´Â method·Î row ¼±ÅÃ½Ã ÀÌ¹ÌÁö º¯°æ
   *  @param    piIdx        Check°´Ã¼
   *            psImgNm      º¯°æµÉ Image¸í
   *            psValue      Image°¡ ÀÖ´Â path
   *  @return       
   !!**/
   function imageChange(psCol, piIdx, psImgNm, psPath)
   {
      
      var arg_num = document.forms[0].elements[psCol].value;
      if (arg_num == "" || arg_num == null)
      {
         return;
      }
      if (arg_num == piIdx)
      {
         document.images[psImgNm].src=psPath;
      }
   }

   /**!!
   *  °³¿ä : À©µµ¿ìÁî Ã¢ ´ÝÀ½
   *  @param 
   *  @return       
   !!**/
   function pageClose()
   {
      this.close();
   }

   /**!!
   *  ÇÐ»ý »çÁø Image roading
   *  @param    gubun        "1" :-ÇÐºÎ,´ëÇÐ¿ø, "3"-±âÅ¸
   *            hakbun      ÇÐ¹ø
   *            err_yn      "Y" - ÇÐ»ý»çÁø Display
   !!**/
   function loadImage(gubun, hakbun, err_yn)
   {
      if(hakbun =="" || hakbun == null)
      {
         document.images["page_common_student_image"].src="/k1ss_work/image/nullphoto.gif";
         return;
      }
      if (err_yn == "Y")
      {
         if(gubun == "1")
         {
            document.images["page_common_student_image"].src="/k1ss_work/public_html/file/photo/student/"+hakbun+".jpg";
         }else
         {
            document.images["page_common_student_image"].src="/k1ss_work/public_html/file/photo/etc/"+hakbun+".jpg";
         }
      }else
      {
         document.images["page_common_student_image"].src="/k1ss_work/image/nullphoto.gif";
      }
   }


   /**!!
   *  ÇÐ»ý »çÁø Image roading
   *  @param    gubun        "1" :-ÇÐºÎ,´ëÇÐ¿ø, "3"-±âÅ¸
   !!**/
   function expandImageLoad(gubun)
   {
      var img_hakbun =   opener.page.page_common_image_hakbun.value;
      loadImage(gubun, img_hakbun,"Y");
   }

   /**!!
   *  °³¿ä : onClick½Ã »çÁø Image È®´ë¸¦ À§ÇÑ Ã¢ Open
   !!**/
   function expandImage(gubun, hakbun)
   {
      if ( WINIMAGE_STUDENT != null) 
      {
         WINIMAGE_STUDENT.close();
      }
      WINIMAGE_STUDENT = window.open('/k1ss/work/expandImage.jsp?gubun='+gubun,'expandImage', 'left=210,top=1,width=370,height=460,titlebar=no,toolbar=no,location=no,direction=no,status=no,menubar=no,scrollbars=no,resizable=no');
      WINIMAGE_STUDENT.focus();
   }

   /**!!
   *  °³¿ä : ¼ýÀÚ¿¡ ºÒÇÊ¿äÇÑ 0¼ýÀÚ Á¦°Å
   *  @param           value Á¦°ÅÇÒ ¹®ÀÚ¿­
   *  @return       °á°ú°ª
   !!**/
   function getZeroTrim(value) 
   {    
      var returnValue= value;
      var intValue;
      var dotIndex;
      var preValue;
      var aftValue;
      
      if (returnValue == null || returnValue == "")  { return ""; }
      
      dotIndex = returnValue.indexOf(".");
      if (dotIndex < 0) 
      {   
         intValue =parseInt(returnValue,10); 
         return intValue+"";
      }
      
      preValue = returnValue.substring(0,dotIndex);
      aftValue = returnValue.substring(dotIndex,returnValue.length);
      intValue = parseInt(preValue,10);
      
      return intValue +""+aftValue;
   }

   /**!!
   *  °³¿ä : ¹®ÀÚ¿­¿¡¼­ Æ¯Á¤¹®ÀÚ Á¦°Å
   *  @param           String ´ë»ó ¹®ÀÚ¿­
   *                  String Á¦°ÅÇÒ ¹®ÀÚ(1Byte)
   *  @return        String ¹®ÀÚ°¡ Á¦°ÅµÈ ¹®ÀÚ¿­
   !!**/
   function removeChar(psData, psDelChar)
   {
      var TmpVal  = "";
      var SubChar = "";
      for(i=0; i < psData.length; i++)
      {
         SubChar = psData.substring(i,i+1);
         if (SubChar == psDelChar)
         {
            SubChar = "";
         }
         TmpVal = TmpVal + SubChar;
      }
      return TmpVal;
   }

   /**!!
   *  °³¿ä : Input °´Ã¼¿¡ onFocus Event ¹ß»ý½Ã Æ¯¼ö¹®ÀÚ Á¦°Å
   *  @param           String Input°´Ã¼¸í
   *                  String Á¦°ÅÇÒ ¹®ÀÚ
   *  @return       
   !!**/
   function onFocusFormat(psName, psDelChar)
   {
      var delChar = "";
      var tmpVal  =    "";
      var val =   document.forms[0].elements[psName].value;

      if (val == "" || val == null)
      {
         return;
      }
      if (psDelChar == "" || psDelChar == null)
      {
         return;
      }

      for (i=0; i < psDelChar.length; i++)
      {
         delChar = psDelChar.substring(i,i+1);
         tmpVal  =    "";
         for(k=0; k < val.length; k++)
         {
            SubChar = val.substring(k,k+1);
            if (SubChar == delChar)
            {
               SubChar = "";
            }
            tmpVal = tmpVal + SubChar;
         }
         val = tmpVal;
      }
      document.forms[0].elements[psName].value = val;
   }

   /**!!
   *  °³¿ä : Input °´Ã¼¿¡ outFocus Event ¹ß»ý½Ã FormatÇüÅÂ·Î º¯È¯
   *  @param           String Input°´Ã¼¸í
   *                  String FormatÇü½Ä
   *                  String Format¹®ÀÚ
   *  @return       
   !!**/
   function outFocusFormat(psName, psFormatType, psFormatChar, psDelChar)
   {

      var tmpType = "";
      var tmpVal  =    "";
      var returnVal = "";
      var tailData  ="";
      onFocusFormat(psName,psDelChar);
      var val =   document.forms[0].elements[psName].value;
      var FormatLength = 0;
      var simbol ="";
      if (val == "" || val == null)
      {
         return;
      }
      if (psFormatType == "" || psFormatType == null)
      {
         return;
      }
      FormatLength = psFormatType.length;
      if (psFormatChar == "@")
      {
         var k =0;
         for (i=0; i < FormatLength; i++)
         {
            if(i < val.length)
            {
               tmpVal = val.substring(i,i+1);
            }else
            {
               tmpVal = "";
            }
            tmpType= psFormatType.substring(k,k+1)
            if(tmpType == "@")
            {
               returnVal = returnVal + tmpVal;
            }else
            {
               k = k+1;
               returnVal = returnVal + tmpType+tmpVal;
            }
            k = k+1;
         }
      }else
      {
         if(isInt(val) == false)
         {
            alert("ÀÔ·ÂµÈ °ªÀº ¼ýÀÚ°¡ ¾Æ´Õ´Ï´Ù. ÀÔ·Â°ªÀ» È®ÀÎÇÏ½Ê½Ã¿ä!");
            document.forms[0].elements[psName].value = "";
            document.forms[0].elements[psName].focus();
            return;
         }
         var realVal = getZeroTrim(val);
         var tmpGubun = realVal.indexOf(".");
         var tmpFormatLen = psFormatType.indexOf(".");
         simbol = realVal.substring(0,1);
         if (simbol != "-")  {   simbol = "";   }
         var k, i ;
         if (tmpGubun < 0)
         {
            k = realVal.length;
            tailData = "";
         }else
         {
            k = tmpGubun;
            tailData = realVal.substring(tmpGubun, realVal.length);
         }
         if (tmpFormatLen < 0)
         {
            tmpFormatLen = psFormatType.length;
            tailData = "";
         }else
         {
            var tailLength = psFormatType.length -tmpFormatLen;
            var rp = tailLength - tailData.length;
            if (tailLength > tailData.length)
            {
               for(j=0; j < rp; j++)
               {
                  if(tmpGubun < 0 && j ==0)
                  {
                     tailData = tailData+".";
                  }else
                  {
                     tailData = tailData+"0";
                  }
               }
            }else
            {
               tailData = tailData.substring(0,tailLength);
            }
         }
         for (i=tmpFormatLen; i > -1; i--)
         {
            if(k < 1)
               break;

            tmpType= psFormatType.substring(i-1,i)
            if(tmpType == "#")
            {
               tmpVal = realVal.substring(k-1,k);
               returnVal = tmpVal+returnVal;
               k--;
            }else
            {
               if (realVal.substring(k-1,k) != "-")
               {
                  returnVal = tmpType+returnVal;
               }
            }
         }
      }      
//      document.forms[0].elements[psName].value = simbol+returnVal+tailData;
      document.forms[0].elements[psName].value = returnVal+tailData;
   }

   /**!!
   *  Æ¯Á¤ÇÑ °ª replace
   *  @param           String ¿øº» String
   *                  String ¹Ù²ð¹®ÀÚ¿­
   *                  String ¹Ù²Ü¹®ÀÚ¿­
   !!**/
   function replace(org, from, to) 
   {
      var last=0, next=0;
      var result = "";
      
      while(true) 
      {
         next = org.indexOf(from, last);
         if (next >= 0 ) 
         {
            result += org.substring(last, next) + to;
            last = next + from.length;
         }else 
         {
            result += org.substring(last);
            break;
         }
      }
      return result;
   }

   /**!!
   *  °³¿ä : RdReport È£Ãâ
   *  @param           String mrdÆÄÀÏ¸í
   *                  String Ãâ·ÂÁ¶Á÷ÄÚµå
   *                  String rv parameter
   *                  String ±âÅ¸ parameter
   !!**/
   function popupDesigner(mrd,grp_cd,rv_arg,etc_arg) 
   {
      today = new Date();
      hh = today.getHours();
      mi = today.getMinutes();
      ss = today.getSeconds();
      var tmpRV  = replace(rv_arg,"%","%25");
      var tmpETC = replace(etc_arg,"%","%25");
      var hostip = window.location.host;
      var hostpath = window.location.pathname;
      hostpath = hostpath.substring(0,hostpath.lastIndexOf("/")+1);
      var callRpt = "/k1ss/work/openReportRD.jsp?mrd_rv="+tmpRV+"&mrd_etc="+tmpETC+"&mrd_file="+mrd;
          callRpt += "&mrd_grp_cd="+grp_cd+"&hostip="+hostip+"&hostpath="+hostpath;
          callRpt += "&PAGE_COMMON_REPORT_WIDTH=800";
          callRpt += "&PAGE_COMMON_REPORT_HEIGHT=600";
          callRpt += "&mrd_work_path=rd/";
          callRpt += "&mrd_popup_yn=Y";
      window.open(callRpt,'Report'+hh+mi+ss, 'left=100,top=100,width=800,height=600,titlebar=no,toolbar=no,location=no,direction=no,status=no,menubar=no,scrollbars=no,resizable=no');
   }

   /**!!
   *  °³¿ä : RdReport È£Ãâ:URLÀ» Æ÷ÇÔÇÑ MRD È£Ãâ
   *  @param           String mrdÆÄÀÏ¸í
   *                  String Ãâ·ÂÁ¶Á÷ÄÚµå
   *                  String rv parameter
   *                  String ±âÅ¸ parameter
   !!**/
   function popupDesigner2(mrd,grp_cd,rv_arg,etc_arg) 
   {
      today = new Date();
      hh = today.getHours();
      mi = today.getMinutes();
      ss = today.getSeconds();
      var tmpRV  = replace(rv_arg,"%","%25");
      var tmpETC = replace(etc_arg,"%","%25");
      var hostip = window.location.host;
      var hostpath = window.location.pathname;
      hostpath = hostpath.substring(0,hostpath.lastIndexOf("/")+1);
      var callRpt = "/k1ss/work/openReportRD.jsp?mrd_rv="+tmpRV+"&mrd_etc="+tmpETC+"&mrd_file="+mrd;
          callRpt += "&mrd_grp_cd="+grp_cd+"&hostip="+hostip;
          callRpt += "&PAGE_COMMON_REPORT_WIDTH=800";
          callRpt += "&PAGE_COMMON_REPORT_HEIGHT=600";
          callRpt += "&mrd_popup_yn=Y";
      window.open(callRpt,'Report'+hh+mi+ss, 'left=100,top=100,width=800,height=600,titlebar=no,toolbar=no,location=no,direction=no,status=no,menubar=no,scrollbars=no,resizable=no');
   }

   /**!!
   *  °³¿ä : RdReport È£Ãâ
   *  @param           String mrdÆÄÀÏ¸í
   *                  String Ãâ·ÂÁ¶Á÷ÄÚµå
   *                  String rv parameter
   *                  String ±âÅ¸ parameter
   !!**/
   function viewDesigner(mrd,grp_cd,rv_arg,etc_arg) 
   {
      var tmpRV  = replace(rv_arg,"%","%25");
      var tmpETC = replace(etc_arg,"%","%25");
      var hostip = window.location.host;
      var hostpath = window.location.pathname;
      var PAGE_COMMON_REPORT_WIDTH  = document.forms[0].elements["PAGE_COMMON_REPORT_WIDTH"].value;
      var PAGE_COMMON_REPORT_HEIGHT = document.forms[0].elements["PAGE_COMMON_REPORT_HEIGHT"].value;
      
      hostpath = hostpath.substring(0,hostpath.lastIndexOf("/")+1);
      var callRpt = "/k1ss/work/openReportRD.jsp?mrd_rv="+tmpRV+"&mrd_etc="+tmpETC+"&mrd_file="+mrd;
          callRpt += "&PAGE_COMMON_REPORT_WIDTH="+PAGE_COMMON_REPORT_WIDTH;
          callRpt += "&PAGE_COMMON_REPORT_HEIGHT="+PAGE_COMMON_REPORT_HEIGHT;
          callRpt += "&mrd_grp_cd="+grp_cd+"&hostip="+hostip+"&hostpath="+hostpath;
          callRpt += "&mrd_work_path=rd/";
          callRpt += "&mrd_popup_yn=N";
      document.com_report_frame.location.href=callRpt;
   }

   /**!!
   *  °³¿ä : RdReport È£Ãâ:URLÀ» Æ÷ÇÔÇÑ MRD È£Ãâ
   *  @param           String mrdÆÄÀÏ¸í
   *                  String Ãâ·ÂÁ¶Á÷ÄÚµå
   *                  String rv parameter
   *                  String ±âÅ¸ parameter
   !!**/
   function viewDesigner2(mrd,grp_cd,rv_arg,etc_arg) 
   {
      var tmpRV  = replace(rv_arg,"%","%25");
      var tmpETC = replace(etc_arg,"%","%25");
      var hostip = window.location.host;
      var hostpath = window.location.pathname;
      var PAGE_COMMON_REPORT_WIDTH  = document.forms[0].elements["PAGE_COMMON_REPORT_WIDTH"].value;
      var PAGE_COMMON_REPORT_HEIGHT = document.forms[0].elements["PAGE_COMMON_REPORT_HEIGHT"].value;
      
      hostpath = hostpath.substring(0,hostpath.lastIndexOf("/")+1);
      var callRpt = "/k1ss/work/openReportRD.jsp?mrd_rv="+tmpRV+"&mrd_etc="+tmpETC+"&mrd_file="+mrd;
          callRpt += "&PAGE_COMMON_REPORT_WIDTH="+PAGE_COMMON_REPORT_WIDTH;
          callRpt += "&PAGE_COMMON_REPORT_HEIGHT="+PAGE_COMMON_REPORT_HEIGHT;
          callRpt += "&mrd_grp_cd="+grp_cd+"&hostip="+hostip;
          callRpt += "&mrd_popup_yn=N";
      document.com_report_frame.location.href=callRpt;
   }


   /**!!
   *  °³¿ä : Report È£Ãâ
   *  @param           String rpxÆÄÀÏ¸í
   *                  String µ¥ÀÌÅÍ¸¦ ºÎ¸¦ jsp¸í
   *                  String argument
   !!**/
   function viewReport(rpx,jsp,arg)
   {
      var tmpArg = replace(arg,"%","%25");
      var hostip = window.location.host;
      var hostpath = window.location.pathname;
      var callRpt = "/k1ss/work/callReport.jsp?"+tmpArg+"&rpx_file="+rpx+"&jsp_file="+jsp;
          callRpt += "&hostip="+hostip+"&hostpath="+hostpath;

      window.open(callRpt,'PROCESSING', 'left=400,top=300,width=220,height=20,titlebar=no,toolbar=no,location=no,direction=no,status=no,menubar=no,scrollbars=no,resizable=no');
   }
   
   /**!!
   *  °³¿ä : ReportExpress¿¡ Ãâ·ÂÇÏ±â À§ÇÑ method
   *  @param           String rpxÆÄÀÏ¸í
   *                  String xml ¸ÞÅ¸µ¥ÀÌÅ¸ jsp
   *                  String Host IP
   *                  String Host Path
   *  @return       
   !!**/
   function callReport(rpx,jsp,hostip,hostpath) 
   {
      var PrintSuccessful;
      if(rpx == null || rpx == "")
      {
         return;
      }else
      {
//         document.forms[0].elements["REPORT_NM"].value = "";
      }
      
      hostpath = hostpath.substring(0,hostpath.lastIndexOf("/")+1);

      Viewer1.Initialize();
      Viewer1.Server = "http://" + hostip + hostpath;
      Viewer1.ReportLayout = rpx;
      Viewer1.FileUrl = "http://"+hostip+hostpath+"xml/"+jsp;
      Viewer1.Modal = 0;      //  ¸ð´ÞÃ¢À¸·Î ¶ç¿ì±â
      Viewer1.style.display = "" ;
      Viewer1.Export = 1;      // ³»º¸³»±â ±â´É »ç¿ëÀ¯¹«
      Viewer1.debugging = 0;      // µð¹ö±ë ¿É¼Ç
      Viewer1.SetZoom = 100       // º¸°í¼­ º¸±â »óÅÂ
      Viewer1.ViewToolBar = 1;      // µµ±¸¹Ù º¸¿©ÁÖ±â ±â´É À¯¹«
      Viewer1.AutoRefresh= 1		// »õ·Î°íÄ§ ±â´É
//      Viewer1.XML = ReportXML.xml;
      Viewer1.RunViewer();
      opener.close();
   }

   /**!!
   *  °³¿ä : Byte´ÜÀ§·Î °è»êÇØ¼­ ÇØ´ç byte¼ö¸¸Å­ ¹®ÀÚ¿­ Setting
   *  @param           String ¿øº» µ¥ÀÌÅÍ
   *                  String ¹ÙÀÌÆ®¼ö
   *  @return        
   !!**/
   function setByteString(psColNm, piByte)
   {
      var sValue, byte_count=0, input_name_length=0, one_str, ext_byte;
      sValue = document.forms[0].elements[psColNm].value;

      sValue = new String(sValue);
      input_name_length = sValue.length;
        
      for (i=0;i<input_name_length;i++)
      {
         one_str=sValue.charAt(i);
         if (escape(one_str).length > 4)
         {
            byte_count+=2;
         }else if (one_str != '\r')
         {
            byte_count++;
         }
      }
        
      if (byte_count > piByte)
      {
         ext_byte = byte_count - piByte;
//         alert('\n³»¿ëÀ» '+piByte+'Byte ÀÌ»ó ÀÔ·ÂÇÏ½Ç¼ö ¾ø½À´Ï´Ù.\n\nÀÔ·ÂÇÏ½Å ³»¿ë Áß ÃÊ°ú '+ext_byte+'Byte´Â ÀÚµ¿ »èÁ¦ µË´Ï´Ù.\n');
         sValue = cutByteString(sValue, piByte);
         document.forms[0].elements[psColNm].value = sValue;
         document.forms[0].elements[psColNm].focus();
      }
   }

   /**!!
   *  °³¿ä : Byte´ÜÀ§·Î °è»êÇØ¼­ ÇØ´ç byte¼ö¸¸Å­ ¹®ÀÚ¿­ return
   *  @param           String ¿øº» µ¥ÀÌÅÍ
   *                  String ¹ÙÀÌÆ®¼ö
   *  @return        String Àý»çµÈ µ¥ÀÌÅÍ
   !!**/
   function cutByteString(psValue, piByte)
   {
      var byte_count=0, valueLength=0, one_str;
        
      psValue = new String(psValue);
      valueLength = psValue.length;
        
      for (i=0;i<valueLength;i++)
      {
         if (byte_count < piByte)
         {
            one_str=psValue.charAt(i);
            if (escape(one_str).length > 4)
            {
               byte_count+=2;
            }else if (one_str != '\r')
            {
               byte_count++;
            }
         }else
         {
            psValue = psValue.substring(0,i);
            break;
         }
      }
      if ((piByte%2) ==1)
      {
         valueLength = (psValue.length-1);
         if (escape(psValue.charAt(valueLength)).length > 4)
         {
            psValue = psValue.substring(0,valueLength);
         }
      }
      return psValue;
   }

/**!!
   *  °³¿ä : ÁÖ¹Îµî·Ï¹øÈ£¸¦ °Ë»çÇÏ°í ¸Â´Â°¡ ¾È¸Â´Â°¡ Ã¼Å©ÇØ¼­ ¸Þ¼¼Áö¸¸ ¶Ù¿î´Ù.
   *  @param           String ¿øº» µ¥ÀÌÅÍ 
   *  @return        
!!**/  
   function checkJuminNo(jumin_no)
   {  
      if(jumin_no ==""){
        return false;
      }
      if(jumin_no.substring(6,7)=="-"){
        jumin_no= jumin_no.substring(0,6)+ jumin_no.substring(7,14);
      }
      if (isNaN(jumin_no)) 
      {
            alert("ÁÖ¹Î¹øÈ£´Â ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
            return false;      
      }
      if (jumin_no.length !=13)
      {
           alert("ÁÖ¹Î¹øÈ£ 13ÀÚ¸¦ Á¤È®È÷ ÀÔ·ÂÇÏ½Ê½Ã¿ä");
           return false;
      }     
      ls_param1 = jumin_no.substring(0,1);
      ls_param2 = jumin_no.substring(1,2);
      ls_param3 = jumin_no.substring(2,3);
      ls_param4 = jumin_no.substring(3,4);
      ls_param5 = jumin_no.substring(4,5);
      ls_param6 = jumin_no.substring(5,6);
      ls_param7 = jumin_no.substring(6,7);
      ls_param8 = jumin_no.substring(7,8);
      ls_param9 = jumin_no.substring(8,9);
      ls_param10 = jumin_no.substring(9,10);
      ls_param11 = jumin_no.substring(10,11);
      ls_param12 = jumin_no.substring(11,12);
      ls_param13 = jumin_no.substring(12,13);
      li_hap =0; li_nam =0; li_sub =0;
      //1-8±îÁö °è»ê
      for(i=1;i<9;i++){
        var ls_param14 = 'ls_param'+i;    
        li_hap = li_hap+(eval(ls_param14)*(i+1));         
      }
      //9-12±îÁö °è»ê
      for(i=9;i<13;i++)
      {
        var ls_param15 = 'ls_param'+i;
        li_hap = li_hap+(eval(ls_param15)*(i-7));     
      }
      li_nam = (li_hap%11);    
      li_sub = 11-li_nam;   
      if(li_sub > 9)
      {
        li_sub =(li_sub%10);
      }
    
      if(ls_param13 != li_sub)
      {   
         alert("ÁÖ¹Î¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
           return false;
      }     
      if((ls_param3 > 1)||(ls_param3 =="")||(ls_param3==null))
      {      
         alert("ÁÖ¹Î¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
           return false;
      }       
      if((ls_param5 > 5)||(ls_param5 =="")||(ls_param5==null))
      {      
         alert("ÁÖ¹Î¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
           return false;
      }
      return true;
    
    }

   /**!!
   *  °³¿ä : Æ¯Á¤°ªÀ» ±Ý¾×Æ÷¸ÆÀ¸·Î return
   *  @param        psValue ¿øº» µ¥ÀÌÅÍ
   *  @return     ±Ý¾× FormatÇüÅÂ·Î return
   !!**/
   function getMoneyFormat(psValue) 
   {    
      var souLen = psValue.length;
      var reVal = removeChar(psValue, ",");
      var preMark ="";
      if (reVal.indexOf("-") >-1)
      {
         preMark = "-";
      }
      var iRoop = 0;
      reVal = removeChar(reVal, "-");
      if (souLen < 4)
      {
         return preMark+reVal;
      }
      for(var i=0; i<souLen;i++) 
      {
         var endIdx = reVal.indexOf(",");
         var reValLen = reVal.length;
         var objLen = reVal.substring(0,endIdx).length;
         if(objLen < 4 && iRoop > 0) 
         {
            return preMark+reVal;
         }
         if (iRoop == 0)
         {
            reVal = reVal.substring(0,reValLen-3)+","+ reVal.substring(reValLen-3,reValLen);
         }else
         {
            reVal = reVal.substring(0,objLen-3)+","+ reVal.substring(objLen-3,reValLen);
         }
         iRoop = iRoop + 1;
      }
      return preMark+reVal;
   }

   /*
   * add date : 2008.0201
   * subject : Ã»³äºñ¸®½Å°í¼¾ÅÍ
   * content : ¸¶¿ì½º ¿Â ¾Æ¿ô
   */
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 pagePrint(Obj) { 
    var W = Obj.offsetWidth;        //screen.availWidth; <== ¿©±â¼­ ¹®Á¦¶ó°í ÇÏ´Âµ¥... 
    var H = Obj.offsetHeight;        //screen.availHeight; 
    var features = "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=" + W + ",height=" + H + ",left=0,top=0"; 
    var PrintPage = window.open("about:blank",Obj.id,features); 
    PrintPage.document.open(); 
    PrintPage.document.write("<html><head><title></title><link href='/css/import.css' type='text/css' rel='stylesheet'/></head>\n<body>" + Obj.innerHTML + "\n</body></html>"); 
    PrintPage.document.close(); 
    PrintPage.document.title = document.domain; 
    PrintPage.print(PrintPage.location.reload()); 
} 



