
/*+*****************************************cookie*******************************************************/
// value = 1 : Äí±â ÀÖÀ½ 
function setCookie( name, expiredays ){
  var todayDate = new Date();
  todayDate.setDate( todayDate.getDate() + expiredays );
  //document.cookie = name + "=1; path=/; expires=" + todayDate.toGMTString() + ";"
  document.cookie = name + "=1; path=/; expires=" + todayDate.toGMTString() + ";domain=edaily.co.kr;"   // service ½Ã ¼öÁ¤
}

function idCookie( value , date ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + date );
	// ½Ç »çÀÌÆ® ¿ÀÇÂ½Ã ÁÖ¼®À» Ç®°í ±× ¹Ø¿¡ ÄÚµå¸¦ ¸·´Â´Ù.
	//document.cookie = "cookieid=" + escape( value ) + ";path=/; expires=" + todayDate.toGMTString() + ";"
	document.cookie = "cookieid=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";domain=edaily.co.kr" + ";"
}

//½Ã°£À¸·Î ÄíÅ°¸¸·áÀÏ ÁöÁ¤
function setCookieHours( name, expirehours ){
  var todayDate = new Date();
  //todayDate.setDate( todayDate.getDate() + expiredays );
  //document.cookie = name + "=1; path=/; expires=" + todayDate.toGMTString() + ";"

  todayDate.setHours( todayDate.getHours() + expirehours ); 
  document.cookie = name + "=1; path=/; expires=" + todayDate.toGMTString() + ";domain=edaily.co.kr;"   // service ½Ã ¼öÁ¤
}


/*
function getCookie( name ){
  var nameOfCookie = name + "=";
  var x = 0;

  while ( x <= document.cookie.length ){
    var y = (x+nameOfCookie.length);
      
    if ( document.cookie.substring( x, y ) == nameOfCookie ){
      if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ){
        endOfCookie = document.cookie.length;
        return unescape( document.cookie.substring( y, endOfCookie ) );
      }
    }
    x = document.cookie.indexOf( " ", x ) + 1;

    if ( x == 0 ) break;
  }

return "";
}
*/
function getCookie(uName) {

  var flag = document.cookie.indexOf(uName+'=');
  if (flag != -1) { 
    flag += uName.length + 1
    end = document.cookie.indexOf(';', flag) 

    if (end == -1) end = document.cookie.length
    return unescape(document.cookie.substring(flag, end))
  }else{
    return ''
  }
}


function isexternal( type , newsid, dircode ){
	if ( type == "print" ){ window.open("http://www.edaily.co.kr/news/total/pop_print.asp?newsid=" + newsid +"&dircode=" + dircode, "pop" , "width=700,height=600,scrollbars=yes" ); }
	if ( type == "mail" ) { window.open("http://www.edaily.co.kr/news/total/pop_mail.asp?newsid=" + newsid +"&dircode=" + dircode , "pop" , "width=700,height=600,scrollbars=yes" ); }
}

function isfolderputin( newsid){ window.open("http://www.edaily.co.kr/mypage/myfolder/pop_folderputin.asp?newsid=" + newsid , "pop" , "width=420,height=220 ,left=300, top=300" ); }

function ismobile( type, newsid){ window.open("http://ec.512.co.kr/web/link.jsp?mcode=10101&nid=" + type + newsid , "pop" , "width=710,height=685 ,left=50, top=50" ); }


//---------------------------------------------------------------------------------------------------
//------------------------------- Validation °ü·Ã ½ºÅ©¸³Æ® ÇÔ¼ö  -----------------------------------
//---------------------------------------------------------------------------------------------------

ns4 = (document.layers)?true:false
ie4 = (document.all)?true:false

/*
 *
 *  __isDigit
 *
 *  ÁÖ¾îÁø ¹®ÀÚ¿­ÀÌ ¼ýÀÚÀÎÁö¸¦ °Ë»ç
 *
 *  ÀÔ·Â
 *      sStr : °Ë»çÇÏ°í½ÍÀº ¹®ÀÚ¿­
 *  Ãâ·Â
 *      ºÒ¸°
 *
 */

function __isDigit(sStr) {
  if (sStr < "0"
      || sStr > "9") {
    return false;
  }
  return true;
}

