function PopupOpen(page){
    var features = 'width=1024,height=768,left=0,top=0';
    features    += 'diretories=no,location=no,menubar=no,scrollbars=no,toolbar=no,resizable=yes,';
    features    += 'status=no,';
    window_handle= window.open(page,'',features);
}
function jsPopup(page,width,height,left,top){
    var features = 'width='+width+',height='+height+',left='+left+',top='+top;
    features    += 'diretories=no,location=no,menubar=no,scrollbars=Yes,toolbar=no,resizable=yes,';
    features    += 'status=no,';
    window_handle= window.open(page,'',features);
}
function jsPopupLogin(page,width,height,left,top){
    var features = 'width='+width+',height='+height+',left='+left+',top='+top;
    features    += 'diretories=no,location=no,menubar=no,scrollbars=no,toolbar=no,resizable=yes,';
    features    += 'status=no,';
    window_handle= window.open(page,'loginPop',features);
}
function jsPopupNoScroll(page,width,height,left,top){
    var features = 'width='+width+',height='+height+',left='+left+',top='+top;
    features    += 'diretories=no,location=no,menubar=no,scrollbars=no,toolbar=no,resizable=no,';
    features    += 'status=no,';
    window_handle= window.open(page,'',features);
}
function jsPopupScroll(page,width,height,left,top){
    var features = 'width='+width+',height='+height+',left='+left+',top='+top;
    features    += 'diretories=no,location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes,';
    features    += 'status=no,';
    window_handle= window.open(page,'',features);
}
function jsPopupScAuto(page,width,height,left,top){
    var features = 'width='+width+',height='+height+',left='+left+',top='+top;
    features    += 'diretories=no,location=no,menubar=no,scrollbars=auto,toolbar=no,resizable=yes,';
    features    += 'status=no,';
    window_handle= window.open(page,'',features);
}

function jsPopupNoScroll2(page)
{
    var url = page;
    open(url,"schZipcode",('scrollbars=0,resizable=0,width=420 height=450'));
}
// key handle
function handleKeydown(n) {
 if (event.keyCode==13) {
                switch(n) {
                        case 1: entire_submit(); break;
                        case 2: FrmCheck( document.frmLog); break;
                        case 3: entire_sub(); break; // entire_search.htm
                }
                return false
        }
        if ( n==2 && event.keyCode == 9 && document.all.imgLog != null )
        {
                document.all.imgLog.focus();
                FrmCheck( document.frmLog);
                return false;
        }
        return true
}
function trim(strText) {
    // this will get rid of leading spaces
    while (strText.substring(0,1) == ' ')
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
}
function goLogin()
{
    document.all.frmUsrLogon.submit();
    return;
}
function goLoginSub()
{
    document.all.CommLogin_sub.submit();
    return;
}
function goLoginTop()
{
//    var returnURL = new String(window.location);

/*
    returnURL = returnURL.substring(returnURL.lastIndexOf("or.kr")+5, returnURL.indexOf("jsp")+3);
    if (returnURL.indexOf("jsp") > -1) {
        returnURL = returnURL.substring(0,returnURL.indexOf("jsp")+3);
    }

    if(document.all.CommLogin_top.Strid.value == null || document.all.CommLogin_top.Strid.value == '')
    {
        alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä\n\n');
        document.all.CommLogin_top.Strid.focus();
        return;
    }
    else if(document.all.CommLogin_top.Strpw.value == null || document.all.CommLogin_top.Strpw.value == '')
    {
        alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä\n\n');
        document.all.CommLogin_top.Strpw.focus();
        return;
    }
    else
    {
*/
//        document.all.CommLogin_top.returnURL.value = new String(returnURL);
var returnURL = new String(window.location);
document.all.CommLogin_top.returnURL.value = new String(returnURL);
        document.all.CommLogin_top.submit();
    //}
}
function goConfirm()
{
    jsPopupLogin('../member/UsrConfirmPop.jsp','345','250','100','100');
    return ;
}

