var mainAddr = "http://www.mizon.co.kr/"
var verionWarning = 0

/*-------------------------------------------------------------------------
   ÀÌ¸ÞÀÏ Ã¼Å©
-------------------------------------------------------------------------*/
function checkemail(stremail) {
   /*
   var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
   var check=/@[\w\-]+\./;
   var checkend=/\.[a-zA-Z]{2,3}$/;

   if(((stremail.search(exclude) != -1)||(stremail.search(check)) == -1)||(stremail.search(checkend) == -1))
       return false;
   else
       return true;
   */

   /*
   var mailexp = /[a-z0-9_]{2,}@[a-z0-9-]{2,}\.[a-z0-9]{2,}/i;
   if(!mailexp.test(stremail)) {
      return false;
   } else {
      return true;
   }
   */
   return true;
}

/*-------------------------------------------------------------------------
   key ÀÔ·ÂÁ¦ÇÑ
-------------------------------------------------------------------------*/
// ¼ýÀÚ¸¸1 ("." Á¦¿Ü)
function kp_onlynumber1() {
   switch(event.keyCode) {
      case 8   : case 9   : case 13  : case 37  : case 38  : case 39  : case 40  : case 46  : // bs, tab, ent, ÁÂ, »ó, ¿ì, ÇÏ, del
      case 48  : case 49  : case 50  : case 51  : case 52  : case 53  : case 54  : case 55  : case 56  : case 57  : // 0-9
      case 96  : case 97  : case 98  : case 99  : case 100 : case 101 : case 102 : case 103 : case 104 : case 105 : // numpad 0-9
      case 109 : case 189 : // numpad -, -
         event.returnValue = true;
         break;
      default :
         event.returnValue = false;
   }
}

// ¼ýÀÚ¸¸2 ("-" "." Æ÷ÇÔ)
function kp_onlynumber2() {
   switch(event.keyCode) {
      case 8   : case 9   : case 13  : case 37  : case 38  : case 39  : case 40  : case 46  : // bs, tab, ent, ÁÂ, »ó, ¿ì, ÇÏ, del
      case 48  : case 49  : case 50  : case 51  : case 52  : case 53  : case 54  : case 55  : case 56  : case 57  : // 0-9
      case 96  : case 97  : case 98  : case 99  : case 100 : case 101 : case 102 : case 103 : case 104 : case 105 : // numpad 0-9
      case 109 : case 110 : case 189 : case 190 : // numpad -, numpad ., -, .
         event.returnValue = true;
         break;
      default :
         event.returnValue = false;
   }
}

// ¼ýÀÚ¸¸3 ("-" "." Á¦¿Ü)
function kp_onlynumber3() {
   switch(event.keyCode) {
      case 8   : case 9   : case 13  : case 37  : case 38  : case 39  : case 40  : case 46  : // bs, tab, ent, ÁÂ, »ó, ¿ì, ÇÏ, del
      case 48  : case 49  : case 50  : case 51  : case 52  : case 53  : case 54  : case 55  : case 56  : case 57  : // 0-9
      case 96  : case 97  : case 98  : case 99  : case 100 : case 101 : case 102 : case 103 : case 104 : case 105 : // numpad 0-9
         event.returnValue = true;
         break;
      default :
         event.returnValue = false;
   }
}

// ¿µ¾î,¼ýÀÚ¸¸4 ("-" "." Á¦¿Ü)
function kp_onlynumber4() {
   switch(event.keyCode) {
      case 8   : case 9   : case 13  : case 37  : case 38  : case 39  : case 40  : case 46  : // bs, tab, ent, ÁÂ, »ó, ¿ì, ÇÏ, del
      case 48  : case 49  : case 50  : case 51  : case 52  : case 53  : case 54  : case 55  : case 56  : case 57  : // 0-9
      case 65  : case 66  : case 67  : case 68  : case 69  : case 70  : case 71  : case 72  : case 73  : // A-I
      case 74  : case 75  : case 76  : case 77  : case 78  : case 79  : case 80  : case 81  : case 82  : // J-R
      case 83  : case 84  : case 85  : case 86  : case 87  : case 88  : case 89  : case 90  : // S-Z
      case 96  : case 97  : case 98  : case 99  : case 100 : case 101 : case 102 : case 103 : case 104 : case 105 : // numpad 0-9
         event.returnValue = true;
         break;
      default :
         event.returnValue = false;
   }
}

// ¼ýÀÚ¸¸ ("-" "." Á¦¿Ü)
// obj : °³Ã¼, empty_chr : ºñ¾úÀ»¶§ ´ëÃ¼°ª, currencyformat : È­Æó´ÜÀ§¿©ºÎ
function out_onlynumber1(obj, empty_chr, currencyformat) {
   if(/[^0123456789]/g.test(obj.value)) {
      alert("¼ýÀÚ°¡ ¾Æ´Õ´Ï´Ù.\n\n0-9ÀÇ Á¤¼ö¸¸ Çã¿ëÇÕ´Ï´Ù.");
      obj.value = empty_chr;
      obj.focus();
   } else
   if(Trim(obj.value) == "") {
      obj.value = empty_chr;
   } else {
      // ¼ýÀÚ¸¦ È­Æó´ÜÀ§·Î Ç¥½ÃÇÑ´Ù.
      if(currencyformat) obj.value = money_format_trans(parseFloat(obj.value));
   }
}

// ¼ýÀÚ¸¸ ("-" "." Æ÷ÇÔ)
// obj : °³Ã¼, empty_chr : ºñ¾úÀ»¶§ ´ëÃ¼°ª, currencyformat : È­Æó´ÜÀ§¿©ºÎ
function out_onlynumber2(obj, empty_chr, currencyformat) {
   if(/[^0123456789.-]/g.test(obj.value)) {
      alert("¼ýÀÚ°¡ ¾Æ´Õ´Ï´Ù.\n\n0-9ÀÇ Á¤¼ö¿Í -¸¸ Çã¿ëÇÕ´Ï´Ù.");
      obj.value = empty_chr;
      obj.focus();
   } else
   if(Trim(obj.value) == "") {
      obj.value = empty_chr;
   } else
   if(Trim(obj.value) == "-") {
      obj.value = empty_chr;
   } else {
      // ¼ýÀÚ¸¦ È­Æó´ÜÀ§·Î Ç¥½ÃÇÑ´Ù.
      if(currencyformat) obj.value = money_format_trans(parseFloat(obj.value));
   }
}