/*
 *
 *  __isAlpha
 *
 *  ÁÖ¾îÁø ¹®ÀÚ¿­ÀÌ ¿µ¹®ÀÚÀÎÁö¸¦ °Ë»ç
 *
 *  ÀÔ·Â
 *      sStr : °Ë»çÇÏ°í½ÍÀº ¹®ÀÚ¿­
 *  Ãâ·Â
 *      ºÒ¸°
 *
 */

function __isAlpha(sStr)
{
  if ((sStr < "A" || sStr > "Z") &&
        (sStr < "a" || sStr > "z"))
  {
    return false;
  }

  return true;
}

/*
 *
 *  __CheckSpaces
 *
 *  ¹®ÀÚ¿­¿¡¼­ ½ºÆäÀÌ½º¸¦ Ã¼Å©ÇÑ´Ù
 *
 *  ÀÔ·Â
 *      sValue : °Ë»çÇÏ°í½ÍÀº ¹®ÀÚ¿­
 *  Ãâ·Â
 *      ºÒ¸°   : ½ºÆäÀÌ½ºÀÇ Æ÷ÇÔ ¿©ºÎ
 *
 */

function __CheckSpaces(strValue) {
    for (var i = 0; i < strValue.length; i++) {
        if (strValue.charAt(i) != " ") {
            return false;
        }
    }

    return true;
}

/*
 *
 *  isNumber
 *
 *  ÁÖ¾îÁø ¹®ÀÚ¿­ÀÌ ¼ýÀÚÀÎÁö¸¦ °Ë»ç
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°    false : ¹®ÀÚ
 *              true  : ¼ýÀÚ
 *
 */

function isNumber(objName, DispMsg) {
  var strValue = objName.value;
  var retChar;
  for (i = 0; i < strValue.length; i++) {
    retChar = strValue.substr(i, 1)
    if (__isDigit(retChar) == false) {
            alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ¼ýÀÚ¸¸ Çã¿ëÀÌ °¡´ÉÇÕ´Ï´Ù.");
            objName.focus();

            return false;
    }
  }

  return true;
}

/*
 *
 *  isNotEmpty
 *
 *  ÁÖ¾îÁø ¹®ÀÚ¿­ÀÌ ³Î ¹®ÀÚÀÎÁö¸¦ °Ë»ç
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°    false : ³Î¹®ÀÚ
 *              true  : ¹®ÀÚ¿­
 *
 */