function goNoReply()
{
    alert('»ç¿ëÀÚ°¡ ¿Â¶óÀÎ ÁúÀÇ ÀÀ´äÀ» ¿øÇÏÁö ¾Ê½À´Ï´Ù. ');
}
function goViewRegErr()
{
    var msg = 'µî·ÏÀÚ°¡ Á¤º¸ ºñ°ø°³¸¦ ¿äÃ»ÇÏ¿´½À´Ï´Ù. \n¿î¿µÀÚ¿¡°Ô ¿¬¶ô ¹Ù¶ø´Ï´Ù. ' ;
    alert(msg);
}
function goClip()
{
     //alert( document.frmClip.c_fgbn.value + ' / ' + document.frmClip.c_seq.value + ' / ' + document.frmClip.c_user_seq.value + ' / ' + document.frmClip.c_title.value);
     document.frmClip.submit();
}
function goClips(seq,title)
{
      document.frmClip.c_seq.value = seq;
      document.frmClip.c_title.value = title;
      document.frmClip.submit();
}
function go_quick( idx )
{
        switch ( idx )
        {
                case 1: //ÆÄ´Â±â¼ú
                        go_url = "../techsel/TechSel.jsp?fgbn=11";
                        break;
                case 2: //»ç´Â±â¼ú
                        go_url = "../techbuy/TechBuy.jsp";
                        break;
                case 3: //Æ¯Çã±â¼ú»ó¼³ÀåÅÍ
                        go_url = "../permmart/PermMart.jsp";
                        break;
                case 4: //ÀÚ·á½Ç
                        go_url = "../pds/PdsBoard.jsp";
                        break;
                case 5: //»çÀÌÆ®¸Ê
                        go_url = "../sitemap/Sitemap.jsp";
                        break;
                default:
                        return ;
        }
        window.location.href=  go_url;
}
// Æú´Ù¿î¸Þ´º
function viewSlip() {
    openWin("/slip/Slip.jsp?flag=recvlist",'slip','770','400','no','no');
}
function sendSlip(userid) {
    openWin("/slip/Slip.jsp?boxtype=send&toUser="+userid,'slip','770','400','no','no');
}
function doResize() {
  container.height = ifrmResize.document.body.scrollHeight;
  container.width = ifrmResize.document.body.scrollWidth;
}

<!------
var old_show = '';
function Show1(submenu)
{
    if( old_show != submenu ) {
        if( old_show !='' ) {
            old_show.style.display = 'none';
        }
        submenu.style.display = 'block';
        old_show = submenu;
    }
    else {
        submenu.style.display = 'none';

        old_show = '';
    }
}
function JS_viewObj(objhtml) {
    document.write(objhtml);
}
//------->
// twohk 2007-09-14
//
function openWin(mypage, myname, w, h, scroll, toolbar) {
    if (mypage.indexOf('?') > -1)
    {
        if (mypage.indexOf('popyn') > -1) mypage = mypage;
        else mypage = mypage + "&popyn=Y";
    } else {
        mypage = mypage + "?popyn=Y";
    }
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar='+toolbar+',noresizable'
    win = window.open(mypage, myname, winprops)
    //if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function fnPrintPopup(menuid, fgbn, seq) {
    var pageUrl = "/common/common_print_popup.jsp?menuid="+menuid+"&fgbn="+fgbn+"&seq="+seq;
    openWin(pageUrl, "printS", 800, 600, "no", "no");
}

function fnPrintPopup1(menuid, fgbn, seq, applno) {
    var pageUrl = "/common/common_print_popup1.jsp?menuid="+menuid+"&fgbn="+fgbn+"&seq="+seq+"&applno="+applno;
    openWin(pageUrl, "printS", 800, 600, "no", "no");
}

function fnPrintPopup2(fgbn, applno) {
    var pageUrl = "/common/common_print_popup2.jsp?fgbn="+fgbn+"&applno="+applno;
    openWin(pageUrl, "printS", 800, 600, "no", "no");
}

