function MM_findObj(n, d) { //v4.0
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 && document.getElementById) x=document.getElementById(n); return x;
}
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 bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;


function OpenWindow(url,intWidth,intHeight) {
  window.open(url, "_blank", "width="+intWidth+",height="+intHeight+",toolbars=0,resizable=1,scrollbars=1") ;
}










    // ºó °ø¹é ¹®ÀÚ¿­ CHECK
    function isempty(s) {
        return ((s == null) || (s.length == 0))
    }

    // ÀÚ·áÀÇ ±æÀÌ CHECK
    function validlength(data_val, len) {
        return (data_val.length >= len);
    }

    function invalidlength(date_val, len, len2) {
        return ((date_val.length >= len) && (date_val.length <= len2));
    }

    // ¹®ÀÚÇü ÀÚ·á CHECK
    function isletter (str) {
        var len=str.length;
        for(i=0; i<len; i++) {
            if ( ((str.charAt(i) >= "a") && (str.charAt(i) <= "z")) || ((str.charAt(i) >= "A") && (str.charAt(i) <= "Z")) ) {
            }
            else {
                   return false;
            }
        }
        return true;
    }

    // ¼ýÀÚÇü ÀÚ·á CHECK
    function isdigit (str) {
        var len=str.length;
        for(i=0; i<len; i++) {
            if ((str.charAt(i) >= "0") && (str.charAt(i) <= "9")) {
            }
            else {
                 return false;
            }
        }
        return true;
    }

    // ÀÌ¸ÞÀÏ ÀÔ·Â CHECK
    function isemail(checkstr) {
        var checkok = "@";
        if (checkstr.length == 0) {return (true);}

        for (i = 0;  i < checkstr.length;  i++) {
             ch = checkstr.charAt(i);
             if (ch == checkok) {return (true) }
        }
        return (false);
    }

    // ´ÜÀÏ¹®ÀÚ ´ëÃ¼ (¿øº»¹®ÀÚ¿­, ´ëÃ¼´ë»ó ¹®ÀÚ, ´ëÃ¼ÇÒ ¹®ÀÚ)
    function replacechar(str, tarch, repch) {
        var nowch  = "";
        var sumstr = "";

        var len=str.length;
        for(i=0; i<len; i++) {
            if (str.charAt(i) == tarch) {
                nowch = repch;
            }
            else {
                nowch = str.charAt(i);
            }
            sumstr = sumstr + nowch;
        }
        return sumstr;
    }

    // ÁÖ¹Îµî·Ï¹øÈ£ CHECK
    function socialcheck(soid) {
        var IDtot = 0;
        var IDAdd = "234567892345";

        for(i=0;i<12;i++) {
            IDtot = IDtot + parseInt(soid.substring(i,i+1)) * parseInt(IDAdd.substring(i,i+1));
        }

           IDtot= 11 - (IDtot%11);

           if(IDtot==10) {
          IDtot = 0;
           }
           else if(IDtot==11){
              IDtot = 1;
           }
           var tid = parseInt(soid.substring(12,13));
           if(tid == IDtot) return true;
    }


    function OpenWindow(URL,W,H,S) {
        if (screen.width == W){
          var T = 0;var L = 0;
        }else{
          var L = ((screen.width) - W) / 2;
          var T = ((screen.height) - H) / 2;
        }
        window.open(URL, 'X', 'width=' + W + ',height=' + H + ',left=' + L + ',top=' + T + ',resizable=no,scrollbars=' + S + '');
    }

    function IsNumber(v) {
        for(var i = 0; i < v.length; i++) {
        var chr = v.substr(i,1);
            if(chr < '0' || chr > '9') {
               return false;
            }
        }
        return true;
    }


    function jsCommonDownload(strFullName) {
        location.href = "/contents/cf/download.asp?FullName=" + strFullName;
    }

    function jsCommonPaging(Page) {
        document.frmParam.Page.value = Page;

        document.frmParam.target = "_self";
        document.frmParam.action = "";
        document.frmParam.submit();
    }


    function setCookie( name, value, expiredays )
    {
        var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
    }

    function closeWin(CookieName)
    {
        setCookie( CookieName, "no" , 1);
        self.close();
    }