function isNotEmpty(objName, DispMsg) {
    if (__CheckSpaces(objName.value)) {
        alert("\'" + DispMsg + "' Ç×¸ñÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
        objName.focus();

        return false;
    }

    return true;
}

/*
 *
 *  isNotEmptyChecked
 *
 *  ÁÖ¾îÁø CheckBox ³ª RadidButtonÀÌ ¼±ÅÃµÇ¾ú´ÂÁö °Ë»ç
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°    false : ³Î¹®ÀÚ
 *              true  : ¹®ÀÚ¿­
 *
 */
function isNotEmptyChecked(objName, DispMsg) {
    var count = 0;
  for(var i=0; i<objName.length;i++) {
    if( objName[i].checked ) {
      count=count+1;
    }
  }
  if(count<1){
    alert("\'" + DispMsg + "' Ç×¸ñÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
        return false;
  }
  return true;
}

    
/*
 *
 *  isEMail
 *
 *  ÁÖ¾îÁø ¹®ÀÚ¿­ÀÌ E-Mail ÁÖ¼ÒÀÎÁö¸¦ °Ë»ç
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *  Ãâ·Â
 *      ºÒ¸°    false : ¿À·ù°¡ÀÖ´Â e-amil ÁÖ¼Ò
 *              true  : ÀÎÁ¤µÇ´Â e-mail ÁÖ¼Ò
 *
 */

function isEMail(objName) {
    var sEMail = objName.value;

    if (sEMail == "")
    {
        return false;
    }

    if (sEMail.indexOf("@") < 3) {
        alert("E-Mail ÁÖ¼Ò°¡ Àß¸øµÈ°Í °°½À´Ï´Ù");

        objName.focus();

        return false;
    }

    var sAtSign = sEMail.substring(0, sEMail.lastIndexOf('@') + 1);
    if (sAtSign == "") {
        alert("E-Mail ÁÖ¼Ò°¡ Àß¸øµÈ°Í °°½À´Ï´Ù");

        objName.focus();

        return false;
    }

    var sDomain = sEMail.substring(sAtSign.length, sEMail.length + 1);
    if (sDomain == "") {
        alert("E-Mail ÁÖ¼Ò°¡ Àß¸øµÈ°Í °°½À´Ï´Ù");

        objName.focus();

        return false;
    }

    if (sDomain.indexOf(".") < 1) {
        alert("E-Mail ÁÖ¼Ò°¡ Àß¸øµÈ°Í °°½À´Ï´Ù");

        objName.focus();

        return false;
    }

    return true;
}

/*
 *
 *  isNotBlank
 *
 *  ÁÖ¾îÁø ¹®ÀÚ¿­ÀÌ ºó ¹®ÀÚ¸¦ Æ÷ÇÔÇÏ°í ÀÖ´ÂÁö¸¦ °Ë»ç
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°    false : ºó¹®ÀÚ
 *              true  : ºó¹®ÀÚ ¾øÀ½
 *
 */

function isNotBlank(objName, DispMsg){
    var sValue = objName.value;

    if (sValue.indexOf(" ") > 0) {
        alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ºó¹®ÀÚ¿­ÀÌ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.");
        objName.focus();

        return false;
    }

  return true;
}

/*
 *
 *  HGetStrLength
 *
 *  ¹®ÀÚ¿­ÀÇ ±æÀÌ¸¦ ¸®ÅÏ(ÇÑ±ÛÀº 2¹ÙÀÌÆ®·Î Ã³¸®)
 *
 *  ÀÔ·Â
 *      sValue : ±æÀÌ¸¦ ±¸ÇÏ°í½ÍÀº ¹®ÀÚ¿­
 *  Ãâ·Â
 *      Á¤¼ö   : ¹®ÀÚ¿­ÀÇ ±æÀÌ
 *
 */

function HGetStrLength(sValue) {
    var nStrLength = 0;
    var i;

    for (i = 0; i < sValue.length; i++) {
        if (parseInt(sValue.charCodeAt(i)) > 127) {
            nStrLength = nStrLength + 2;
        } else {
            nStrLength++;
        }
    }

    return nStrLength;
}

/*
 *
 *  isNotHangul
 *
 *  ÁÖ¾îÁø ¹®ÀÚ¿­ÀÌ ÇÑ±ÛÀÌ ¾Æ´ÑÁö¸¦ °Ë»ç
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°    false : ÃÖ¼ÒÇÑÀÇ ±æÀÌº¸´Ù ÀÛ´Ù
 *              true  : ÃæºÐÈ÷ ±æ´Ù
 *
 */

function isNotHangul(objName, DispMsg){
    var sValue = objName.value;

    if (HGetStrLength(sValue) != sValue.length) {
        alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ÇÑ±ÛÀº Çã¿ëµÇÁö ¾Ê½À´Ï´Ù.");
        objName.focus();

        return false;
    }

    return true;
}

/*
 *
 *  SetFocus
 *
 *  ÁÖ¾îÁø ¿ÀÁ§Æ®¿¡ Æ÷Ä¿½º¸¦ ÁØ´Ù
 *
 *  ÀÔ·Â
 *      objName : Æ÷Ä¿½º¸¦ ÁÖ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *  Ãâ·Â
 *      true
 *
 */

function SetFocus(objName) {
    objName.focus();

  return true;
}

/*
 *
 *  isEqual
 *
 *  ÁÖ¾îÁø ¿ÀÁ§Æ®¸¦ ºñ±³ÇØ¼­ °°ÀºÁö¸¦ °Ë»çÇÑ´Ù
 *
 *  ÀÔ·Â
 *      objSrc  : ¿ÀºêÁ§Æ® ¼Ò½º
 *      objDest : ¿ÀºêÁ§Æ® µ¥½ºÆ®
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°
 *
 */

function isEqual(objSrc, objDest, DispMsg) {
    if (objSrc.value != objDest.value) {
        alert("\'" + DispMsg + "' Ç×¸ñÀÌ °°Áö ¾Ê½À´Ï´Ù.");
    objSrc.focus();

    return false;
  }

  return true;
}

/*
 *
 *  isValidID
 *
 *  ¾ÆÀÌµð·Î »ç¿ë°¡´ÉÇÑ ¹®ÀÚ¿­ÀÎÁö¸¦ °Ë»ç
 *
 *  ÀÔ·Â
 *      objName : °Ë»çÇÏ°í½ÍÀº ¿ÀºêÁ§Æ® ÀÌ¸§
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°
 *
 */

function isValidID(objName, DispMsg) {
    var sValue = objName.value;
    var i;
    var retChar;

    for (i = 0; i < sValue.length; i++) {
        retChar = sValue.substr(i, 1)

        if ((__isDigit(retChar) == false)
            && (__isAlpha(retChar) == false)) {
          alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
          objName.focus();

          return false;
        }
    }

  return true;
}

/*
 *
 *  isValidLength
 *
 *  ¹®ÀÚ¿­ÀÌ ÁÖ¾îÁø ±æÀÌ ÀÎÁö¸¦ Á¡°Ë
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *      MinLen  : ÃÖ¼ÒÇÑÀÇ ±æÀÌ
 *      MaxLen  : ÃÖ´ëÇÑÀÇ ±æÀÌ
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°    false : ¹üÀ§¸¦ ¹þ¾î³µ´Ù
 *              true  : ¹üÀ§³»¿¡ Á¸Àç
 *
 */

function isValidLength(objName, MinLen, MaxLen, DispMsg) {
    var sValue = objName.value;

    nStrLen = HGetStrLength(sValue);
    // ÃÖ¼ÒÇÑÀÇ ±æÀÌ Ã¼Å©
  if (nStrLen < MinLen) {
      alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ³Ê¹« ÀÛ°Ô ÀÔ·ÂµÇ¾î ÀÖ½À´Ï´Ù.");
      objName.focus();

      return false;
  }

    // ÃÖ´ëÇÑÀÇ ±æÀÌ Ã¼Å©
  if (nStrLen > MaxLen) {
      alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ³Ê¹« ±æ°Ô ÀÔ·ÂµÇ¾î ÀÖ½À´Ï´Ù.");
      objName.focus();

      return false;
  }

    return true;
}


/*
 *
 *  isForbiddenIDCheck
 *
 *  ¾ÆÀÌµð¿¡ ¼ýÀÚ¿Í ¿µ¹®ÀÚ¸¸ µé¾î°¥ ¼ö ÀÖ°Ô Ã¼Å©
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°    false : ¹üÀ§¸¦ ¹þ¾î³µ´Ù
 *              true  : ¹üÀ§³»¿¡ Á¸Àç
 *
 */

function isForbiddenIDCheck(Objectname, DispMsg) {
  var strValue = Objectname.value

  for (i = 0; i < strValue.length; i++) {
    var retChar = strValue.substr(i,1).toUpperCase()

    if ((retChar < "0" || retChar > "9") && (retChar < "A" || retChar > "Z")) {
        alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ÇÑ±ÛÀÌ³ª Æ¯¼ö ¹®ÀÚ¸¦ »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.")
        Objectname.focus();
        return false;
    }
  }
  return true;
}

/*
 *
 *  isIncludeSpecialChar
 *
 *  ÁÖ¾îÁø ¹®ÀÚ¿­ÀÌ Æ¯¼ö¹®ÀÚ°¡ Æ÷ÇÔµÇ¾ú´ÂÁö¸¦ °Ë»ç
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *  Ãâ·Â
 *      ºÒ¸°    false : Æ÷ÇÔµÇ¾îÀÖÁö¾ÊÀ½
 *              true  : Æ¯¼ö¹®ÀÚ Æ÷ÇÔ
 *
 */

function isNotIncludeSpecialChar(objName, DispMsg) {
    var sValue = objName.value;

    if (sValue == "")
    {
        return true;
    }

    if ((sValue.indexOf("\"") > 0) ||
            (sValue.indexOf("\'") > 0) ) {
        alert("\'" + DispMsg + "' Ç×¸ñ¿¡ Æ¯¼ö ¹®ÀÚ¸¦ »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.")

        objName.focus();

        return false;
    }

    return true;
}

/*
 *
 *  isValidDate
 *
 *  À¯È¿ÇÑ ³¯Â¥ÀÎÁö Ã¼Å©
 *
 *  ÀÔ·Â
 *      objName : Ã¼Å©ÇÏ°í ½ÍÀº 'ÀÏ' ¿ÀºêÁ§Æ®
 *      yyyymmdd : ³â¿ùÀÏ
 *  Ãâ·Â
 *      ºÒ¸°    false : ¹«È¿
 *              true  : À¯È¿
 *
 */

function leapYear(year) {
  if (year%400 == 0){
    return true;
  } else if (year%100 == 0){
    return false;
  } else if (year%4 == 0){
    return true;
  } else{
    return false;
  }
}

function isValidDate(objName, yyyymmdd, DispMsg) {
  if (yyyymmdd == "") return true;
  var sYear = yyyymmdd.substring(0,4);
  var sMonth = yyyymmdd.substring(4,6);
  var sDay = yyyymmdd.substring(6,8);
  var sArrTm = new Array(11);
  sArrTm[0] = 31;
  sArrTm[1] = (leapYear(sYear+1)) ? 29 : 28;
  sArrTm[2] = 31;
  sArrTm[3] = 30;
  sArrTm[4] = 31;
  sArrTm[5] = 30;
  sArrTm[6] = 31;
  sArrTm[7] = 31;
  sArrTm[8] = 30;
  sArrTm[9] = 31;
  sArrTm[10] = 30;
  sArrTm[11] = 31;
  if (sDay > sArrTm[sMonth - 1])
  {
    alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ³¯Â¥ ÀÔ·ÂÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.");
    objName.focus();
    return false;
  }
  else
    return true;
}

function isDateOK(objName, sYear, sMonth, sDay, DispMsg) {
  
  if(sMonth < 1 || sMonth > 12) {
    alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ³¯Â¥ ÀÔ·ÂÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.");
    objName.focus();
    return false; 
  }
  var sArrTm = new Array(11);
  sArrTm[0] = 31;
  sArrTm[1] = (leapYear(sYear+1)) ? 29 : 28;
  sArrTm[2] = 31;
  sArrTm[3] = 30;
  sArrTm[4] = 31;
  sArrTm[5] = 30;
  sArrTm[6] = 31;
  sArrTm[7] = 31;
  sArrTm[8] = 30;
  sArrTm[9] = 31;
  sArrTm[10] = 30;
  sArrTm[11] = 31;
  if (sDay > sArrTm[sMonth - 1]){ 
    alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ³¯Â¥ ÀÔ·ÂÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.");
    objName.focus();
    return false;
  }
  else
    return true;
}

function backHome(sToken){
  window.location.href=sToken;
  return true;
}

function backHome(sToken){
  window.location.href=sToken;
  return true;
}


/*
 *
 *  isNotOnlyNumber
 *
 *  ÁÖ¾îÁø ¾ÆÀÌµð°¡ ¸ðµÎ ¼ýÀÚÀÎÁö¸¦ °Ë»ç
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°    false : ¹®ÀÚ
 *              true  : ¼ýÀÚ
 *
 */

function isNotOnlyNumber(objName, DispMsg) {
  var strValue = objName.value;
  var retChar;
  flag = 0;
  for (i = 0; i < strValue.length; i++) {
    retChar = strValue.substr(i, 1)
    if (__isDigit(retChar) == false) {
            flag = flag+1 ;
    }
  }

  if(flag != 0){
    alert("\'" + DispMsg + "' Ç×¸ñ¿¡ ¼ýÀÚ·Î¸¸ ¾²½Ç ¼ö ¾ø½À´Ï´Ù.");
    objName.focus();
    return false;
  }

  return true;
}


/*
 *
 *  isNotIncludeURLChar
 *
 *  ÁÖ¾îÁø ¹®ÀÚ¿­ÀÌ URLÀ» Æ÷ÇÔÇÏ´Â Æ¯¼ö¹®ÀÚ¸¦ »ç¿ëÇÏ¿´´ÂÁö °Ë»ç
 *
 *  ÀÔ·Â
 *      objName : Á¡°ËÇÏ°í½ÍÀº ÆûÀÇ ¿ÀºêÁ§Æ® ÀÌ¸§
 *      DispMsg : ¿À·ù ¹ß»ý½Ã Ãâ·ÂµÉ ¸Þ½ÃÁöÀÇ ¸Ó¸®±Û
 *  Ãâ·Â
 *      ºÒ¸°    false : ¹®ÀÚ
 *              true  : ¼ýÀÚ
 *
 */


function isNotIncludeURLChar(objName, DispMsg) {
    var sValue = objName.value;

    if (sValue == "")
    {
        return true;
    }

    if ((sValue.indexOf("&") >= 0) 
  || (sValue.indexOf("%") >= 0)
  || (sValue.indexOf("//") >= 0)) {
        alert("'" + DispMsg + "' Ç×¸ñ¿¡ Æ¯¼ö ¹®ÀÚ¸¦ »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.")

        objName.focus();

        return false;
    }

    return true;
}
function MoveFocus() {  document.form2.txtmemid.focus(); }


//±Û ÀÐ±â ÆäÀÌÁö, ÆùÆ® »çÀÌÁî ¼öÁ¤

/*
function scaleFont(val) {
var content, lineHeight; content = document.getElementById("content"); if (val > 0) { if (fontSize <= 18) { fontSize = fontSize + val; lineHeight = fontSize+Math.round(1.1*fontSize); content.style.fontSize = fontSize + "px"; } } else { if (fontSize > 12) { fontSize = fontSize + val; lineHeight = fontSize+Math.round(1.1*fontSize); content.style.fontSize = fontSize + "px"; } } var mydate = new Date; mydate.setDate(mydate.getDate()+1000); setCookie("font_size", fontSize, mydate); }
var fontSize = parseInt(getFontCookie());

function getFontCookie() { var cookie = getCookie("font_size"); if ( cookie == null ) return 16; if ( cookie.length ) return cookie; else return 16; }
function scaleFont(val) {
var content, lineHeight; content = document.getElementById("content"); if (val > 0) { if (fontSize <= 18) { fontSize = fontSize + val; lineHeight = fontSize+Math.round(1.1*fontSize); content.style.fontSize = fontSize + "px"; } } else { if (fontSize > 12) { fontSize = fontSize + val; lineHeight = fontSize+Math.round(1.1*fontSize); content.style.fontSize = fontSize + "px"; } } var mydate = new Date; mydate.setDate(mydate.getDate()+1000); setCookie("font_size", fontSize, mydate); }
var fontSize = parseInt(getFontCookie());
*/

//±Û ÀÐ±â ÆäÀÌÁö, ÆùÆ® »çÀÌÁî ¼öÁ¤
function scaleFont(val) {

	var fontSize = parseInt(getFontCookie());

	var content, lineHeight; 
	content = document.getElementById("content"); 
	
	if (val > 0) 
	{ 
		if (fontSize <= 18) 
		{ 
			fontSize = fontSize + val; 
			lineHeight = fontSize+Math.round(1.1*fontSize); 
			content.style.fontSize = fontSize + "px"; 
		} 
	} 
	else 
	{ 
		if (fontSize > 12) 
		{ 
			fontSize = fontSize + val; 
			lineHeight = fontSize+Math.round(1.1*fontSize); 
			content.style.fontSize = fontSize + "px"; 
		} 
	} 
	
	var mydate = new Date; 
	mydate.setDate(mydate.getDate()+1000); 
	setFCookie("font_size", fontSize, mydate); 

}

function getFontCookie() 
{ 
	var cookie = getFCookie("font_size"); 
	if ( cookie == null ) return 16; 
	if ( cookie.length ) return cookie; 
	else return 16; 
}

function getFCookie(name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while(i< clen) { var j = i + alen; if(document.cookie.substring(i,j)==arg){ var end = document.cookie.indexOf(";",j); if(end == -1) end = document.cookie.length; return unescape(document.cookie.substring(j,end)); } i=document.cookie.indexOf(" ",i)+1; if (i==0) break; } return null; }
function setFCookie(name,value,expires) { document.cookie=name + "=" + escape(value) + ((expires == null)? "" : (" ; expires=" + expires.toGMTString())); }


/*
function scaleFont(val) 
{
	var content, lineHeight; 
	content = document.getElementById("content"); 
	
	if (val > 0) 
	{ 
		if (fontSize <= 18) 
		{ 
			fontSize = fontSize + val; 
			lineHeight = fontSize+Math.round(1.1*fontSize); 
			content.style.fontSize = fontSize + "px"; 
		} 
	} 
	else 
	{ 
		if (fontSize > 12) 
		{ 
			fontSize = fontSize + val; 
			lineHeight = fontSize+Math.round(1.1*fontSize); 
			content.style.fontSize = fontSize + "px"; 
		} 
	} 
	
	var mydate = new Date; 
	mydate.setDate(mydate.getDate()+1000); 
	setCookie("font_size", fontSize, mydate); 
}

var fontSize = parseInt(getFontCookie());
*/


//VOD Open
function openVod(url) {
	window.open(url,'vod','width=720,height=747,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
}

function settle_go_open(val) {
	var settlegoUrl = "/mypage/settle/PayReady.asp?authTypeSel="+val;
	window.open(settlegoUrl,'settlevod','width=730,height=705,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
}

//SPN VOD
function spnpopup_vod( topimg_vodnum ) {
	window.open('http://etms.edaily.co.kr/vod/vod_bridge.asp?svc_cd=02001&key='+topimg_vodnum,'vod','width=730,height=515,scrollbars=0,toolbars=0');
}