function fnPrintPopup3(fgbn, applno) {
    var pageUrl = "/common/common_print_popup3.jsp?fgbn="+fgbn+"&applno="+applno;
    openWin(pageUrl, "printS", 800, 600, "no", "no");
}

function fnPrintPopup4(fgbn, applno) {
    var pageUrl = "/common/common_print_popup4.jsp?fgbn="+fgbn+"&applno="+applno;
    openWin(pageUrl, "printS", 800, 600, "no", "no");
}

function fnPrintPopup5(fgbn, applno) {
    var pageUrl = "/common/common_print_popup5.jsp?fgbn="+fgbn+"&applno="+applno;
    openWin(pageUrl, "printS", 800, 600, "no", "no");
}

function fnPrintPopup6(menuid, fgbn, seq) {
    var pageUrl = "/common/common_print_popup6.jsp?menuid="+menuid+"&fgbn="+fgbn+"&seq="+seq;
    openWin(pageUrl, "printS", 800, 600, "no", "no");
}

function fnTechBuyPrint(techno, menuid) {
    var pageUrl = "/common/common_techbuyprint_popup.jsp?techno="+techno+"&menuid="+menuid;
    openWin(pageUrl, "printB", 800, 600, "yes", "no");
}

function fnIdeaPrint(fgbn, seq) {
    var pageUrl = "/common/common_ideaprint_popup.jsp?fgbn="+fgbn+"&seq="+seq;
    openWin(pageUrl, "printI", 800, 600, "yes", "no");
}


function swapImage(srcEle, idPane)
{
    if ( srcEle.src.indexOf(srcEle.src_on) > 0 )
    {
        srcEle.src = srcEle.src_off;
        srcEle.alt = srcEle.alt_off;
    }
    else
    {
        srcEle.src = srcEle.src_on;
        srcEle.alt = srcEle.alt_on;
    }
}

// ÀüÃ¼¼±ÅÃ ÇØÁ¦
// checkbox name : bbs_seq
// form ¿¡ ´ÙÀ½À» Ãß°¡
// <input type="hidden" name="flag" value="0" >
function SetChecked(ele){
    var CheckBox=document.mview_form.bbs_seq;
    if( !CheckBox ) return;
    var Flag=document.mview_form.flag;
    if( Flag.value == 1 ){
        Flag.value=0;
        check_all=false;
    } else {
        Flag.value=1;
        check_all=true;
       }
    if( CheckBox.name == 'bbs_seq' ){
        if( Flag.value == 1 )
            CheckBox.checked=true;
        else
            CheckBox.checked=false;
    } else {
        for( i=0; i < CheckBox.length; i++ ){
         if( Flag.value == 1 )
             CheckBox[i].checked=true;
         else
             CheckBox[i].checked=false;
        }
    }
}

