
// trim
String.prototype.trim = function() {
  return this.replace(/(^\s*)|(\s*$)/gi, "");
}

// file ext
String.prototype.fileExt = function() {
  return (this.indexOf(".") < 0) ? "" : this.substring(this.lastIndexOf(".") + 1, this.length);
}


// Email
function isEmail(email) {
  var aEmail  = email.split('@');
  var account = aEmail[0];
  var domain  = aEmail[1];
  domain = domain.trim();
  if(typeof(account)=='string' && account.length<2) return false;
  if(typeof(domain)=='string' && domain.length<5) return false;

  return email.search(/^\s*[\w\~\-\.]+\@[\w\~\-]+(\.[\w\~\-]+)+\s*$/g)>=0;
}


// °Ë»ö ¹®ÀÚ Ã¼Å© (ÅëÇÕ°Ë»ö)
function chk_form() {
  var frm = document.searchform;
  if(frm.q.value.length<1) {
    alert("°Ë»ö¾î°¡ ³Ê¹« Âª°Å³ª ÀÔ·ÂÇÏÁö ¾ÊÀ¸¼Ì½À´Ï´Ù..");
    frm.q.focus();
    return false;
  }
}



/**
 * Login form check
 */
function chk_login(frmName) {
  if(typeof(frmName)=='undefined') {
    var frm = document.login;
  }
  // Layer
  else if(typeof(frmName)=='string') {
    var frm = document.forms[frmName];
  }

  if(frm.pId.value.length<2 || frm.pId.value=="¾ÆÀÌµð") {
    alert('ID¸¦ È®ÀÎÇØ ÁÖ¼¼¿ä 4ÀÚ ÀÌ»ó ÀÔ´Ï´Ù.');
    frm.pId.focus();
    return false;
  } 
  else if(frm.pPw.value.length<2) {
    alert('ºñ¹Ð¹øÈ£¸¦ È®ÀÎÇØ ÁÖ¼¼¿ä. 4ÀÚ ÀÌ»ó');
    frm.pPw.focus();
    return false;
  }

  frm.action = "https://www.yesform.com/secureLogin/dadadoc/secure_login_proc.php";
  if(frm.pType) {
    if(frm.pType.checked) {
      frm.action = "https://www.yesform.com/secureLogin/dadadoc/secure_login_proc.php";
    }
  }

  frm.submit();
} 


// ·Î±×ÀÎÀ» ¼±ÅÃ ÇßÀ»¶§ Æ÷Ä¿½º
function lfocus() { document.login.pId.focus(); }


// ¼ýÀÚ¸¸ ÀÔ·Â
function num_check() {
  if ((event.keyCode<48)||(event.keyCode>57)) event.returnValue=false;
}