// ¼ýÀÚ¿Í ¿µ¹®¸¸
function out_onlyalpanum(obj) {
   if(/[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/g.test(obj.value)) {
      alert("¿µ¹®°ú ¼ýÀÚ¸¸ Çã¿ëÇÕ´Ï´Ù. ( 0~9, A~Z, a~z )");
      obj.value = "";
      obj.focus();
   }
}

// ÇÑ±Û¸¸ ÀÔ·Â (ÄÁÆ®·Ñ ÀÚÃ¼¸¦ ÀÎÀÚ·Î ³Ñ±è)
function onlykorean(objtext1) {
  var inText = objtext1.value;
  var ret;

  for (var i = 0; i < inText.length; i++) {
    ret = inText.charCodeAt(i);
    if (ret > 31 && ret < 127) {
      alert("ÀÌ¸§Àº ¶ç¾î¾²±â ¾øÀÌ ÇÑ±Û·Î¸¸ ÀÔ·ÂÇÏ¼¼¿ä");
      objtext1.value = "";
      objtext1.focus();
      return false;
    }
  }
  return true;
}

// ",'´Â ÀÔ·Â¹ÞÁö ¾Ê´Â´Ù.
function keylimit() {
   if((event.keyCode == 34) || (event.keyCode == 39))
      event.returnValue = false;
}

// »èÁ¦¸¸
function onlydelete() {
   switch(event.keyCode) {
      case 8   : // backspace
      case 46  : // delete
         event.returnValue = true;
         break;
      default :
         event.returnValue = false;
   }
}

// °ø¹éÀº ¾È¹Þ½À´Ï´Ù.
function nospace() {
   if(event.keyCode == 32) {
//    alert("°ø¹éÀº Çã¿ëµÇÁö ¾Ê½À´Ï´Ù.");
      event.returnValue = false;
   }
}

/*-------------------------------------------------------------------------
   ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
-------------------------------------------------------------------------*/
function residentno_chk(regno1, regno2) {
   no1  = parseInt(regno1.substring(0,1))
   no2  = parseInt(regno1.substring(1,2))
   no3  = parseInt(regno1.substring(2,3))
   no4  = parseInt(regno1.substring(3,4))
   no5  = parseInt(regno1.substring(4,5))
   no6  = parseInt(regno1.substring(5,6))

   no7  = parseInt(regno2.substring(0,1))
   no8  = parseInt(regno2.substring(1,2))
   no9  = parseInt(regno2.substring(2,3))
   no10 = parseInt(regno2.substring(3,4))
   no11 = parseInt(regno2.substring(4,5))
   no12 = parseInt(regno2.substring(5,6))
   no13 = parseInt(regno2.substring(6,7))

   tot = (no1*2)+(no2*3)+(no3*4)+(no4*5)+(no5*6)+(no6*7)+(no7*8)+(no8*9)+(no9*2)+(no10*3)+(no11*4)+(no12*5);
   rst = ""+(11-(tot-(parseInt(""+(tot/11))*11)))

   if(parseInt(rst) >= 10)
      rst = ""+(parseInt(rst)-10)

   if(rst != no13) {
      return false;
   } else {
      return true;
   }
}

/*-------------------------------------------------------------------------
   ¹®ÀÚ¿­ ±æÀÌÁ¦ÇÑ
-------------------------------------------------------------------------*/
// ÀÚ¸´¼öÃ¼Å©¹× ÀÚ¸®¼ö ¸¸Å­ Àß¶ó³½µÚ ÀÔ·Â¶õ¿¡ µÇµ¹¸°´Ù.
function cut_byte(textBox, lengthBox, cutLength) {
   // ±æÀÌ°¡ ¿À¹ö Çß´ÂÁö °Ë»ç.
   if(cal_byte(textBox.value) > parseInt(cutLength.innerText)) {
      textBox.value = cutText(textBox.value, parseInt(cutLength.innerText));
   }

   lengthBox.innerText = cal_byte(textBox.value);
}

// ÀÚ¸´¼ö ¾Ë¾Æ³»±â.
function cal_byte(valueStr) {
   var tmpStr;
   var temp=0;
   var onechar;
   var tcount;

   tcount = 0;
   tmpStr = new String(valueStr);
   temp = tmpStr.length;

   for (k=0;k<temp;k++) {
      onechar = tmpStr.charAt(k);
      if (escape(onechar) =='%0D') { } else if (escape(onechar).length > 4) { tcount += 2; } else { tcount++; }
   }

   return tcount;
}

// ¿øÇÏ´Â ¹®ÀÚ¸¸Å­ Àß¶óÁØ´Ù.
function cutText(valueStr, cutLen) {
   var tmpStr;
   var temp=0;
   var onechar;
   var tcount;

   tcount = 0;
   tmpStr = new String(valueStr);
   temp = tmpStr.length;

   for(k=0;k<temp;k++) {
      onechar = tmpStr.charAt(k);

      if(escape(onechar).length > 4) {
         tcount += 2;
      } else {
         // ¿£ÅÍ°ªÀÌ µé¾î¿ÔÀ»¶§ °ª(\r\n)ÀÌ µÎ¹ø½ÇÇàµÇ´Âµ¥ Ã¹¹øÂ° °ª(\n)ÀÌ µé¾î¿ÔÀ»¶§ tcount¸¦ Áõ°¡½ÃÅ°Áö ¾Ê´Â´Ù.
         if(escape(onechar)=='%0A') {
         } else {
            tcount++;
         }
      }

      if(tcount > cutLen) {
         tmpStr = tmpStr.substring(0,k);
         break;
      }

   }

   return tmpStr;
}

/*-------------------------------------------------------------------------
   ±×¸²ÆÄÀÏÃ¼Å©(È®ÀåÀÚ·Î¸¸ Ã¼Å©)
-------------------------------------------------------------------------*/
function imgcheck(filename) {
   // ±×¸²ÆÄÀÏÀ» Ã¼Å©ÇÑ´Ù.
   if(filename == null)
      return true;
   else
   if(filename.length > 0) {
      switch(filename.toLowerCase().split('.')[(filename.split('.')).length-1]) {
         case "jpg"  :
         case "jpeg" :
         case "gif"  :
            return true;
         default :
            return false;
      }
   } else {
      return true;
   }
}

/*-------------------------------------------------------------------------
   ±×¸²,ÇÃ·¡½ÃÆÄÀÏÃ¼Å©(È®ÀåÀÚ·Î¸¸ Ã¼Å©)
-------------------------------------------------------------------------*/
function imgswfcheck(filename) {
   // ±×¸²,ÇÃ·¡½ÃÆÄÀÏÀ» Ã¼Å©ÇÑ´Ù.
   if(filename == null)
      return true;
   else
   if(filename.length > 0) {
      switch(filename.toLowerCase().split('.')[(filename.split('.')).length-1]) {
         case "jpg"  :
         case "jpeg" :
         case "gif"  :
         case "swf"  :
            return true;
         default :
            return false;
      }
   } else {
      return true;
   }
}

/*-------------------------------------------------------------------------
   ÇÃ·¡½ÃÆÄÀÏÃ¼Å©(È®ÀåÀÚ·Î¸¸ Ã¼Å©)
-------------------------------------------------------------------------*/
function swfcheck(filename) {
   // ÇÃ·¡½ÃÆÄÀÏÀ» Ã¼Å©ÇÑ´Ù.
   if(filename == null)
      return true;
   else
   if(filename.length > 0) {
      switch(filename.toLowerCase().split('.')[(filename.split('.')).length-1]) {
         case "swf"  :
            return true;
         default :
            return false;
      }
   } else {
      return true;
   }
}

/*-------------------------------------------------------------------------
   ÇØ´çÈ®ÀåÀÚÀÎÁö Ã¼Å©ÇÑ´Ù.
-------------------------------------------------------------------------*/
function extcheck(filename, ext) {
   // ±×¸²ÆÄÀÏÀ» Ã¼Å©ÇÑ´Ù.
   if(filename == null)
      return true;
   else
   if(filename.length > 0) {
      if(filename.toLowerCase().split('.')[(filename.split('.')).length-1] == ext) {
         return true;
      } else {
         return false;
      }
   } else {
      return true;
   }
}

/*-------------------------------------------------------------------------
   À±³âÃ¼Å©
-------------------------------------------------------------------------*/
function getdayofmonth(Year, Month) {
   var monarr = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
   var year = Year;
   var month = Month;
   if(month.substring(0,1) == '0') {
      month = month.substring(1,2);
   }

   //À±³âÀÎ°¡¸¦ Ã¼Å©ÇÕ´Ï´Ù.
   if(((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monarr[1] = "29";

   return monarr[month-1];
}

/*-------------------------------------------------------------------------
   Blink ±â´É
-------------------------------------------------------------------------*/
function doBlink() {
   var blink = document.all.tags("BLINK")
   for (var i=0; i < blink.length; i++)
   blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

function startBlink() {  // Make sure it is IE4
   if (document.all)
   setInterval("doBlink()",500)
}

/*-------------------------------------------------------------------------
   °ø¹é ÀÚ¸£±â
-------------------------------------------------------------------------*/
function Trim(Str) {
   var tempStr="";

    // ¾ÕÀÚ¸£±â
   for(i=0; i < Str.length; i++) {
      if(Str.substr(i,1) != " ") {
         tempStr = Str.substr(i, Str.length-i);
         break;
      }
   }

    // µÚÀÚ¸£±â
   for(i=tempStr.length-1; i > 0; i--) {
      if(tempStr.substr(i,1) != " ") {
         tempStr = tempStr.substr(0, i+1);
         break;
      }
   }

   return tempStr;
}

/*-------------------------------------------------------------------------
   ÀÚ¸®¼ö Ã¤¿ì±â(°ª,Ã¤¿ï¹®ÀÚ,°ªÆ÷ÇÔÀÚ¸®¼ö,Ã¤¿ì´ÂÀ§Ä¡-¿ÞÂÊ,¿À¸¥ÂÊ)
-------------------------------------------------------------------------*/
function fillstr(s_str, f_str, tot_cnt, po) {
   if(s_str.length > 0) {
      f_cnt = tot_cnt - s_str.length;

      fill_str = "";
      for(i=0; i<f_cnt; i++)
         fill_str = fill_str + f_str;

      // Æ÷Áö¼Ç¿¡µû¶ó Ã¤¿öÁØ´Ù.
      if(po == 'L') return fill_str + s_str;
      else if(po == 'R') return s_str + fill_str;
      else return s_str;
   } else {
      return "";
   }
}

/*-------------------------------------------------------------------------
   str2¸¦ ¿øÇÏ´Â È½¼ö¸¸Å­ str1ÀÇ ÁÂ,¿ìÃøÀ¸·Î ºÙÀÎ´Ù.
-------------------------------------------------------------------------*/
function fillrepeat(str1, str2, alignment, cnt) {
   var pstr = "";

   if(parseInt(cnt) > 0) {
      for(ii=0; ii<parseInt(cnt); ii++) {
         pstr = pstr + str2;
      }

      switch(alignment) {
         case "Left" :
            return pstr + str1;
            break;
         case "Right" :
            return str1 + pstr;
            break;
      }
   }

   return "";
}

/*-------------------------------------------------------------------------
   Áñ°ÜÃ£±â
-------------------------------------------------------------------------*/
function addfavorite() {
   if(document.all)
      window.external.AddFavorite("http://www.mizon.co.kr/", "¿¬±¸¿øÀÌ Á÷Á¢ ¸¸µç È­ÀåÇ° ¹ÌÁî¿Â");
}

/*-------------------------------------------------------------------------
   ±Ý¾×Ç¥½Ã(*,000)
-------------------------------------------------------------------------*/
function money_format_trans(price) {
   var minus       = false; // À½¼ö¿©ºÎ
   var decimal     = "";    // ¼Ò¼öÁ¡ÀÌÇÏ
   var resultprice = "";    // ¸®ÅÏ ¹®ÀÚ¿­
   var cnt         = 0;

   // ¸¶ÀÌ³Ê½º ºÎÈ£ ÀÏ´Ü»©±â.
   if(parseInt(price) < 0) {
      minus = true;
      price = parseInt(price) * -1;
   }

   price = price + "";

   // ¼Ò¼öÁ¡ Àß¶ó³»±â
   if(price.indexOf(".") > 0) {
      decimal = Trim(price.split(".")[1]);
      price   = Trim(price.split(".")[0]);
   }

   i = price.length;
   if(price.length > 0) {
      while(i > 0) {
         if(price.substr((i-1),1) != ",") {
            if(cnt == 3) {
               resultprice = "," + resultprice;
               cnt = 0;
            } else {
               resultprice = price.substr((i-1),1) + resultprice;
               cnt++;
               i--;
            }
         } else {
           i--;
         }
      }
   }

   // ¸¶ÀÌ³Ê¸é À½¼ö¸¦ Ç¥½ÃÇÑ´Ù.
   if(minus == true) {
      resultprice = "-" + resultprice;
   }

   // ¼Ò¼ýÁ¡ ºÙÀÌ±â.
   if(decimal != "") {
      resultprice = resultprice + "." + decimal;
   }

   return resultprice;
}

// ,¸¦ ¾ø¾Ø °ªÀ» °³Ã¼¿¡ ³Ö¾îÁØ´Ù.
function recovery_format(ctl) {
   var resultprice = "";

   for(i=0; i<ctl.value.length; i++) {
      if(ctl.value.substr(i,1) != ",") {
         resultprice = resultprice + ctl.value.substr(i,1);
      }
   }

   ctl.value = resultprice;
}

// ,¸¦ ¾ø¾Ø °ªÀ» ³Ñ°ÜÁØ´Ù.
function recovery_format2(ctl) {
   var resultprice = "";

   for(i=0; i<ctl.value.length; i++) {
      if(ctl.value.substr(i,1) != ",") {
         resultprice = resultprice + ctl.value.substr(i,1);
      }
   }

   return resultprice;
}

/*-------------------------------------------------------------------------
   ±âÅ¸
-------------------------------------------------------------------------*/
// ¿ìÆí¹øÈ£ °Ë»ö.
function openzipcode(zipcode1, zipcode2, address1, address2, url, width, height) {
   if(typeof(width)  == "undefined") width  = "530px";
   if(typeof(height) == "undefined") height = "360px";

   var rtn_value = unescape(showModalDialog(mainAddr + url + "?zipcode1=" + zipcode1 +
                                                             "&zipcode2=" + zipcode2 +
                                                             "&address1=" + address1 +
                                                             "&address2=" + address2,
                                            "zipcode",
                                            "resizable:0; help:0; status:0; scroll:0; dialogWidth:" + width + "; dialogHeight:" + height + ";"));

   // ÁÖ¼Ò°ª Àß¶ó¼­ »Ñ·ÁÁÖ±â.
   var zipctl;
   if(rtn_value != "undefined") {
      zipctl = eval(zipcode1);
      zipctl.value = rtn_value.split("^^")[0].split("|")[0].split("-")[0];
      zipctl = eval(zipcode2);
      zipctl.value = rtn_value.split("^^")[0].split("|")[0].split("-")[1];
      zipctl = eval(address1);
      zipctl.value = rtn_value.split("^^")[0].split("|")[1];
      zipctl = eval(address2);
      if(Trim(rtn_value.split("^^")[1]) != "") zipctl.value = rtn_value.split("^^")[1];
      zipctl.focus();
   }
}

function popzipcode(zipctl1, zipctl2, addrctl1, addrctl2, url) {
   var pleft = parseInt(screen.availWidth/2)  - parseInt(440/2);
   var ptop  = parseInt(screen.availHeight/2) - parseInt(545/2);

   open(mainAddr + url + "?zipctl1=" + zipctl1 + "&zipctl2=" + zipctl2 + "&addrctl1=" + addrctl1 + "&addrctl2=" + addrctl2, "pop_zipcode", "width=440, height=545, left=" + pleft + ", top=" + ptop);
}

function popzipcode2(zipctl1, zipctl2, addrctl1, addrctl2, url) {
   var pleft = parseInt(screen.availWidth/2)  - parseInt(440/2);
   var ptop  = parseInt(screen.availHeight/2) - parseInt(545/2);

   open(url + "?zipctl1=" + zipctl1 + "&zipctl2=" + zipctl2 + "&addrctl1=" + addrctl1 + "&addrctl2=" + addrctl2, "pop_zipcode", "width=440, height=545, left=" + pleft + ", top=" + ptop);
}

// ÄíÅ°»ý¼º
function setCookie(name, value, expires, path, domain, secure) {
    var todayDate = new Date();

    document.cookie = name + '=' + escape(value) + ';'
                    + ((expires) ? ' expires=' + todayDate.setDate(todayDate.getDate() + expires) + ';' : '')
                    + ((path) ? ' path=' + path + ';' : '')
                    + ((domain) ? ' domain=' + domain + ';' : '')
                    + ((secure) ? ' secure' + ';' : '');
}

// ÄíÅ°»ý¼º
function setCookie2(name, value, expiredays, domain) {
    var todayDate = new Date();
    todayDate.setDate(todayDate.getDate() + expiredays);
    document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";domain=" + domain + ";"
}

/*-------------------------------------------------------------------------
   °Ô½Ã¹° µ¹¸®±â
-------------------------------------------------------------------------*/
function moveValueTOindex(what){
   var MyIndex = 0;
   for(var i = 0; i < thisPageMoveObject.length; i++) {
      if(thisPageMoveObject[i] == what) {
         MyIndex = i;
      }
   }
   return MyIndex;
}

function Random_start() {
   var len = this.text.length;
   if(len <= this.show_items) {
      this.show_items = len;
   }
   if(this.only_one == 1) {
      for (i=0; i<len; ) {
         rand = parseInt(Math.random() * len);
         len2 = this.random_val.length;

         for (j=0; j<len2 ; j++) {
            if(this.random_val[j] == rand) break;
         }
         if(j == len2) {
            this.random_val[i] = rand;
            i++;
         }
      }
      this.only_one=2;
   }
}

function Sequence_start() {
   for (i=0; i<this.text.length; i++) {
      this.random_val[i] = i;
   }
}

// µ¿ÀÛ ½ÃÀÛ ÇÔ¼ö
function Move_up_start(whatIndex){
   var what = thisPageMoveObject[whatIndex];

   if(what.text.length > what.show_items) {
      for(var i=0; i<=what.show_items; i++) {
         setTimeout("Move_up("+i+", "+what.sheight+","+whatIndex+")", what.stop_time);
      }
   }
}

// ¾ÆÀÌÅÛ °³º° ÀÌµ¿ ÇÔ¼ö
function Move_up(id, cnt, whatIndex) {
   var what = thisPageMoveObject[whatIndex];
   var obj = eval(what.boxID+id);
   obj.style.pixelTop -= what.sstep;
   cnt -= what.sstep;
   if(cnt > 0) {
      setTimeout("Move_up("+id+", "+cnt+","+whatIndex+")", what.sspeed);
   }
   else if(obj.style.pixelTop < -what.sstep) {
      obj.style.pixelTop = what.show_items * what.sheight;
      what.new_item++;
      if(what.new_item == what.text.length) what.new_item=0;
      obj.innerHTML=what.text[what.random_val[what.new_item]];
      Move_up_start(whatIndex);
   }
}

function MoveUpWriter() {
   var thisObjectIndex = moveValueTOindex(this);
   document.writeln('<div align="left" onmouseover="thisPageMoveObject[' + thisObjectIndex + '].sstep=0;" onmouseout="thisPageMoveObject[' + thisObjectIndex + '].sstep=' + this.sstep_tmp + ';" style="position:absolute; width:' + (this.swidth) + '; height:' + (this.sheight * this.show_items) + '; clip:rect(0 ' + (this.swidth) + ' ' + (this.sheight * this.show_items) + ' 0);">');
   var tleft = 0;
   for(var i=0; i <= this.show_items; i++) {
      if(i > 0) {
         tleft += eval(this.boxID + (i-1) + '.style.pixelWidth');
      }
      document.writeln('<div align="left" id="'+this.boxID+i+'" style="position:absolute; left:1; width:'+(this.swidth)+'; top:'+(i * this.sheight)+';">');
      document.write(this.text[this.random_val[i]]);
      document.writeln('</div>');
   }
   document.writeln('</div>');
}

function movoLayerDefalutObj() {
   this.text = new Array();
   this.otherInfo = new Array();
   this.random_val = new Array();
   this.boxID = "";

   this.swidth = 0; // °³º° ¾ÆÀÌÅÛÀÇ ³ÐÀÌ
   this.sheight = 0; // °³º° ¾ÆÀÌÅÛÀÇ ³ôÀÌ
   this.show_items = 1; // ¾ÆÀÌÅÛ °³¼ö

   this.stop_time = 2000; // ¾ÆÀÌÅÛ µ¿ÀÛ ÅÒ (1ÃÊ = 1000)
   this.sspeed = 0; // ¾ÆÀÌÅÛÀÌ ¿òÁ÷ÀÌ´Â ½Ã°£
   this.sstep = 1; // ¾ÆÀÌÅÛÀÌ ÇÈ¼¿ ÀÌµ¿ °£°Ý

   // ³»ºÎ º¯¼ö
   this.new_item = this.show_items;
   this.sstep_tmp = this.sstep;
   this.only_one = 1;
   this.Random_start = Random_start;
   this.Sequence_start = Sequence_start;
   this.MoveUpWriter = MoveUpWriter;
}

/*-------------------------------------------------------------------------
   ÆÄÀÏ»çÀÌÁî¸¦ ¾Ë¾Æ³½´Ù.(¾÷·ÎµåÀü ¿ë·®À» Ã¼Å©ÇØ¼­ °í¿ë·® ¾÷·Îµå ¹æÁö)
-------------------------------------------------------------------------*/
function filesizeForm(obj) {
   var objectsize = 0;

   // 7.0 ¹öÁ¯Àº dynsrc°¡ Áö¿øµÇÁö ¾Ê´Â´Ù.
   if((navigator.appVersion.indexOf('MSIE 7') > -1) || (navigator.appVersion.indexOf('MSIE 8') > -1)) {
      try {
         var fso = new ActiveXObject("Scripting.FileSystemObject");
         var f = fso.GetFile(obj.value);
         objectsize = f.size;
         f = null;
         fso = null;
      } catch (e) {
         //alert(e.message);
         // 1È¸°æ°íÈÄ ´Ù½Ã °æ°í ¾Èº¸¿©ÁÖ±â. ´Ü, ÆäÀÌÁö º¯°æ½Ã ´Ù½Ã º¸¿©ÁØ´Ù.
         if(verionWarning == 0) {
            //alert("ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯ 7.0 ¿¡¼­´Â Ã·ºÎÆÄÀÏÀÇ ¿ë·®ÀÌ Á¤»óÀûÀ¸·Î Ã¼Å©°¡ µÇÁö¾Ê½À´Ï´Ù.\n\nÃß°¡ÇÏ½Ã´Â Ã·ºÎÆÄÀÏÀº ÃÖ´ë 2M ¹ÙÀÌÆ®¸¦ ³ÑÁö¾Ê°Ô ÇØÁÖ½Ã±æ ¹Ù¶ø´Ï´Ù.");
            verionWarning++;
         }
      }
   } else {
      var oFile = document.createElement("img");

      oFile.dynsrc = obj.value;    // °³Ã¼¸¦ ¿Å±ä´Ù.
      objectsize = oFile.fileSize; // ¿ë·®º¸±â.
      oFile = null;                // ¿ë·®À» ¾Ë¾Æ³»°í ¹Ù·Î ¾ø¾Ø´Ù.
   }

   return objectsize; // ¾Ë¾Æ³½ ¿ë·®À» º¸³½´Ù.
}

// ÆÄÀÏ»çÀÌÁî¸¦ º¸¿©ÁØ´Ù.
function viewSize(target, obj, obj2) {
   var size;
   var displayArea = eval(target);

   size = filesizeForm(obj);
   displayArea.innerText = money_format_trans(parseInt(parseInt(size) / 1024));

   if(! ((obj2 == "undefined") || (obj2 == null))) obj2.value = parseInt(parseInt(size) / 1024);
}

/*-------------------------------------------------------------------------
   ESC Å°¸¦ ´©¸£¸é Ã¢À» ´Ý´Â´Ù.
-------------------------------------------------------------------------*/
function dialogCloseOnEsc() {
   if(event.keyCode == 27) {
      window.returnValue = "";
      self.close();
   }
}

function closeOnEsc() {
   if(event.keyCode == 27) {
      self.close();
   }
}

/*-------------------------------------------------------------------------
   ÀÌ¹ÌÁö È®´ë º¸±â
-------------------------------------------------------------------------*/
function openimg(image) {
   var pleft = parseInt(screen.availWidth/2)  - parseInt(800/2);
   var ptop  = parseInt(screen.availHeight/2) - parseInt(600/2);

   open("/_inc/_zoom.asp?image=" + escape(image), "zoom", "fullscreen=0, width=800, height=600, scrollbars=1, resizable=1, left=" + pleft + ", top=" + ptop);
   //open("/_inc/_zoom.asp?image=" + escape(image), "zoom", "fullscreen=1, scrollbars=1, resizable=1");
}

// ÀÌ¹ÌÁö »çÀÌÁî ¾Ë¾Æ³»±â...
function imgSize(obj) {
   var objWidth = 0, objHeight = 0;
   var oFile = document.createElement("img");

   oFile.src = obj;
   objWidth  = oFile.width;
   objHeight = oFile.height;

   oFile = null;

   return objWidth + "," + objHeight;
}

// ÀÌ¹ÌÁö Á¤ÇØÁø ¿µ¿ª¿¡ Á¤ÇØÁø »çÀÌÁî·Î º¸¿©ÁÖ±â...
// (ÀÌ¹ÌÁö »ðÀÔÇÒ ·¹ÀÌ¾î, ÆÄÀÏ°æ·Î, ÃÖ´ë°¡·Î »çÀÌÁî, ÃÖ´ë¼¼·Î »çÀÌÁî)
function viewimg(target, fileValue, maxwidth, maxheight) {
   var tmp_width = 0, tmp_height = 0;

   if(navigator.appVersion.indexOf('MSIE 7') > -1) {
      if((fileValue == "") || (! imgcheck(fileValue))) {
         // ±×¸²°ªÀÌ ºñ¾ú°Å³ª ±×¸²ÆÄÀÏÀÌ ¾Æ´Ï¸é...
         target.innerHTML = "<img src='/_admin_page/images/logo_mizon.gif'>";
      } else {
         target.innerHTML = '<a href="javascript:alert(11);" onclick="openimg(this.src);"><img src="' + fileValue + '" style="cursor:hand;" onerror="this.src=\'/_admin_page/images/logo_mizon.gif\';" border="0"></a>';
      }
   } else {
      if((fileValue == "") || (! imgcheck(fileValue))) {
         // ±×¸²°ªÀÌ ºñ¾ú°Å³ª ±×¸²ÆÄÀÏÀÌ ¾Æ´Ï¸é...
         target.innerHTML = "<img src='/_admin_page/images/logo_mizon.gif'>";
      } else {
         var size = imgSize(fileValue).split(',');

         tmp_width  = size[0]
         tmp_height = size[1]

         if(parseInt(size[0]) > parseInt(size[1])) {
            if(parseInt(size[0]) > maxwidth) {
               tmp_width  = maxwidth
               tmp_height = parseInt(maxwidth * (parseInt(size[1]) / parseInt(size[0])))
            }
         } else {
            if(parseInt(size[1]) > maxheight) {
               tmp_width  = parseInt(maxheight * (parseInt(size[0]) / parseInt(size[1])))
               tmp_height = maxheight
            }
         }

         target.innerHTML = '<img src="' + fileValue + '" onclick="openimg(this.src);" width="' + tmp_width + '" height="' + tmp_height + '" onclick="openimg(this.src);" style="cursor:hand;" onerror="this.src=\'/_admin_page/images/logo_mizon.gif\';">';
      }
   }
}

function viewimg2(imgObj, maxwidth, maxheight) {
   var size = imgSize(imgObj.src).split(',');

   maxwidth  = parseInt(maxwidth);
   maxheight = parseInt(maxheight);
   size[0]   = parseInt(size[0]);
   size[1]   = parseInt(size[1]);

   if(size[0] > size[1]) {
      if(size[0] > maxwidth) {
         imgObj.width = maxwidth;
      } else {
         imgObj.width = size[0];
      }
   } else {
      if(size[1] > maxheight) {
         imgObj.height = maxheight;
      } else {
         imgObj.height = size[1];
      }
   }
}

/*-------------------------------------------------------------------------
   ³»¿ëº¹»ç
-------------------------------------------------------------------------*/
function copyContents(contents) {
   window.clipboardData.setData("Text", contents);
   alert("º¹»çµÇ¾ú½À´Ï´Ù.\n\n°Ô½ÃÆÇ ¶Ç´Â ¸Þ¸ðÀåµî¿¡ CTRL+V·Î ºÙ¿©³ÖÀ» ¼ö ÀÖ½À´Ï´Ù.");
}

/*-------------------------------------------------------------------------
   ´Þ·Â...
-------------------------------------------------------------------------*/
function openCalendar(ctl) {
   var rtn_value = showModalDialog("/_inc/_calendar.asp", "calendar", "resizable:0; help:0; status:0; scroll:0; dialogWidth:450px; dialogHeight:230px;");

   if(rtn_value) {
      ctl.value = rtn_value;
   }
}

/*-------------------------------------------------------------------------
   Å×ÀÌºí ¶óÀÎ ¹è°æ¹Ù²Ù±â...
-------------------------------------------------------------------------*/
// ¹è°æ»ö ¹Ù²Ù±â...
function bg_change(line_name, color) {
   var line = eval(line_name);

   if((typeof(line) == "object") && (typeof(line.length) == "undefined")) {
      line.bgColor = color;
   } else {
      for(var i=0; i<line.length; i++) {
         line[i].bgColor = color;
      }
   }
}

/*-------------------------------------------------------------------------
   µ¥ÀÌÅÍ Á¤·Ä. (¾÷/´Ù¿î)
-------------------------------------------------------------------------*/
// ÀÚ¸® ¹Ù²Û´Ù.
function change_data(sort_ctl, selidx, p_m) {
   // ³»¿ëÀ» ¹Ù²Û´Ù.
   tmp_value = sort_ctl.options[selidx + p_m].value;
   tmp_text = sort_ctl.options[selidx + p_m].text;

   sort_ctl.options[selidx + p_m].value = sort_ctl.options[selidx].value;
   sort_ctl.options[selidx + p_m].text  = sort_ctl.options[selidx].text;

   sort_ctl.options[selidx].value = tmp_value;
   sort_ctl.options[selidx].text  = tmp_text;

   // ¹ÙÅÁ ¹× ±ÛÀÚ»öÀ» ¹Ù²Û´Ù.
   tmp_bg = sort_ctl.options[selidx + p_m].style.background;
   tmp_color = sort_ctl.options[selidx + p_m].style.color

   sort_ctl.options[selidx + p_m].style.background = sort_ctl.options[selidx].style.background;
   sort_ctl.options[selidx + p_m].style.color = sort_ctl.options[selidx].style.color;

   sort_ctl.options[selidx].style.background = tmp_bg;
   sort_ctl.options[selidx].style.color = tmp_color;
}

// ¸ÇÀ§·Î
function sort_t(sort_ctl) {
   var tmp_value="", tmp_text="", tmp_color="", tmp_bg="";

   if(sort_ctl.options.length > 0) {
      if(sort_ctl.selectedIndex == 0) {
         alert("¸Ç À§ ÀÔ´Ï´Ù.");
         sort_ctl.options[0].selected = true;
      } else {
         for(var cnt=sort_ctl.selectedIndex; cnt > 0; cnt--) {
            change_data(sort_ctl, cnt, -1);

            // Æ÷Ä¿½º¸¦ ¸ÂÃá´Ù.
            sort_ctl.options[0].selected = true;
         }
      }
   } else {
      alert("´õÀÌ»ó ¾ø½À´Ï´Ù.");
   }
}

// À§·Î
function sort_u(sort_ctl, mcnt) {
   var tmp_value="", tmp_text="", tmp_color="", tmp_bg="";

   if(typeof(mcnt) == "undefined") mcnt = 1

   if(sort_ctl.options.length > 0) {
      if(sort_ctl.selectedIndex == 0) {
         alert("¸Ç À§ ÀÔ´Ï´Ù.");
         sort_ctl.options[0].selected = true;
      } else {
         for(var cnt=0; cnt < mcnt; cnt++) {
            if(sort_ctl.selectedIndex == 0) {
               break;
            } else {
               change_data(sort_ctl, sort_ctl.selectedIndex, -1);
            }
            // Æ÷Ä¿½º¸¦ ¸ÂÃá´Ù.
            sort_ctl.options[sort_ctl.selectedIndex-1].selected = true;
         }
      }
   } else {
      alert("´õÀÌ»ó ¾ø½À´Ï´Ù.");
   }
}

// ¾Æ·¡·Î
function sort_d(sort_ctl, mcnt) {
   var tmp_value="", tmp_text="", tmp_color="", tmp_bg="";

   if(typeof(mcnt) == "undefined") mcnt = 1

   if(sort_ctl.options.length > 0) {
      if(sort_ctl.selectedIndex == (sort_ctl.options.length - 1)) {
         alert("¸Ç ¾Æ·¡ ÀÔ´Ï´Ù.");
         sort_ctl.options[sort_ctl.options.length-1].selected = true;
      } else {
         for(var cnt=0; cnt < mcnt; cnt++) {
            if(sort_ctl.selectedIndex == sort_ctl.options.length-1) {
               break;
            } else {
               change_data(sort_ctl, sort_ctl.selectedIndex, 1);
            }
            // Æ÷Ä¿½º¸¦ ¸ÂÃá´Ù.
            sort_ctl.options[sort_ctl.selectedIndex+1].selected = true;
         }
      }
   } else {
      alert("´õÀÌ»ó ¾ø½À´Ï´Ù.");
   }
}

// ¸Ç¾Æ·¡·Î
function sort_b(sort_ctl) {
   var tmp_value="", tmp_text="", tmp_color="", tmp_bg="";

   if(sort_ctl.options.length > 0) {
      if(sort_ctl.selectedIndex == (sort_ctl.options.length - 1)) {
         alert("¸Ç ¾Æ·¡ ÀÔ´Ï´Ù.");
         sort_ctl.options[sort_ctl.options.length-1].selected = true;
      } else {
         for(var cnt=sort_ctl.selectedIndex; cnt < sort_ctl.options.length-1; cnt++) {
            change_data(sort_ctl, cnt, 1);

            // Æ÷Ä¿½º¸¦ ¸ÂÃá´Ù.
            sort_ctl.options[sort_ctl.options.length-1].selected = true;
         }
      }
   } else {
      alert("´õÀÌ»ó ¾ø½À´Ï´Ù.");
   }
}

/*-------------------------------------------------------------------------
   ¾ÆÀÌµð, ºñ¹Ð¹øÈ£ Ã£±â
-------------------------------------------------------------------------*/
function search_proc(search_type) {
   var pleft = parseInt(screen.availWidth/2)  - parseInt(450/2);
   var ptop  = parseInt(screen.availHeight/2) - parseInt(360/2);

   open("/login/id_pw_search.asp?search_type=" + search_type, "search_idpw", "width=450px, height=360px, left=" + pleft + ", top=" + ptop);
}

/*-------------------------------------------------------------------------
   ÀÌ´Ï½Ã½º,µ¥ÀÌÄÞ Ä«µå°áÁ¦/Çö±Ý¿µ¼öÁõ °ü·Ã ¿µ¼öÁõº¸±â
-------------------------------------------------------------------------*/
function receipt(tid) {
   var pleft = parseInt(screen.availWidth/2)  - parseInt(430/2);
   var ptop  = parseInt(screen.availHeight/2) - parseInt(700/2);

   if(tid.substring(0,3) == "INI") {
      // ÀÌ´Ï½Ã½º ¿µ¼öÁõ
      var receiptUrl = "https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid=" + tid + "&noMethod=1";
   } else {
      // LG µ¥ÀÌÄÞ ¿µ¼öÁõ
      var receiptUrl = "https://pgweb.dacom.net/MpFlowCtrl?eventDiv1=search&eventDiv2=getReceipt&TRANSACTIONID=" + tid + "&SYSTEM=NEW";
   }
   window.open(receiptUrl, "receipt", "width=430, height=700, scrollbars=yes, resizable=yes, left=" + pleft + ",top=" + ptop);
}

function receipt_cash(ord_info_num, servicetype) {
   var pleft = parseInt(screen.availWidth/2)  - parseInt(430/2);
   var ptop  = parseInt(screen.availHeight/2) - parseInt(700/2);

   window.open("http://pg.dacom.net/transfer/cashreceipt.jsp?orderid=" + ord_info_num + "&mid=mizon&servicetype=" + servicetype, "receipt", "width=430, height=700, scrollbars=yes, resizable=yes, left=" + pleft + ",top=" + ptop);
}

function receipt4(ord_payment, ord_tid) {
   var pleft = parseInt(screen.availWidth/2)  - parseInt(850/2);
   var ptop  = parseInt(screen.availHeight/2) - parseInt(700/2);

   switch(ord_payment) {
      case "2" : var receiptUrl = "https://pgweb.dacom.net/MpFlowCtrl?service=card&eventDiv1=search&eventDiv2=getCardDetailMert&TRANSACTIONID=" + ord_tid; break;
      case "4" : var receiptUrl = "https://pgweb.dacom.net/MpFlowCtrl?service=bank&eventDiv1=search&eventDiv2=bankDetailMert&TRANSACTIONID=" + ord_tid; break;
      case "5" : var receiptUrl = "https://pgweb.dacom.net/MpFlowCtrl?service=cas&eventDiv1=search&eventDiv2=getTrxDetail&TRANSACTIONID=" + ord_tid; break;
      case "6" : var receiptUrl = "https://pgweb.dacom.net/MpFlowCtrl?service=wireless&eventDiv1=search&eventDiv2=getWirelessDetail&TRANSACTIONID=" + ord_tid; break;
      default  : break;
   }

   window.open(receiptUrl, "receipt3", "width=850, height=700, scrollbars=yes, resizable=yes, left=" + pleft + ",top=" + ptop);
}

/*-------------------------------------------------------------------------
   ¿µ¼öÁõ ¹Þ±â
-------------------------------------------------------------------------*/
function receipt2(ord_info_num) {
   var pleft = parseInt(screen.availWidth/2)  - parseInt(660/2);
   var ptop  = parseInt(screen.availHeight/2) - parseInt(700/2);

   var receiptUrl = "/mypage/mypage_receipt.asp?ord_info_num=" + ord_info_num;
   window.open(receiptUrl, "receipt", "width=660, height=700, scrollbars=yes, resizable=yes, left=" + pleft + ",top=" + ptop);
}

/*-------------------------------------------------------------------------
   ÁÖ¹®³»¿ª ÇÁ¸°Æ® ÇÏ±â...
-------------------------------------------------------------------------*/
function order_print(ord_info_num) {
   var pleft = parseInt(screen.availWidth/2)  - parseInt(700/2);
   var ptop  = parseInt(screen.availHeight/2) - parseInt(700/2);
   open("order_print.asp?ord_info_num=" + ord_info_num, "order_print", "width=700, height=700, scrollbars=1, left=" + pleft + ", top=" + ptop);
}

/*-------------------------------------------------------------------------
   ÁÖ¹®³»¿ª(°í°´¿ë) ÇÁ¸°Æ® ÇÏ±â...
-------------------------------------------------------------------------*/
function order_print_customer(ord_info_num) {
   var pleft = parseInt(screen.availWidth/2)  - parseInt(700/2);
   var ptop  = parseInt(screen.availHeight/2) - parseInt(700/2);
   open("order_print_customer.asp?ord_info_num=" + ord_info_num, "order_print", "width=800, height=700, scrollbars=1, left=" + pleft + ", top=" + ptop);
}

/*-------------------------------------------------------------------------
   °èÁÂ...
-------------------------------------------------------------------------*/
function account(bankname) {
   switch(bankname) {
      case "±â¾÷ÀºÇà" : open("http://www.ibk.co.kr/", "bank"); break;
      case "±¹¹ÎÀºÇà" : open("http://www.kbstar.com/", "bank"); break;
      case "¿ÜÈ¯ÀºÇà" : open("http://www.keb.co.kr/", "bank"); break;
      case "¿ì¸®ÀºÇà" : open("http://www.wooribank.com/", "bank"); break;
      case "¿ìÃ¼±¹"   : open("http://www.epostbank.go.kr/", "bank"); break;
      case "ÇÏ³ªÀºÇà" : open("http://www.hanabank.com/", "bank"); break;
      case "³óÇù"     : open("http://banking.nonghyup.com/", "bank"); break;
      case "½ÅÇÑÀºÇà" : open("http://www.shinhanbank.com/", "bank"); break;
      case "Á¦ÀÏÀºÇà" : open("http://www.scfirstbank.com/", "bank"); break;
   }
}

/*-------------------------------------------------------------------------
   ÅÃ¹è»ç...
-------------------------------------------------------------------------*/
function delivery(company, invoice_num) {
   switch(company) {
      case "·ÎÁ¨ÅÃ¹è"   : open("https://www.ilogen.com/iLOGEN.Web/TRACE/TraceView.aspx?gubun=slipno&id=&slipno=" + invoice_num, "tracking", "width=800, height=500, scrollbars=1"); break;
      case "³×µ¦½ºÅÃ¹è" : open("http://tracking.nedex.co.kr:8080/jsp/tr/detailSheet.jsp?iSheetNo=" + invoice_num, "tracking", "width=800, height=500"); break;
      case "ÇÑÁøÅÃ¹è"   : open("http://tracking.nedex.co.kr:8080/jsp/tr/detailSheet.jsp?iSheetNo=" + invoice_num, "tracking", "width=800, height=500"); break;
      case "¿ìÃ¼±¹ÅÃ¹è" : open("http://service.epost.go.kr/trace.RetrieveRegiPrclDeliv.postal?sid1=" + invoice_num, "tracking"); break;
      case "Çö´ëÅÃ¹è"   : open("/_inc/_tracking.asp?invoice_num=" + invoice_num + "&url=" + escape("https://www.hlc.co.kr/hydex/html/tracking/hlc/tracing.html"), "tracking", "width=600, height=600"); break;
   }
}

/*-------------------------------------------------------------------------
   °Ô½Ã¹° ÆîÄ¡±â
-------------------------------------------------------------------------*/
var old_line = null;

function detail_view(ctl, tbl_nm, col_nm, col_cd, col_vu, ctl_fo) {
   if(typeof(tbl_nm) != "undefined") {
      // Á¶È¸È½¼ö ¿Ã¸®±â
      //if(old_line != ctl) ifrm_proc.location.href = "/_inc/_count.asp?tbl_nm=" + tbl_nm + "&col_nm=" + col_nm + "&col_cd=" + col_cd + "&col_vu=" + col_vu;
   }

   if(old_line != null) old_line.style.display = "none";

   if(old_line != ctl) {
      ctl.style.display = "block";
      old_line = ctl;

      if(typeof(ctl_fo) != "undefined") {
         location.href = "#" + ctl_fo;
      } else
      if(typeof(col_vu) != "undefined") {
         location.href = "#" + col_vu;
      }
   } else {
      ctl.style.display = "none";
      old_line = null;
   }
}

/*-------------------------------------------------------------------------
   ÀüÈ­¹øÈ£ È°¼ºÈ­ ¿©ºÎ
-------------------------------------------------------------------------*/
function tel_state(ctl1, ctl2, ctl3) {
   if(Trim(ctl1.value) == "000") {
      ctl2.value = "0000";
      ctl2.readOnly = true;
      ctl2.style.background = "#efefef";

      ctl3.value = "0000";
      ctl3.readOnly = true;
      ctl3.style.background = "#efefef";
   } else {
      if(ctl2.value == "0000") ctl2.value = "";
      ctl2.readOnly = false;
      ctl2.style.background = "#ffffff";

      if(ctl3.value == "0000") ctl3.value = "";
      ctl3.readOnly = false;
      ctl3.style.background = "#ffffff";

      ctl2.focus();
   }
}

/*-------------------------------------------------------------------------
   ÇÃ·¡½Ã...
-------------------------------------------------------------------------*/
function getflashobject(flashSrc, objWidth, objHeight, etcParam) {
   var tag = "";
   var baseFlashDir="";
   flashSrc = baseFlashDir + flashSrc;

   if ( etcParam != "" || etcParam != null ) {
      if ( etcParam.substr(0, 1) == "?" )
         flashSrc += etcParam;
      else
         flashSrc += "?" + etcParam;
   }

   tag += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
   tag += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" ";

   if(objWidth  != "") { tag += "width=\""  + objWidth  + "\"" }
   if(objHeight != "") { tag += "height=\"" + objHeight + "\"" }

   tag += ">";
   tag += "<param name=\"movie\" value=\"" + flashSrc + "\">";
   tag += "<param name=\"menu\" value=\"false\">";
   tag += "<param name=\"quality\" value=\"high\">";
   tag += "<param name=\"wmode\" value=\"transparent\">";
   tag += "<embed src=\"" + flashSrc + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
   tag += "type=\"application/x-shockwave-flash\" width=\"" + objWidth + "\" height=\"" + objHeight + "\" ";
   tag += "wmode=\"transparent\"></embed>";
   tag += "</object>";

   document.write(tag);
}

function getembed(vod, objWidth, objHeight) {
   document.write("<object id='VODPlayer' standby='Loading Windows Media Player components...' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,07,1112' classid='clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6' VIEWASTEXT  width='" + objWidth + "' height='" + objHeight + "'>");
   document.write("<param name='URL'               value='mms://www.mizon.co.kr/mizon/" + vod + "'>");
   document.write("<param name='rate'              value='1'>");
   document.write("<param name='balance'           value='0'>");
   document.write("<param name='currentPosition'   value='0'>");
   document.write("<param name='playCount'         value='1'>");
   document.write("<param name='autoStart'         value='1'>");
   document.write("<param name='currentMarker'     value='0'>");
   document.write("<param name='invokeURLs'        value='1'>");
   document.write("<param name='volume'            value='70'>");
   document.write("<param name='mute'              value='0'>");
   document.write("<param name='uiMode'            value='full'>");
   document.write("<param name='stretchToFit'      value='1'>");
   document.write("<param name='enabled'           value='1'>");
   document.write("<param name='enableContextMenu' value='0'>");
   document.write("<param name='fullScreen'        value='0'>");
   document.write("<param name='showcontrol'       value='0'>");
   document.write("<param name='captioningID'      value=''>");
   document.write("</object>");
}

/*-------------------------------------------------------------------------
   È¸¿øÁ¤º¸¼öÁ¤...
-------------------------------------------------------------------------*/
function info_edit_proc(mem_id) {
   var rtn_value = showModalDialog("/_admin_page/member/member_info.asp?mem_id=" + mem_id, "member_info", "resizable:0; help:0; status:0; scroll:1; dialogWidth:680px; dialogHeight:680px;");

   switch(rtn_value) {
      case "update" :
         location.reload();
         break;
      case "buy" :
         location.href = "/_admin_page/order/order_list.asp?pagetitle=" + escape("¸ÅÃâÁøÇà°ü¸®") + "&src_state=0000&src_column=a.ord_mem_id&src_search=" + escape(mem_id);
         break;
      default :
         if(typeof(rtn_value) != "undefined") {
            if(rtn_value.substring(0,5) == "order") {
               location.href = "/_admin_page/order/order_detail.asp?pagetitle=" + escape("¸ÅÃâÁøÇà°ü¸®") + "&ord_info_num=" + rtn_value.split("|")[1];
            }
         }
         break;
   }
}

/*-------------------------------------------------------------------------
   ÄíÆù¹ß±Þ³»¿ª...
-------------------------------------------------------------------------*/
function coupon_history_list(v_num, v_kind) {
   var rtn_value = showModalDialog("/_admin_page/event/coupon_history_list.asp?v_num=" + v_num + "&v_kind=" + v_kind, "couponhistorylist", "resizable:0; help:0; status:0; scroll:0; dialogWidth:900px; dialogHeight:500px;");
}

/*-------------------------------------------------------------------------
   ·¹ÀÌ¾î ¿·¿¡ º¸ÀÌ±â...
-------------------------------------------------------------------------*/
function layer_position(pctl, sctl, stop, sleft) {
   var left = 0;
   var top  = 0;

   ctl = pctl;

   while (ctl.tagName.toLowerCase() != "body") {
      top  += ctl.offsetTop;
      left += ctl.offsetLeft;
      ctl   = ctl.offsetParent;
   }

   sctl.style.left       = left + pctl.offsetWidth + 2 + (sleft);
   sctl.style.pixelTop   = top + (stop);
   sctl.style.visibility = "visible";
}

/*-------------------------------------------------------------------------
   ÆË¾÷Ã¢ Ã¼Å©
-------------------------------------------------------------------------*/
function pop_chk() {
   var pop_chk = open("", "popchk", "width=0, height=0, left=0, top=0, toolbar=no, channelmode=no, location=no, directories=no, menubar=no, scrollbars=no");

   if(pop_chk == null) {
      alert("ÆË¾÷ÀÌ Â÷´ÜµÇ¾ú½À´Ï´Ù. ÆË¾÷À» ¸ÕÀú Çã¿ëÇØ ÁÖ¼¼¿ä.");
      return false;
   } else {
      pop_chk.close();
      return true;
   }
}

/*-------------------------------------------------------------------------
   »óÇ°Á¤º¸ ´ÜÃàº¸±â
-------------------------------------------------------------------------*/
function open_product(prod_num) {
   window.open("/product/product_detail_pop.asp?prod_num=" + prod_num, "openproduct",  "width=980, height=800, scrollbars=1");
}

/*-------------------------------------------------------------------------
   ¿¡½ºÅ©·Î °¡ÀÔ¿©ºÎ
-------------------------------------------------------------------------*/
function goValidEscrow(mertid) {
   var strMertid = mertid; 
   window.open("https://pgweb.dacom.net/pg/wmp/mertadmin/jsp/mertservice/s_escrowYn.jsp?mertid="+strMertid,"check","width=339, height=263, scrollbars=no, left = 200, top = 50");		
}

/*-------------------------------------------------------------------------
   ¸¶¿ì½º Á¦ÇÑ
-------------------------------------------------------------------------*/
function constraint() {
   return false;
}

//document.ondragstart   = constraint;
//document.onselectstart = constraint;
document.oncontextmenu = constraint;