//°æ¸Å½ÅÃ»µî·Ï È­¸é¿¡ »ç¿ë
function SetBidChecked(ele){
    var CheckBox=document.Bidform.bbs_seq;
    if( !CheckBox ) return;
    var Flag=document.Bidform.flag;
    if( Flag.value == 1 ){
        Flag.value=0;
        check_all=false;
    } else {
        Flag.value=1;
        check_all=true;
       }
    if( CheckBox.name == 'bbs_seq' ){
        if( Flag.value == 1 )
            CheckBox.checked=true;
        else
            CheckBox.checked=false;
    } else {
        for( i=0; i < CheckBox.length; i++ ){
         if( Flag.value == 1 )
             CheckBox[i].checked=true;
         else
             CheckBox[i].checked=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_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; }
}

// 2007-10-08 add
function doPlay(media,round){
    var page    = "/common/play.jsp?media="+media+"&rd="+round;
    var winl = (screen.width - 600) / 2;
    var wint = (screen.height - 400) / 2;
    var features = 'width=600,height=400,left='+winl+',top='+wint+',';
    features    += 'diretories=no,location=no,menubar=no,scrollbars=no,toolbar=no,resizable=no,';
    features    += 'status=no,';
    window_handle= window.open(page,'PermMart',features);
}

// 2009-04016 add
function doPlayTv(media,round){
    var page    = "/common/playTv.jsp?media="+media+"&rd="+round;
    var winl = (screen.width - 600) / 2;
    var wint = (screen.height - 400) / 2;
    var features = 'width=600,height=400,left='+winl+',top='+wint+',';
    features    += 'diretories=no,location=no,menubar=no,scrollbars=no,toolbar=no,resizable=no,';
    features    += 'status=no,';
    window_handle= window.open(page,'PermMart',features);
}

function loginAlert()
{
    var ipmartip = 'http://auc.patentmart.or.kr';
    var ipmartLinux = 'http://www.patentmart.or.kr';
    openWin(ipmartLinux+'/common/commonLoginAlert.jsp?popyn=N','login','419','163','no','no');
}

function cfGetAllPilsooValid()
{
    var tds = document.getElementsByTagName("TD");
    for (var i = 0; i < tds.length; i++) {
        if (tds[i].pilsooEnable != true) {
            continue;
        }
        if (tds[i].valid != true) {
            return false;
        }
    }
    return true;
}

// »ç¿ë¹ý : onKeyPress = onlyNum();
function onlyNum()
{
if (event.keyCode < 45 || event.keyCode > 57 || event.keyCode == 47)
  event.returnValue = false;
}

// ¼ýÀÚ¸¸ ÀÔ·Â (¼Ò¼öÁ¡ Çã¿ë, À½¼ö ºÒ°¡)
// »ç¿ë¹ý : onKeyPress = onlyNum2();
function onlyNum2()
{
if (event.keyCode < 46 || event.keyCode > 57 || event.keyCode == 47)
  event.returnValue = false;
}

// ¼ýÀÚ¸¸ ÀÔ·Â (¼Ò¼öÁ¡ ºÒ°¡, À½¼ö Çã¿ë)
// »ç¿ë¹ý : onKeyPress = onlyNum3();
function onlyNum3()
{
if (event.keyCode < 45 || event.keyCode > 57 || event.keyCode == 46 || event.keyCode == 47)
  event.returnValue = false;
}

// ¼ýÀÚ¸¸ ÀÔ·Â (¼Ò¼öÁ¡ ºÒ°¡, À½¼ö ºÒ°¡)
// »ç¿ë¹ý : onKeyPress = onlyNum4();
function onlyNum4()
{
if (event.keyCode < 48 || event.keyCode > 57)
  event.returnValue=false;
}

/*
' ------------------------------------------------------------------
' Function : fc_chk_byte(aro_name)
' Description : ÀÔ·ÂÇÑ ±ÛÀÚ¼ö¸¦ Ã¼Å©
' Argument : Object Name(±ÛÀÚ¼ö¸¦ Á¦ÇÑÇÒ ÄÁÆ®·Ñ)
' Return :
' ReMark:< textarea name="txt_aaa" rows="5" cols="60" onkeyup="fc_chk_byte(this,10);">
' ------------------------------------------------------------------
*/
function fc_chk_byte(aro_name,ari_max)
{

   var ls_str = aro_name.value; // ÀÌº¥Æ®°¡ ÀÏ¾î³­ ÄÁÆ®·ÑÀÇ value °ª
   var li_str_len = ls_str.length; // ÀüÃ¼±æÀÌ

   // º¯¼öÃÊ±âÈ­
   var li_max = ari_max; // Á¦ÇÑÇÒ ±ÛÀÚ¼ö Å©±â
   var i = 0; // for¹®¿¡ »ç¿ë
   var li_byte = 0; // ÇÑ±ÛÀÏ°æ¿ì´Â 2 ±×¹Ü¿¡´Â 1À» ´õÇÔ
   var li_len = 0; // substringÇÏ±â À§ÇØ¼­ »ç¿ë
   var ls_one_char = ""; // ÇÑ±ÛÀÚ¾¿ °Ë»çÇÑ´Ù
   var ls_str2 = ""; // ±ÛÀÚ¼ö¸¦ ÃÊ°úÇÏ¸é Á¦ÇÑÇÒ¼ö ±ÛÀÚÀü±îÁö¸¸ º¸¿©ÁØ´Ù.
     var chStr = "";

   for(i=0; i< li_str_len; i++)
   {
      // ÇÑ±ÛÀÚÃßÃâ
      ls_one_char = ls_str.charAt(i);

      // ÇÑ±ÛÀÌ¸é 2¸¦ ´õÇÑ´Ù.
            chStr = escape(ls_one_char);
      if (chStr.substring(0, 2) == '%u') {
        if (chStr.substring(2,4) == '00')
          li_byte++;
        else
          li_byte += 2;        //ÇÑ±Û
      } else if (chStr.substring(0,1) == '%') {
        if (parseInt(chStr.substring(1,3), 16) > 127)
          li_byte += 2;        //ÇÑ±Û
        else
          li_byte++;
      } else {
          li_byte++;
      }

     /* if (escape(ls_one_char).length > 4)
      {
         li_byte += 2;
      }
      // ±×¹ÜÀÇ °æ¿ì´Â 1À» ´õÇÑ´Ù.
      else
      {
         li_byte++;
      }*/

      // ÀüÃ¼ Å©±â°¡ li_max¸¦ ³ÑÁö¾ÊÀ¸¸é
      if(li_byte <= li_max)
      {
         li_len = i + 1;
      }
   }

   // ÀüÃ¼±æÀÌ¸¦ ÃÊ°úÇÏ¸é
   if(li_byte > li_max)
   {
      alert( li_max + " ±ÛÀÚ¸¦ ÃÊ°ú ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù. \n ÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿À¸·Î »èÁ¦ µË´Ï´Ù. ");
      ls_str2 = ls_str.substr(0, li_len);
      aro_name.value = ls_str2;

   }
   aro_name.focus();
}

function fc_chk_byte2(aro_name,ari_max)
{

   var ls_str = aro_name.value; // ÀÌº¥Æ®°¡ ÀÏ¾î³­ ÄÁÆ®·ÑÀÇ value °ª
   var li_str_len = ls_str.length; // ÀüÃ¼±æÀÌ

   // º¯¼öÃÊ±âÈ­
   var li_max = ari_max; // Á¦ÇÑÇÒ ±ÛÀÚ¼ö Å©±â
   var i = 0; // for¹®¿¡ »ç¿ë
   var li_byte = 0; // ÇÑ±ÛÀÏ°æ¿ì´Â 2 ±×¹Ü¿¡´Â 1À» ´õÇÔ
   var li_len = 0; // substringÇÏ±â À§ÇØ¼­ »ç¿ë
   var ls_one_char = ""; // ÇÑ±ÛÀÚ¾¿ °Ë»çÇÑ´Ù
   var ls_str2 = ""; // ±ÛÀÚ¼ö¸¦ ÃÊ°úÇÏ¸é Á¦ÇÑÇÒ¼ö ±ÛÀÚÀü±îÁö¸¸ º¸¿©ÁØ´Ù.
     var chStr = "";

   for(i=0; i< li_str_len; i++)
   {
      // ÇÑ±ÛÀÚÃßÃâ
      ls_one_char = ls_str.charAt(i);

      // ÇÑ±ÛÀÌ¸é 2¸¦ ´õÇÑ´Ù.
            chStr = escape(ls_one_char);
      if (chStr.substring(0, 2) == '%u') {
        if (chStr.substring(2,4) == '00')
          li_byte++;
        else
          li_byte += 2;        //ÇÑ±Û
      } else if (chStr.substring(0,1) == '%') {
        if (parseInt(chStr.substring(1,3), 16) > 127)
          li_byte += 2;        //ÇÑ±Û
        else
          li_byte++;
      } else {
          li_byte++;
      }

      // ÀüÃ¼ Å©±â°¡ li_max¸¦ ³ÑÁö¾ÊÀ¸¸é
      if(li_byte <= li_max)
      {
         li_len = i + 1;
      }
   }

   // ÀüÃ¼±æÀÌ¸¦ ÃÊ°úÇÏ¸é
   if(li_byte > li_max)
   {
      alert( "2000±ÛÀÚ¸¦ ÃÊ°ú ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù. \n ÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿À¸·Î »èÁ¦ µË´Ï´Ù. ");
      ls_str2 = ls_str.substr(0, li_len);
      aro_name.value = ls_str2;

   }
   aro_name.focus();
}

// ½ÃÀÛ°ª°ú Á¾·á°ª ÃÊ±âÈ­
function InitFromTo(from, to)
{
  if(from) eval(from).value = "";
  if(to)   eval(to).value = "";
}

// ½ÃÀÛ°ª°ú Á¾·á°ª validation check
function FormatFromTo(fromVal, toVal, raVal){

    fromInt = fromVal.value.replace(/,/gi,"");
    fromIN=parseInt(fromInt);
    toInt = toVal.value.replace(/,/gi,"");
    toIN=parseInt(toInt);

    if(raVal != "") {
        if(fromInt == "" && toInt == ""){
            if (window.confirm("°ªÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n\nÀÔ·ÂÇÏ½Ã°Ú½À´Ï±î?") == true ) {
                fromVal.focus();
                return;
            } else {
                raVal[1].checked = false;
                fromVal.disabled = true;
                toVal.disabled = true;
                return;
            }
        }
    }

    if(fromInt != "") { // toµµ °ªÀÌ ÀÖ¾î¾ß
        if (toInt == "") {
            if (window.confirm("Á¾·á°ªÀ» ÀÔ·ÂÇØ ÁÖ¼Å¾ß ÇÕ´Ï´Ù.\n\nÀÔ·ÂÇÏ½Ã°Ú½À´Ï±î?") == true ) {
                toVal.focus();
                return;
            } else {
                InitFromTo(fromVal, toVal);
                if(raVal != "" ) {
                    raVal[1].checked = false;
                    fromVal.disabled = true;
                    toVal.disabled = true;
                }
                return;
            }
        } else {
            if (fromIN >= toIN) {
                if(fromIN == 0 && toIN == 0){
                    alert("½ÃÀÛ°ª°ú Á¾·á°ª¿¡ 0¿øÀ» ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
                    InitFromTo(fromVal, toVal);
                    if(raVal != "" ) {
                            raVal[1].checked = false;
                            fromVal.disabled = true;
                            toVal.disabled = true;
                        }
                    return;
                } else {
                    if (window.confirm("½ÃÀÛ°ªÀº Á¾·á°ªº¸´Ù ÀÛ¾Æ¾ß ÇÕ´Ï´Ù.\n\n¼öÁ¤ÇÏ½Ã°Ú½À´Ï±î?") == true ) {
                        InitFromTo(fromVal, "");
                        if(raVal != "" ) {
                            raVal[1].checked = false;
                            fromVal.disabled = true;
                            toVal.disabled = true;
                        }
                        return;
                    }
                }
            }
        }
    } else {
        if (toIN != 0 && toInt != "") {
            if (window.confirm("½ÃÀÛ°ªµµ ³Ö¾î¾ß ÇÕ´Ï´Ù.\n\nÀÔ·ÂÇÏ½Ã°Ú½À´Ï±î?") == true ) {
                fromVal.focus();
                return;
            } else {
                InitFromTo(fromVal, toVal);
                if(raVal != "" ) raVal[1].checked = false;
                return;
            }
        } else {
            if(toIN == 0){
                alert("Á¾·á°ªÀº 0¿øÀ» ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
                InitFromTo("", toVal);
                return;
            } else {
                return;
            }
        }
    }
}

// ½ÃÀÛ°ª°ú Á¾·á°ª validation check
function FormatFromToYear(fromVal, toVal, raVal){

    fromInt = fromVal.value.replace(/,/gi,"")
    fromIN=parseInt(fromInt);
    toInt = toVal.value.replace(/,/gi,"")
    toIN=parseInt(toInt);

    if(raVal != "") {
        if(fromInt == "" && toInt == ""){
            if (window.confirm("°ªÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n\nÀÔ·ÂÇÏ½Ã°Ú½À´Ï±î?") == true ) {
                fromVal.focus();
                return;
            } else {
                raVal[1].checked = false;
                fromVal.disabled = true;
                toVal.disabled = true;
                return;
            }
        }
    }

    if(fromInt != "") { // toµµ °ªÀÌ ÀÖ¾î¾ß
        if (toInt == "") {
            if (window.confirm("Á¾·á°ªÀ» ÀÔ·ÂÇØ ÁÖ¼Å¾ß ÇÕ´Ï´Ù.\n\nÀÔ·ÂÇÏ½Ã°Ú½À´Ï±î?") == true ) {
                toVal.focus();
                return;
            } else {
                InitFromTo(fromVal, toVal);
                if(raVal != "" ) {
                    raVal[1].checked = false;
                    fromVal.disabled = true;
                    toVal.disabled = true;
                }
                return;
            }
        } else {
            if (fromIN >= toIN) {
                if(fromIN == 0 && toIN == 0){
                    alert("½ÃÀÛ°ª°ú Á¾·á°ª¿¡ 0¿øÀ» ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
                    InitFromTo(fromVal, toVal);
                    if(raVal != "" ) {
                            raVal[1].checked = false;
                            fromVal.disabled = true;
                            toVal.disabled = true;
                        }
                    return;
                } else {
                    if(fromIN != toIN){
                        if (window.confirm("½ÃÀÛ°ªÀº Á¾·á°ªº¸´Ù ÀÛ¾Æ¾ß ÇÕ´Ï´Ù.\n\n¼öÁ¤ÇÏ½Ã°Ú½À´Ï±î?") == true ) {
                            InitFromTo(fromVal, "");
                            if(raVal != "" ) {
                                raVal[1].checked = false;
                                fromVal.disabled = true;
                                toVal.disabled = true;
                            }
                            return;
                        }
                    }
                }
            }
        }
    } else {
        if (toIN != 0 && toInt != "") {
            if (window.confirm("½ÃÀÛ°ªµµ ³Ö¾î¾ß ÇÕ´Ï´Ù.\n\nÀÔ·ÂÇÏ½Ã°Ú½À´Ï±î?") == true ) {
                fromVal.focus();
                return;
            } else {
                InitFromTo(fromVal, toVal);
                if(raVal != "" ) raVal[1].checked = false;
                return;
            }
        } else {
            if(toIN == 0){
                alert("Á¾·á°ªÀº 0¿øÀ» ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
                InitFromTo("", toVal);
                return;
            } else {
                return;
            }
        }
    }
}

// °³¿ù validation check
function FormatMonth(txObj,rdObj){
  fl="";
  num = txObj.value;
  if(isNaN(num)) { alert("¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");return ""}
  if(num==0 || num == ""){
      alert("0 °³¿ùÀº ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
      rdObj[1].checked = false;
      txObj.disabled = true;
      txObj.value = "";
      return ""
  }

  if(num<0){
    num=num*(-1)
    fl="-"
  }else{
    num=num*1 //Ã³À½ ÀÔ·Â°ªÀÌ 0ºÎÅÍ ½ÃÀÛÇÒ¶§ ÀÌ°ÍÀ» Á¦°ÅÇÑ´Ù.
  }
  num = new String(num)
  temp=""
  co=3
  num_len=num.length
  while (num_len>0){
    num_len=num_len-co
    if(num_len<0){co=num_len+co;num_len=0}
    temp=","+num.substr(num_len,co)+temp
  }
  return fl+temp.substr(1)
}