// È¸¿ø°¡ÀÔ : ID Ã£±â
function id_search() {
  var frm = document.memReg;
  if(frm.gId.value.length<4) {
    alert('ID¸¦ 4ÀÚ ÀÌ»ó ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
    frm.gId.focus();
  }
  else {
    url = '/member/check_id.php?pId=' + frm.gId.value;
    if(typeof(frm.desencrypt_idchk)=="object") {
      url += "&desencrypt=" + frm.desencrypt_idchk.value;
    }
    window.open(url,'idsearch','height=200,width=405,scrollbars=no');
  }
}



// È¸¿ø°¡ÀÔ: ¿ìÆí¹øÈ£ °Ë»ö
function zip_search() {
  window.open('/member/check_zip.php','zip','height=350,width=470,scrollbars=yes');
}

// È¸¿ø°¡ÀÔ: ¿ìÆí¹øÈ£ °Ë»ö(·¹ÀÌ¾î)
function zip_search2(flag) {

  H.style.posLeft = event.x - 130;
  H.style.posTop = event.y + document.body.scrollTop - 130;

  html  = "<table width='470' border='0' cellspacing='0' cellpadding='0' style='border:3px solid #BDBDBD;background-color:#FFFFFF'>";
  html += "<tr><td><iframe name='zipcode' src='/z_n/member/check_zip_iframe.php' frameborder='0' width='100%' height='410px;' scrolling='no'></iframe></td></tr>";
  html += "<tr><td style='padding-top:10px; padding-bottom:10px;' align='center'><a href='#' onClick='zip_search2(\"hide\"); return false'><img src='/z_n/imgs/2007/remain/zip_btn2.gif' alt='´Ý±â' width='59' height='23' border='0'></a></td>";
  html += "</tr></table>";

  if(flag=="show") H.innerHTML = html;
  else             H.innerHTML = '';

}

// ================================================================================
// ÀüÃ¼ °øÅë ³¡ 
// ================================================================================

/**
 * ÆäÀÌÁö ´Ù½ÃÀÐ±â
 *
 * @author: cfi
 */
function ReloadPage(delparm,parmname,parmval) {
  var url = document.location;
  var pathname = document.location.pathname;
  var search = document.location.search;
  var result = '';

  if(search.indexOf('?')>-1) {
    var querystring = search.substring(1);
    var aParm = querystring.split('&');
    var aUnique = new Array(70);
    var loopnum = 0;
    for(var i=0; i<aParm.length; i++) {
      var val = aParm[i];
      if(!val) continue;

      var aVal = val.split('=');
      if(aVal[1]=='' || aVal[0]==delparm || aVal[0]=='page' || aUnique[aVal[0]]=='ok') continue;

      if(loopnum++>0) result += '&';
      result += aVal[0] + '=' + aVal[1];
      aUnique[aVal[0]] = 'ok';
    }
    if(typeof(parmname)=='string' && typeof(val)!='undefined') {
      result += '&' + parmname + '=' + parmval;
      var reurl = pathname + '?' + result;
    }
  }
  else {
    var reurl = pathname + '?' + parmname + '=' + parmval;
  }
  if(parmval.length>1) location.replace(reurl);
}

/**
 * ÄÞ¸¶ Âï±â ¼Ò¼öÁ¡ÀÌ ÀÖÀ¸¸é Ã¹¹øÂ° ÀÚ¸®±îÁö¸¸ º¸¿©ÁØ´Ù.
 */
function ProcComma(ostr) {
  var ostr  = "" + ostr + "";
  var aStr  = ostr.split(".");
  var str   = aStr[0];
  var t1    = "";
  for(var i=0; i<str.length; i++) {
    var t = str.charAt(i);
    if(isFinite(t)) t1 += t;
  }
  if(t1.length>0) str = t1;
  if(aStr[1]) { 
    var fstr  = aStr[1].substring(0,1);
  }
  
  var num   = 0;
  var val   = "";
  for(var i=1; i<=str.length; i++) {
    if(i>1 && (++num%3)==0) {
      val = str.charAt(str.length-i) + ',' + val;
    }
    else {
      val = str.charAt(str.length-i) + val;
    }
  }
  if(fstr) val = val+'.'+fstr;
  if(ostr.length>0 && ostr.substring(0,1)=="-") val = "-" + val;
  
  return val;
}


function Link_Control(targetlink){// ¸ÞÀÏÀÎ»ç¸» ¼­ºñ½º ¾²±âÆäÀÌÁö¿¡¼­ ¸µÅ©ÀÌµ¿ Äü¸Þ´º¶§¹®¿¡ ¿©±â ³Ö¾îµÒ
  var loc = location.href.split("/");
  if(loc[5]){
	var loc_01 = loc[5].split(".");
  }else{
	var loc_01 = loc[3].split("=");
  }
  if(loc_01[0] == "mail_write"){
    var reply_to  = document.email_write.reply_to.value;
    var receivemail  = document.email_write.receivemail.value;
    var togetherman  = document.email_write.togetherman.value;
    var subject  = document.email_write.subject.value;
    var strHTML;
    strHTML = VBN_getHTML();
    if(strHTML =="<P>&nbsp;</P>")strHTML ="";
    //alert(strHTML);
    if(receivemail!="" || togetherman!="" || subject!="" || strHTML!=""){
      var msg="ÀÌ ÆäÀÌÁö·ÎºÎÅÍ ¹þ¾î ³ª½Ã°Ú½À´Ï±î?.   \n\n";
      msg+="ÀÌ ÆäÀÌÁö¸¦ ¹þ¾î³ª¸é ÀÛ¼ºµÈ ¸ÞÀÏ³»¿ëÀº ÀúÀå µÇÁö ¾Ê½À´Ï´Ù.   \n\n";
      msg+="°è¼Ó ÇÏ·Á¸é [È®ÀÎ]À» Å¬¸¯ÇÏ°í, ÇöÀç ÆäÀÌÁö¿¡ ÀÖÀ¸·Á¸é [Ãë¼Ò]¸¦ Å¬¸¯ÇÏ½Ê½Ã¿À.";

      if(confirm(msg)){
        location.href = targetlink;
      }
    }else{
      location.href = targetlink;
    }
  }else location.href = targetlink;
  
}

/**
 *
 */
function sleepfnc() {
}



//·Î±×ÀÎ Ã¢ ¿£ÅÍ Ã¼Å©
function loginEnterChk() {
  if(event.keyCode==13) {    
	chk_login('frmLogin');
  }
}

//·Î±×ÀÎ Ã¢ º¸¿©ÁÖ±â
function showLogin(pos, mode, urlstr) {

  var htm = '';

  if(pos!='top') htm += "<table width='980' height='100%' border='0' cellpadding='0' cellspacing='0' align='center'><tr><td>";

  htm += "<form name='frmLogin' method='post' action='https://www.yesform.com/secureLogin/dadadoc/secure_login_proc.php' target='hpc' onSubmit='return chk_login(this.name);'>";
  htm += "<input type='hidden' name='urlstr' value='"+urlstr+"'>";
  htm += "<table width='395' border='0' align='center' cellpadding='0' cellspacing='0' bgcolor='white'>";
  htm += "  <tr>";
  htm += "    <td style='border:1px solid #5167db;'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>";
  htm += "      <tr>";
  htm += "        <td height='32'><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
  htm += "            <tr>";
  htm += "              <td><img src='/imgs/2011/login_top.gif' width='361' height='32'></td>";
  htm += "              <td><a href='#' onclick=\"showLogin('"+pos+"','hidden',''); return false;\"><img src='/imgs/2011/login_close.gif' alt='´Ý±â' width='32' height='32' border='0'></a></td>";
  htm += "            </tr>";
  htm += "          </table></td>";
  htm += "      </tr>";
  htm += "      <tr>";
  htm += "        <td height='158'><table width='364' border='0' align='center' cellpadding='0' cellspacing='0'>";
  htm += "          <tr>";
  htm += "            <td><table border='0' align='center' cellpadding='0' cellspacing='0'>";
  htm += "              <tr>";
  htm += "                <td width='60' height='21' style='padding-top:2px;'><font color='4C657E'>¾ÆÀÌµð</font></td>";
  htm += "                <td><input type='text' name='pId' style='border:1px solid #d1d1d1;width:110px;height:19px;' tabindex='1' class='reg_input_mem'/></td>";
  htm += "                <td width='70' rowspan='3' align='center'><input type='image' src='/imgs/2011/login_btn_login.gif' width='59' height='43' alt='·Î±×ÀÎ' tabindex='3'></td>";
  htm += "              </tr>";
  htm += "              <tr>";
  htm += "                <td height='3' colspan='2'></td>";
  htm += "              </tr>";
  htm += "              <tr>";
  htm += "                <td class='righttip' style='padding-top:2px;'><font color='4C657E'>ºñ¹Ð¹øÈ£</font></td>";
  htm += "                <td><input type='password' name='pPw' style='border:1px solid #d1d1d1;width:110px;height:19px;' tabindex='2' onkeypress='loginEnterChk();'/></td>";
  htm += "              </tr>";
  htm += "            </table></td>";
  htm += "          </tr>";
  htm += "          <tr>";
  htm += "            <td height='45' style='border-bottom:1px solid #d8d8d8;'><table border='0' align='center' cellpadding='0' cellspacing='0' class='top_txt'>";
  htm += "              <tr>";
  htm += "                <td><input type='checkbox' name='pType' value='secure' checked/></td>";
  htm += "                <td style='padding-top:5px;'><font color='4F4F30' style='font-family:µ¸¿ò '> º¸¾ÈÁ¢¼Ó</font></td>";
  htm += "                <td>&nbsp;</td>";
//  htm += "                <td width='13' style='padding-left:10px;padding-top:2px;'><img src='/imgs/2011/tel2.gif' width='11' height='11' align='ansmiddle' /></td>";
//  htm += "                <td  style='padding-top:5px;'> <a href='#'><font color='4F4F30' style='font-family:µ¸¿ò;font-size:12px; '>·Î±×ÀÎÀÌ Àß ¾ÈµÇ¼¼¿ä?</font></a></td>";
  htm += "              </tr>";
  htm += "            </table></td>";
  htm += "          </tr>";
  htm += "          <tr>";
  htm += "            <td align='center' style='padding-top:13px;'><a href='#' onClick='showPwFind()'><img src='/imgs/2011/login_btn_help.gif' alt='¾ÆÀÌµð/ºñ¹Ð¹øÈ£ Ã£±â' width='140' height='19' hspace='4' border='0'></a><a href='/member/member_reg.php'><img src='/imgs/2011/login_btn_join.gif' alt='¹ÙÀÌÆû È¸¿ø °¡ÀÔ' width='119' height='19' hspace='4' border='0'></a></td>";
  htm += "          </tr>";
  htm += "        </table></td>";
  htm += "      </tr>";
  htm += "    </table></td>";
  htm += "  </tr>";
  htm += "</table>";
  htm += "</form>";

  if(pos!='top') htm += "</td></tr></table>";

  if(pos=='top') {
    var layer = document.getElementById('loginlayer');
    if(mode=="show") {
      layer.style.zindex='1000';
//      layer.style.position='absolute';
//      layer.style.left='-185';
//      layer.style.left='700';
//      layer.style.top='25';
      layer.innerHTML = htm;
      layer.style.display='';
    }
    else {
      layer.innerHTML = '';
      layer.style.display='none';
    }

  }
  else {

    if(mode=="show") {
      document.getElementById('LL_BG').style.display = '';
      document.getElementById('LL_BG').style.width = screen.width-21;
      document.getElementById('LL_BG').style.height = document.body.scrollHeight;

      document.getElementById('LL').style.top = document.body.scrollTop;
      document.getElementById('LL').style.width='100%';
      document.getElementById('LL').style.height='100%';
      document.getElementById('LL').innerHTML = htm;

      // course focus
      if(typeof(document.loginLayer)=='object') document.loginLayer.pId.focus();

      // select box layer¿¡ Æ¢¾î ³ª¿À´Â Çö»ó ¶§¹®¿¡ ¹«Á¶°Ç ¼û±ä´Ù.
      if(typeof(doclistscale)=='object') doclistscale.style.display = 'none';
      if(typeof(doclistscale2)=='object') doclistscale2.style.display = 'none';
      if(typeof(doclistsort)=='object')  doclistsort.style.display  = 'none';
      if(typeof(doclistclass)=='object')  doclistclass.style.display  = 'none';
      if(typeof(doclistfext)=='object')  doclistfext.style.display  = 'none';
      if(typeof(contractscale)=='object') contractscale.style.display = 'none';
    }
    else if(mode=="hidden") {
      document.getElementById('LL_BG').style.display = 'none';
      document.getElementById('LL_BG').style.width = '0px';
      document.getElementById('LL_BG').style.height = '0px';

      document.getElementById('LL').innerHTML = '';
      document.getElementById('LL').style.top = '0px';
      document.getElementById('LL').style.width='0px';
      document.getElementById('LL').style.height='0px';

      // select box layer¿¡ Æ¢¾î ³ª¿À´Â Çö»ó ¶§¹®¿¡ ¹«Á¶°Ç ¼û±ä´Ù.
      if(typeof(doclistscale)=='object') doclistscale.style.display = '';
      if(typeof(doclistscale2)=='object') doclistscale2.style.display = '';
      if(typeof(doclistsort)=='object')  doclistsort.style.display  = '';
      if(typeof(doclistclass)=='object')  doclistclass.style.display  = '';
      if(typeof(doclistfext)=='object')  doclistfext.style.display  = '';
      if(typeof(contractscale)=='object') contractscale.style.display = '';
    }

  }

}

//·Î±×ÀÎ Ã¢ ¼û±â±â
function hideLogin() {
  var layer = document.getElementById('loginlayer');
  layer.innerHTML='';
  layer.display='none';
}

// ¾ÆÀÌµð/ºñ¹Ð¹øÈ£ Ã£±â ÆûÃ¼Å©
function chk_pw() {

  var frm = document.frmFind;

//  if(frm.div[1].checked==true) {
//    txt1 = "´ã´çÀÚÀÌ¸§";
//    txt2 = "»ç¾÷ÀÚµî·Ï¹øÈ£";
//    txt2_len = 10;
//  }
//  else {
//    txt1 = "ÀÌ¸§";
//    txt2 = "ÁÖ¹Îµî·Ï¹øÈ£";
//    txt2_len = 13;
//  }

//  if(frm.name.value.length<2) {
//    alert(txt1+'À» ÀÔ·ÂÇÏ¼¼¿ä');
//    frm.name.focus();
//    return false;
//  }
//  else if(frm.jumin.value.length<txt2_len) {
//    alert(txt2+'¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
//    frm.jumin.focus();
//    return false;
//  }
  if(frm.name.value.length<1) {
    alert('ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä');
    frm.name.focus()
    return false;
  }
  else if(frm.email.value.length<1) {
    alert('ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä');
    frm.email.focus()
    return false;
  }

}

//¾ÆÀÌµð/ºñ¹Ð¹øÈ£ Ã£±â Ã¢ º¸¿©ÁÖ±â
function showPwFind(urlstr) {

  var htm = "";
  htm += "<form name='frmFind' method='post' target='hpc' onSubmit='return chk_pw();' action='/member/db_pwsearch.php'>";
  htm += "<input type='hidden' name='urlstr' value='"+urlstr+"'>";
  htm += "  <table width='395' border='0' align='center' cellpadding='0' cellspacing='0' style='background:#FFFFFF;'>";
  htm += "  <tr>";
  htm += "    <td style='border:1px solid #5167db;'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>";
  htm += "      <tr>";
  htm += "        <td height='33'><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
  htm += "          <tr>";
  htm += "            <td><img src='/imgs/2011/idsearch_top.gif' width='361' height='32'></td>";
  htm += "            <td><a href='#' onClick=\"document.getElementById('pwfindlayer').style.display='none'\"><img src='/imgs/2011/login_close.gif' alt='´Ý±â' width='32' height='32' border='0'></a></td>";
  htm += "          </tr>";
  htm += "        </table></td>";
  htm += "      </tr>";
  htm += "      <tr>";
  htm += "        <td height='157' valign='top'><table width='364' border='0' align='center' cellpadding='0' cellspacing='0'>";
  htm += "          <tr>";
  htm += "            <td height='75'><table border='0' align='center' cellpadding='0' cellspacing='0'>";
  htm += "              <tr>";
  htm += "                <td height='3' colspan='2'></td>";
  htm += "              </tr>";
  htm += "              <tr>";
  htm += "                <td width='85' height='21' class='righttip' style='padding-top:2px;'><font color='4C657E'>¼º¸í</font></td>";
  htm += "                <td><input name='name' type='text' style='border:1px solid #d1d1d1;height:19px;' tabindex='110' value='' size='12' /></td>";
  htm += "              </tr>";
  htm += "              <tr>";
  htm += "                <td height='7' colspan='2'></td>";
  htm += "              </tr>";
  htm += "              <tr>";
  htm += "                <td class='righttip' ><font color='4C657E'>ÀÌ¸ÞÀÏ</font></td>";
  htm += "                <td><input name='email' type='text' style='border:1px solid #d1d1d1;height:19px;' tabindex='111' size='20' /></td>";
  htm += "              </tr>";
  htm += "            </table></td>";
  htm += "          </tr>";
  htm += "          <tr>";
  htm += "            <td height='30' align='center' style='border-bottom:1px solid #d8d8d8;'>È¸¿ø°¡ÀÔ½Ã µî·ÏÇÑ ¼º¸í°ú ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.</td>";
  htm += "          </tr>";
  htm += "          <tr>";
  htm += "            <td align='center' style='padding-top:13px;'><input type='image' src='/imgs/2011/idsearch_btn_ok.gif' alt='È®ÀÎ' width='89' height='30' border='0' /></td>";
  htm += "          </tr>";
  htm += "        </table></td>";
  htm += "      </tr>";
  htm += "    </table></td>";
  htm += "  </tr>";
  htm += "</table>";
//  htm += "<table width='395' border='0' align='center' cellpadding='0' cellspacing='0' bgcolor='white'>";
//  htm += "  <tr>";
//  htm += "    <td style='border:1px solid #5167db;'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>";
//  htm += "        <tr>";
//  htm += "          <td height='33'><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
//  htm += "              <tr>";
//  htm += "                <td><img src='/imgs/2011/idsearch_top.gif' width='361' height='32'></td>";
//  htm += "                <td><a href='#' onClick=\"document.getElementById('pwfindlayer').style.display='none'\"><img src='/imgs/2011/login_close.gif' alt='´Ý±â' width='32' height='32' border='0'></a></td>";
//  htm += "              </tr>";
//  htm += "            </table></td>";
//  htm += "        </tr>";
//  htm += "        <tr>";
//  htm += "          <td height='157' valign='top'><table width='364' border='0' align='center' cellpadding='0' cellspacing='0'>";
//  htm += "            <tr>";
//  htm += "              <td height='95' style='border-bottom:1px solid #d8d8d8;'><table border='0' align='center' cellpadding='0' cellspacing='0'>";
//  htm += "                  <tr>";
//  htm += "                    <td width='85' height='21' class='righttip' style='padding-top:2px;'><font color='4C657E'>È¸¿ø±¸ºÐ</font></td>";
//  htm += "                    <td><input type='radio' name='div' value='°³ÀÎ' checked onClick='memType(this)'/><label for='radio'>°³ÀÎÈ¸¿ø</label>&nbsp;<input type='radio' name='div' value='±â¾÷' onClick='memType(this);'/><label for='radio'>±â¾÷È¸¿ø</label></td>";
//  htm += "                  </tr>";
//  htm += "                  <tr>";
//  htm += "                    <td height='3' colspan='2'></td>";
//  htm += "                  </tr>";
//  htm += "                  <tr>";
//  htm += "                    <td height='21' class='righttip' style='padding-top:2px;'><font color='4C657E'><div id='findname'>ÀÌ¸§</div></font></td>";
//  htm += "                    <td><input type='text' name='name' style='border:1px solid #d1d1d1;height:19px;' tabindex='110' size='12'  class='reg_input_mem'/></td>";
//  htm += "                  </tr>";
//  htm += "                  <tr>";
//  htm += "                    <td height='3' colspan='2'></td>";
//  htm += "                  </tr>";
//  htm += "                  <tr>";
//  htm += "                    <td class='righttip' ><font color='4C657E'><div id='findjumin'>ÁÖ¹Îµî·Ï¹øÈ£</div></font></td>";
//  htm += "                    <td><input type='text' name='jumin' style='border:1px solid #d1d1d1;height:19px;' tabindex='111' size='15' maxlength='13'  class='reg_input_mem' autocomplete='off' onKeyPress='return num_check()'/> - Á¦¿ÜÀÔ·Â</td>";
//  htm += "                  </tr>";
//  htm += "                </table></td>";
//  htm += "            </tr>";
//  htm += "            <tr>";
//  htm += "              <td align='center' style='padding-top:13px;'><input type='image' src='/imgs/2011/idsearch_btn_ok.gif' alt='È®ÀÎ' width='89' height='30' border='0'/></td>";
//  htm += "            </tr>";
//  htm += "          </table></td>";
//  htm += "        </tr>";
//  htm += "      </table></td>";
//  htm += "  </tr>";
//  htm += "</table>";
  htm += "</form>";

  var layer = document.getElementById('loginlayer');
  layer.style.display='none';
  var layer = document.getElementById('pwfindlayer');
  layer.style.zindex='1000';
  layer.style.position='absolute';
  layer.style.width='405';
  layer.style.height='200';
  layer.style.left='750';
  layer.style.top='28';
  layer.innerHTML = htm;
  layer.style.display='';
}

//¾ÆÀÌµð/ºñ¹Ð¹øÈ£ Ã£±â ¼û±â±â
function hidePwFind() {
  var layer = document.getElementById('pwfindlayer');
  layer.innerHTML='';
  layer.display='none';
}

//¾ÆÀÌµð/ºñ¹Ð¹øÈ£ Ã£±â °á°ú Ã¢ º¸¿©ÁÖ±â
//function showPwResult(id,pw,urlstr) {
function showPwResult(search,urlstr) {

  var msg = '';
  if(search=='ok') msg = '¾ÆÀÌµð/ºñ¹Ð¹øÈ£¸¦ ÀÌ¸ÞÀÏ·Î ¹ß¼ÛÇÏ¿´½À´Ï´Ù.';
  else             msg = 'ÀÔ·ÂÇÏ½Å Á¤º¸ÀÇ ¾ÆÀÌµð/ºñ¹Ð¹øÈ£¸¦ Ã£Áö ¸øÇÏ¿´½À´Ï´Ù.';

  var htm = '';
  htm += "<table width='395' border='0' align='center' cellpadding='0' cellspacing='0' style='background:#FFFFFF;'>";
  htm += "  <tr>";
  htm += "    <td style='border:1px solid #5167db;'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>";
  htm += "      <tr>";
  htm += "        <td height='33'><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
  htm += "          <tr>";
  htm += "            <td><img src='/imgs/2011/idsearch_top.gif' width='361' height='32' /></td>";
  htm += "            <td><a href='#' onclick=\"document.getElementById('pwfindlayer').style.display='none'\"><img src='/imgs/2011/login_close.gif' alt='´Ý±â' width='32' height='32' border='0' /></a></td>";
  htm += "          </tr>";
  htm += "        </table></td>";
  htm += "      </tr>";
  htm += "      <tr>";
  htm += "        <td height='157' valign='top'><table width='364' border='0' align='center' cellpadding='0' cellspacing='0'>";
  htm += "          <tr>";
  htm += "            <td height='70' style='padding-top:15px;' align='center'><font color='#4c657e'>"+msg+"</font></td>";
  htm += "          </tr>";
  htm += "          <tr>";
  htm += "            <td align='center' style='padding-top:13px;'><a href='#' onClick=\"showPwFind('"+urlstr+"');\"><img src='/imgs/2011/idsearch_btn_re.gif' alt='´Ù½ÃÃ£±â' width='89' height='30' border='0' hspace='5'/></a><a href='/member/member_reg.php?urlstr="+urlstr+"'><img src='/imgs/2011/idsearch_btn_join.gif' alt='È¸¿ø°¡ÀÔ' width='89' height='30' border='0' hspace='5'/></a></td>";
  htm += "          </tr>";
  htm += "        </table></td>";
  htm += "      </tr>";
  htm += "    </table></td>";
  htm += "  </tr>";
  htm += "</table>";

//  htm += "<table width='395' border='0' align='center' cellpadding='0' cellspacing='0' bgcolor='white'>";
//  htm += "  <tr>";
//  htm += "    <td style='border:1px solid #5167db;'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>";
//  htm += "      <tr>";
//  htm += "        <td height='33'><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
//  htm += "          <tr>";
//  htm += "            <td><img src='/imgs/2011/idsearch_top.gif' width='361' height='32' /></td>";
//  htm += "            <td><a href='#' onclick=\"document.getElementById('pwfindlayer').style.display='none'\"><img src='/imgs/2011/login_close.gif' alt='´Ý±â' width='32' height='32' border='0'></a></td>";
//  htm += "          </tr>";
//  htm += "        </table></td>";
//  htm += "      </tr>";
//  htm += "      <tr>";
//  htm += "        <td height='157' valign='top'><table width='364' border='0' align='center' cellpadding='0' cellspacing='0'>";
//  htm += "      <tr>";
//  htm += "        <td height='35' style='border-bottom:1px solid #d8d8d8; padding-top:7px;' align='center'><font color='#4c657e'>ÀÔ·ÂÇÏ½Å Á¤º¸ÀÇ ¾ÆÀÌµð´Â ¾Æ·¡¿Í °°½À´Ï´Ù.</font></td>";
//  htm += "      </tr>";
//  htm += "      <tr>";
//  htm += "        <td height='60' style='border-bottom:1px solid #d8d8d8;'><table border='0' align='center' cellpadding='0' cellspacing='0'>";
//  htm += "            <tr>";
//  htm += "              <td style='line-height:150%;'><font color='#4c657e'>&bull;</font> ¾ÆÀÌµð : <font color='#e20606'><strong>"+id+"</strong></font><br />";
//  htm += "              <font color='#4c657e'>&bull;</font> ºñ¹Ð¹øÈ£ : <font color='#e20606'><strong>"+pw+"</strong></font></td>";
//  htm += "            </tr>";
//  htm += "          </table></td>";
//  htm += "        </tr>";
//  htm += "        <tr>";
//  htm += "          <td align='center' style='padding-top:13px;'><a href='#' onclick=\"hidePwResult(); showLogin('top','show','"+urlstr+"');\"><img src='/imgs/2011/idsearch_btn_login.gif' alt='·Î±×ÀÎ' width='89' height='30' border='0' /></a></td>";
//  htm += "        </tr>";
//  htm += "        </table></td>";
//  htm += "      </tr>";
//  htm += "    </table></td>";
//  htm += "  </tr>";
//  htm += "</table>";

	var layer = document.getElementById('loginlayer');
	layer.style.display='none';
	var layer = document.getElementById('pwfindlayer');
	layer.style.zindex='1000';
	layer.style.position='absolute';
	layer.style.width='405';
	layer.style.height='200';
	layer.style.left='750';
	layer.style.top='28';
	layer.innerHTML = htm;
	layer.style.display='';
}

//¾ÆÀÌµð/ºñ¹Ð¹øÈ£ Ã£±â °á°ú ¼û±â±â
function hidePwResult() {
  var layer = document.getElementById('pwfindlayer');
  layer.innerHTML='';
  layer.display='none';
}

function memType(obj) {
  if(obj.value=='°³ÀÎ') {
    document.getElementById('findname').innerHTML='ÀÌ¸§';
    document.getElementById('findjumin').innerHTML='ÁÖ¹Îµî·Ï¹øÈ£';
  }
  else {
    document.getElementById('findname').innerHTML='´ã´çÀÚÀÌ¸§';
    document.getElementById('findjumin').innerHTML='»ç¾÷ÀÚµî·Ï¹øÈ£';
  }
}

// »ç¾÷ÀÚ µî·ÏÁõ ÇÁ¸°Æ® 
function sa_print() {
  open_saPrint = window.open('/mypage/mypage_sa_print.php','sa_print_pop','width=700,height=580,top=0,left=0,scrollbars=yes,resizable=no,status=no');
}


// Å©°Ôº¸±â
function prev_win(rowid,rown) {
//  prev = window.open('/forms/preview.php?rowid=' + rowid + '&rown=' + rown,'prev','height=500,width=400');
  var prev_link = '/forms/preview.php?rowid=' + rowid + '&rown=' + rown;
  var html  = "";
  html += "<table align='center' border='0' cellspacing='0' cellpadding='0' style='border:2px solid #BDBDBD;background-color:#FFFFFF'>";
  html += "<tr><td align='center'><iframe id='prev_frame' src='"+prev_link+"'frameborder='0'  height='563' scrolling='auto' status='no' resizable='no'></iframe></td></tr>";
  html += "</table>";
  document.getElementById('LL').style.top = document.body.scrollTop;
  document.getElementById('LL').style.width='100%';
  document.getElementById('LL').style.height='100%';
  document.getElementById('LL').innerHTML = html;
}

// ÅØ½ºÆ® ¹Ì¸®º¸±â
function ShowText(rowid,rown) {
  prev = window.open('/forms/showtext.php?rowid='+rowid+'&rown='+rown, 'prevtext', 'left=10,top=10,height=500,width=568,scrollbars=yes');
}

// Å©°Ôº¸±â  - ¹«·áÈ¸¿ø
function preview_win_login() {
  var msg = '';
  msg  = "¹Ì¸®º¸±â´Â Á¤(À¯·á)È¸¿ø¸¸ ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù.\n\n";
  msg += "È®ÀÎÀ» ´©¸£½Ã¸é °áÁ¦ ÆäÀÌÁö·Î ÀÌµ¿ ÇÕ´Ï´Ù.";
  if(confirm(msg)) self.location.replace(extend);
}

// Å©°Ô º¸±â - ·Î±×ÀÎ ¾ÈÇßÀ»¶¼
function preview_win_login_not() {
  var msg = '';
  msg  = "¹Ì¸®º¸±â´Â ·Î±×ÀÎ ÇÏ½Å Á¤(À¯·á)È¸¿ø¸¸ ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù.\n\n";
  msg += "È®ÀÎÀ» ´©¸£½Ã¸é ·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ ÇÕ´Ï´Ù.";
  if(confirm(msg)) self.location.replace(login);
}

function lmsg_no(reurl) {
  if(confirm('·Î±×ÀÎ ÇÏ½Å È¸¿øÁß Á¤È¸¿ø(À¯·áÈ¸¿ø)¸¸ ÀÌ¿ë °¡´É ÇÕ´Ï´Ù.\n\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ ÇÏ½Ã°Ú½À´Ï±î?')) {
    self.location.replace(login);
  }
}

function lmmsg_no(reurl) {
  if(confirm('·Î±×ÀÎ ÇÏ½Å È¸¿ø¸¸ ÀÌ¿ë °¡´É ÇÕ´Ï´Ù.\n\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ ÇÏ½Ã°Ú½À´Ï±î?')) {
    self.location.replace(login);
  }
}

function lumsg_no(reurl) {
  if(confirm('Á¤È¸¿ø(À¯·áÈ¸¿ø)¸¸ ÀÌ¿ë °¡´É ÇÕ´Ï´Ù.\n\n°áÁ¦ ÆäÀÌÁö·Î ÀÌµ¿ ÇÏ½Ã°Ú½À´Ï±î?')) {
    self.location.replace(extend);
  }
}

// ¹«·á È¸¿øÀÌ ±â¾÷Á¤È¸¿ø ÀÚ·á ¼±ÅÃ ÇßÀ»¶§ - ·Î±×ÀÎ ¾ÈÇÑ »óÅÂ
function cmsg_noR(reurl) {
  if(confirm('·Î±×ÀÎ ÇÏ½Å È¸¿øÁß ±â¾÷ Á¤È¸¿ø(À¯·áÈ¸¿ø)¸¸ ÀÌ¿ë °¡´É ÇÕ´Ï´Ù.\n\nÈ¸¿ø°¡ÀÔ ÆäÀÌÁö·Î ÀÌµ¿ ÇÏ½Ã°Ú½À´Ï±î?')) {
    self.location.replace('/member/member_reg.php');
  }
}

// ¹«·á È¸¿øÀÌ ±â¾÷Á¤È¸¿ø ÀÚ·á ¼±ÅÃ ÇßÀ»¶§ - ·Î±×ÀÎ ÇÑ »óÅÂ
function cmsg_noP(reurl) {
  if(confirm('±â¾÷ Á¤È¸¿ø(À¯·áÈ¸¿ø)¸¸ ÀÌ¿ë °¡´É ÇÕ´Ï´Ù.\n\n°áÁ¦ ÆäÀÌÁö·Î ÀÌµ¿ ÇÏ½Ã°Ú½À´Ï±î?')) {
    self.location.replace(extend);
  }
}

function cmsg() {
  alert('±â¾÷ Á¤(À¯·á)È¸¿ø¸¸ ÀÌ¿ë °¡´É ÇÕ´Ï´Ù.');
}


/**
 * ÀÚ·á¹×È¸¿ø µî±Þ¿¡ µû¸¥ »õ·Î¿î ¸Þ½ÃÁö
 *   - GetLinkLimitMsg ¿¡¼­ »ç¿ëµÊ. 
 */
function GetLinkLimitMsg(type,ContentType,Login,Charge,user_type,mode) {
  var msg   = '';
  var gourl = '';
  var user_name = '';
//  var cUser_bmemtype  = getCookie("cUser_bmemtype");
  var mem_status = '';

  if(Login=='yes') {
    if(ChargeType=='basic')        mem_type = 'À¯·áÈ¸¿ø';
    else if(ChargeType=='premium') mem_type = 'ÇÁ¸®¹Ì¾öÈ¸¿ø';
    else                           mem_type = '¹«·áÈ¸¿ø';
  }

  if(Login!='yes') {
    if(type=='content') {
      msg  = "ÀÚ·á¸¦ ÀÌ¿ë ÇÏ½Ã·Á¸é ·Î±×ÀÎÀ» ÇÏ¿©¾ß ÇÕ´Ï´Ù.";
    }
    else if(type=='file' || type=='down') {
      msg  = "ÀÚ·á¸¦ ´Ù¿î·Îµå ¹ÞÀ¸½Ã·Á¸é ·Î±×ÀÎÀ» ÇÏ¿©¾ß ÇÕ´Ï´Ù.";
    }
    else if(type=='tprev') {
      msg = "ÅØ½ºÆ® ¹Ì¸®º¸±â´Â À¯·áÈ¸¿ø¸¸ ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù.\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?";
      if(mode=='msgourl') {
        msg = "ÅØ½ºÆ® ¹Ì¸®º¸±â´Â À¯·áÈ¸¿ø¸¸ ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù.\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ÇÕ´Ï´Ù.";
      }
    }
    else if(type=='iprev') {
      msg = "ÀÌ¹ÌÁö ¹Ì¸®º¸±â´Â À¯·áÈ¸¿ø¸¸ ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù.\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?";
      if(mode=='msgourl') {
        msg = "ÀÌ¹ÌÁö ¹Ì¸®º¸±â´Â À¯·áÈ¸¿ø¸¸ ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù.\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ÇÕ´Ï´Ù.";
      }
    }
    gourl = login;
  }
  else {

    if(type=='content' || type=='tprev' || type=='iprev') {
      msg_middle = "ÄÜÅÙÃ÷";
      msg_end    = "ÀÌ¿ë ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù. ";
    }
    else if(type=='file' || type=='down') {
      msg_middle = "ÀÚ·á";
      msg_end    = "´Ù¿î·Îµå ¹ÞÀ¸½Ç ¼ö ÀÖ½À´Ï´Ù. ";
    }

    if(ContentType=="°³ÀÎÁ¤È¸¿ø") {
      if(Charge!="À¯·á") {
        msg = user_name+' È¸¿ø´ÔÀº ÇöÀç ['+mem_type+'] '+mem_status+'ÀÔ´Ï´Ù.\n\nÀÌ ÀÚ·á´Â [À¯·áÈ¸¿ø] '+msg_middle+'ÀÌ¹Ç·Î [À¯·áÈ¸¿ø]À¸·Î °áÁ¦ÇÏ½Ã¸é  \n\nÁï½Ã '+msg_end;
        gourl = extend;
      }
    }
    else if(ContentType=='±â¾÷Á¤È¸¿ø') {
      if(ChargeType!="premium" && ChargeType!='company') {
        msg = user_name+' È¸¿ø´ÔÀº ÇöÀç ['+mem_type+'] '+mem_status+'ÀÔ´Ï´Ù.\n\nÀÌ ÀÚ·á´Â [VIPÈ¸¿ø] '+msg_middle+'ÀÌ¹Ç·Î [VIPÈ¸¿ø]À¸·Î °áÁ¦ÇÏ½Ã¸é  \n\nÁï½Ã '+msg_end;
        gourl = extend;
      }
    }
  }

  if(mode=='back') {
    alert(msg);
    history.back();
  }
  else if(mode=='confirm') {

    if(Login!='yes') {
      showLogin('', 'show', document.URL);
    }
    else {
      if(confirm(msg)) {
//        hpc.location.replace("http://www.yesform.com/z_n/check/pg_refe_check.php?refe="+document.URL); // °æ·ÎÃ¼Å©¸¦ À§ÇØ¼­
        setTimeout("moveWaitSleep(100)","911");
        if(typeof(parent)=='object') top.location.replace(gourl);
        else {
          self.location.replace(gourl);
        }
      }
    }
  }
  else if(mode=='gourl') {
//    hpc.location.replace("http://www.yesform.com/z_n/check/pg_refe_check.php?refe="+document.URL); // °æ·ÎÃ¼Å©¸¦ À§ÇØ¼­
    setTimeout("moveWaitSleep(100)","911");
    if(typeof(parent)=='object') top.location.replace(gourl);
    else {
      self.location.replace(gourl);
    }
  }
  else if(mode=='msgourl') {
//    hpc.location.replace("http://www.yesform.com/z_n/check/pg_refe_check.php?refe="+document.URL); // °æ·ÎÃ¼Å©¸¦ À§ÇØ¼­
    setTimeout("moveWaitSleep(100)","911");
    if(typeof(parent)=='object') top.location.replace(gourl);
    else {
      self.location.replace(gourl);
    }
    alert(msg);
  }
  else if(mode=='exit') alert(msg);
}

// ¾Æ¹«ÀÛ¾÷µµ ÇÏÁö ¾Ê´Â´Ù.
function moveWaitSleep(t) {};


// ·Î±×ÀÎÀÌ Àß ¾ÈµÇ¼¼¿ä?
function open_login_help () {
}

/**
 * °¡»ó°èÁÂ ¾È³»
 */
function vbankWin(flag) {

  if(flag=="show") {
    H.style.posLeft = event.x - 150;
    H.style.posTop = event.y + document.body.scrollTop - 320;

    html  = "<table width='600' border='0' cellspacing='0' cellpadding='0' style='border:2px solid #BDBDBD;background-color:#FFFFFF'>";
    html += "<tr><td><img src='/imgs/2011/pop_no_top.gif' width='600' height='87' border='0' usemap='#vBankMap' /></td></tr>";
    html += "<tr><td><iframe name='bank_info' src='/member/settlement_bank_iframe.php' frameborder='0' width='100%' height='400px;' scrolling='yes'></iframe></td></tr>";
    html += "</table>";
    html += "<map name='vBankMap'><area shape='rect' coords='570,3,595,29' href='#' onClick='vbankWin();' alt='´Ý±â'></map>";

    H.innerHTML = html;
  }
  else H.innerHTML = '';

}

// ¼­½Ä¹ðÅ© - ÇÏ´Ü
function formbackPopup() {
  var url = "/service/form_bank.html";
  window.open(url, 'dadadoc_formbank', 'width=600; height=650; scrollbars=yes');
}

// Áñ°ÜÃ£±â
function favoriteAdd() {
  window.external.AddFavorite('http://www.dadadoc.com','´Ù´Ù´Ú - ±¹³» ÃÖ´ë ¹®¼­¼­½Ä DB');
}






// ·¹ÀÌ¾î ¹Ì¸®º¸±â
function viewd_t(turl,subject,charge,content,pages,catogory) {

  var html = "";

  html += "<table width='400' border='0' cellspacing='0' cellpadding='0' style='background:#FFFFFF'>";
  html += "<tr><td width='400' style='border:3px solid #d54a4a; padding-left:8px; padding-right:8px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
  html += "<tr><td height='40' class='imglist' style='border-bottom:1px solid #d6d6d6;'>"+subject+"</td></tr>";
  html += "<tr><td style='padding:10px;'><table border='0' cellspacing='0' cellpadding='0'>";
  html += "<tr><td width='113'><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
  html += "<tr><td width='113' height='147' bgcolor='#ececec' ><table border='0' align='center' cellpadding='0' cellspacing='0'>";
  html += "<tr><td width='103' height='137' bgcolor='#FFFFFF' align='center'><img src='"+turl+"' border='0' /></td></tr>";
  html += "</table></td>";
  html += "</tr></table></td>";
  html += "<td width='15'>&nbsp;</td>";
  html += "<td valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
  html += "<tr><td width='45' height='22'>ºÐ &nbsp;   ·ù</td><td width='15'>: </td><td>"+catogory+"</td></tr>"; //ÀÏ¹Ý¿¢¼¿¼­½Ä &gt; ÃÑ¹«/¼­¹«

  if(pages>0) {
    html += "<tr><td height='22'>ºÐ &nbsp; ·®</td><td>:</td><td>"+pages+" ÆäÀÌÁö</td></tr>";
  }

  html += "<tr><td height='22'>µî &nbsp; ±Þ  </td><td>:</td><td>"+charge+"</td></tr>";
  html += "<tr><td height='22' valign='top' >³» &nbsp; ¿ë</td><td valign='top'>:</td><td>"+content+"</td></tr>";
  html += "</table></td></tr>";
  html += "</table></td></tr></table></td>";
  html += "</tr></table>";

  H.innerHTML = html;
}

// Ä«Å×°í¸®ÂÊ¿¡¼­ ¼¶³×ÀÏ ÀÌ¹ÌÁö º¸ÀÌ±â À§ÇØ »ç¿ë.
function viewd_pos(fdta) {
  if(document.body.clientWidth<800 || document.body.clientWidth-event.x<450) {
    H.style.posLeft = event.x + document.body.scrollLeft - 410; 
  }
  else {
    H.style.posLeft = event.x + document.body.scrollLeft +10 ; 
  }
  H.style.posTop = event.y + 13  + document.body.scrollTop;
  //window.status = 'ch:' + document.body.clientHeight + '  /event.y:' + event.y + '  /scrollTop:' + document.body.scrollTop;
  //window.status = event.x + ' / ' + window.screen.width+'*'+window.screen.height + ' / ' + document.body.clientWidth;
  if(typeof(L.innerHTML)=='string') L.innerHTML = ''; // ±â¾÷Àü¿ë¸Þ½ÃÁö ¹Ú½º
  if(typeof(fdta)=="undefined") {
    if(document.body.clientHeight<(event.y+211)) {
      H.style.posTop = event.y + document.body.scrollTop-220;
    }
  }
  else if(fdta=='content') {
    if(document.body.clientHeight<(event.y+100)) {
      H.style.posTop = event.y + document.body.scrollTop-100;
    }
  }
  else {
    if(document.body.clientHeight<(event.y+290)) {
      H.style.posTop = event.y + document.body.scrollTop-300;
    }
  }
}

function msg_hide() {
  H.innerHTML = '';
}
