// °ø¹é È®ÀÎ
function Blank(input) {
  if(!input || input.charAt(0) == " ") return false;
  return true;
}

// ÀÌ¹ÌÁö È®´ë
function Zoom_Img(img){
  PV1 = window.open("http://www.drapt.com/sise/html/comp_img_pv.php?img=" + img, "PV_Tmp1", "width=1,height=1,left=0,top=0,scrollbars=1");
  PV1.focus();
}

function height_resize(img) {
	if(img.width > 380) {
		img.width = 380;
		img.height = 232;		
	} else { 
		if(img.height > 232) img.height = 232;
	}
}

// ÄÞº¸¹Ú½º ÀÌ¿ë ÀÌµ¿ÇÏ±â
// link_page.htm, news.htm
function ListCntChoice(loc)
{
  window.location.href = loc.value;
}

// ¿øÅ¬¸¯ ¾ÆÆÄÆ®·Î ÀÌµ¿
function XXXdanji_popupWin(no) {
  wo=window.open('http://www.drapt.com/sise/html_view/detail_frame.htm?no='+no+'','notice','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=full,height=full,left=0,top=0');
  wo.focus();
}

// ¿øÅ¬¸¯ ¾ÆÆÄÆ®·Î ÀÌµ¿ => ÇØ´ç ÆòÇüÀ¸·Î
function XXXdanji_popupWin2(no,size){
  wo=window.open('http://www.drapt.com/sise/html_view/detail_frame.htm?no='+no+'&size='+size+'','notice','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=full,height=full,left=0,top=0');
  wo.focus();
}

// ¾ÆÆÄÆ®ºñ±³ÇÏ±â ½ºÅ©¸³Æ®
function two_compare(){
  var from=document.ame;
  var sum=0;
  var comp_arg1,comp_arg2;

  // ÀÚ·á°¡ ¾øÀ»°æ¿ì ¿¹¿ÜÃ³¸®
  if (from.tot_cnt.value == "") return;

  for (var i=0;i < from.chkbox.length;i++){

    if (from.chkbox[i].checked==true){
      sum++;
      if(sum == 1) {
        comp_arg1 = from.chkbox[i].value;
      }
      if(sum == 2){
        comp_arg2=from.chkbox[i].value;
      }else{
        comp_arg2='';
      }
    }
  }


  if(sum > 2){
    alert('¾ÆÆÄÆ® ºñ±³ÇÏ±â´Â 2°³±îÁö¸¸ °¡´ÉÇÕ´Ï´Ù.');
  }
  else{
    Detail = window.open("http://www.drapt.com/sise/html/pop_apt_compare01.htm?comp_arg1="+comp_arg1+"&comp_arg2="+comp_arg2+"&comp_cnt="+sum+"", "WinOpen_Tmp", "width=820,height=720,left=0,top=0,scrollbars=1");
    Detail.focus();
  }
  return;
}

// ºÐ¾ç ´ÜÁö Á¤º¸·Î ÀÌµ¿
function saleDetailInfo (arg)
{
	window.location='http://mk.drapt.com/e_sale/index.htm?page_name=detail_info&menu_key=34&sub_key=1&aptcode='+arg;
}

// ºÐ¾ç ´ÜÁö Á¤º¸·Î ÀÌµ¿
function saleDetailInfo_ebrand (arg, arg1)
{
  window.location='http://mk.drapt.com/e_sale/index.htm?page_name=detail_info1&bmenu_key=34&sub_key=1&aptcode='+arg+'&brand_no='+arg1;
}

// iframe ÀÚµ¿ »çÀÌÁî Á¶Àý
function resizeHeight(fr) {
  fr = typeof fr == 'string' ? document.getElementById(fr) : fr;
  fr.setExpression('height',detail.document.body.scrollHeight);
}

// eÄ«´Þ·Î±× º¸¿©ÁÖ±â
function Ecadal_Open(serial)
{
  // serial : ´ÜÁöÄÚµå
  Ecadal_Win = window.open('http://www.drapt.com/e_cal/new_index.htm?serial=' + serial, 'Ecadal_Tmp', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=0,left=0,width='+screen.width+',height='+screen.height);
  Ecadal_Win.focus();
}
	
/* Äá³ª¹° Áöµµ¼­ºñ½º */
function mapOpen(jiyeok,gu,dong,bunji,ho,itemname) {				
  source = "drapt";
              
  str = "http://asp.congnamul.com/mkland/map.jsp?tooltip="+itemname+"&addrStr="+jiyeok+" "+gu+" "+dong+" "+bunji+"-"+ho;
      
  w=640, h=635;
  ww=880, hh=700;

  l=(screen.availWidth/2)-(ww/2);
  t=(screen.availHeight/2)-(hh/2);
  window.open(str,"drapt","top="+t+",left="+l+",width="+w+",height="+h+",status=yes,resizable=no,toolbars=no,location=no,scrollbars=no");
}	

// Áöµµº¸±â
function _mapOpen(jiyeok, gu, dong, bunji, ho, itemname) {				
  // jiyeok = "¼­¿ïÆ¯º°½Ã";
  // gu = "°­³²±¸";
  // dong = "»ï¼ºµ¿";
  // bunji = "149";
  // ho = "3";
  source = "drapt";
  // itemname = "Ã£´Â°÷";		
              
  str = "http://www.sdsgis.co.kr/drapt/map/search.asp?jiyeok="+jiyeok+"&gu="+gu+"&dong="+dong+"&bunji="+bunji+"&ho="+ho+"&source="+source+"&itemname="+itemname;
      
  w=870, h=651;
  ww=880, hh=700;
  l=(screen.availWidth/2)-(ww/2);
  t=(screen.availHeight/2)-(hh/2);
  window.open(str,"drapt","top="+t+",left="+l+",width="+w+",height="+h+",status=yes,resizable=no,toolbars=no,location=no,scrollbars=no");
}

// µ¿½ÃºÐ¾ç > ´ÜÁöºÐ¼® > Æ¯Á¤´ÜÁö¼¼ºÎÁ¤º¸ (ÁÂÃø ¸Þ´º DHTML ±¸¼º)
function Display_Style(no)
{
  for (k = 1; k <= 7; k++) {
    eval("obj = top.m_view" + k)
    if (!obj) continue;
    if (k != no && k == 6)
    {
      top.size.value = '';
    }
    if (k == no) {
      eval("top.m_view" + k + ".style.background = '#EFEFEF';");
      // eval("top.m_img" + k + ".style.display   = '';");
      eval("top.m_td" + k + ".style.fontWeight = 'bold';");
      eval("top.m_td" + k + ".style.fontColor  = '#333333';");
    }
    else {
      eval("top.m_view" + k + ".style.background = '#FFFFFF';");
      // eval("top.m_img" + k + ".style.display   = 'none';");
      eval("top.m_td" + k + ".style.fontWeight = '';");
      eval("top.m_td" + k + ".style.fontColor  = '';");
    }
  }
}

// µ¿½ÃºÐ¾ç > ´ÜÁöºÐ¼® > Æ¯Á¤´ÜÁö¼¼ºÎÁ¤º¸ (ÁÂÃø ¸Þ´º Æò¸éµµ ¼±ÅÃ)
function SizeImg_Display(selection)
{
  var dst = selection.options[selection.selectedIndex].value;
  if (dst != '') {
    detail.window.location.href(dst);
  }
}

// Ã»¾à Ã¥°¥ÇÇ > ºÐ¾ç°èÈ¹Á¶È¸
function Popup_Plan()
{
  step1 = form.step1.value; // ½Ã
  step2 = form.step2.value; // ±¸
  step3 = form.step3.value; // µ¿
  if (step1 == "") {
    alert("Á¶È¸ÇÏ°íÀÚ ÇÏ´Â Áö¿ªÀÇ ½Ã/µµ¸¦ ¼±ÅÃÇÏ¿© ÁÖ¼¼¿ä!!");
    return;
  }

  url = "/e_sale/popup/sale_plan.htm?step1=" + step1 + "&step2=" + step2 + "&step3=" + step3;
  Popup_Plan_Win = window.open(url, "Popup_Plan_Tmp", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=615,height=625,left=0,top=0");
  Popup_Plan_Win.focus();
}

// Å°º¸µå ÀÔ·Â ¹æÁö
function KeyBoard_Event()
{
  if (event.keyCode == 121) { // F10 Key
    alert("ÇØ´ç ÄÁÅÙÃ÷ÀÇ ¹«´Üµµ¿ë ¹æÁö¸¦ À§ÇÏ¿©\n\nÇØ´ç ¹öÆ°À» »ç¿ëÇÒ ¼ö°¡ ¾ø½À´Ï´Ù.");
  }
  else if (event.keyCode == 17) { // Ctrl Key
    alert("ÇØ´ç ÄÁÅÙÃ÷ÀÇ ¹«´Üµµ¿ë ¹æÁö¸¦ À§ÇÏ¿©\n\nÇØ´ç ¹öÆ°À» »ç¿ëÇÒ ¼ö°¡ ¾ø½À´Ï´Ù.");
  }
  else if (event.keyCode == 18) { // Alt Key
//    alert("ÇØ´ç ÄÁÅÙÃ÷ÀÇ ¹«´Üµµ¿ë ¹æÁö¸¦ À§ÇÏ¿©\n\nÇØ´ç ¹öÆ°À» »ç¿ëÇÒ ¼ö°¡ ¾ø½À´Ï´Ù.");
  }
  else if (event.keyCode == 78) { // N Key
    alert("ÇØ´ç ÄÁÅÙÃ÷ÀÇ ¹«´Üµµ¿ë ¹æÁö¸¦ À§ÇÏ¿©\n\nÇØ´ç ¹öÆ°À» »ç¿ëÇÒ ¼ö°¡ ¾ø½À´Ï´Ù.");
  }
}

// Ã»¾àÅëÀåº° ¼­ºñ½º¿¡¼­ Ã»¾àÅëÀå Á¾·ùº°·Î ±Ý¾× Ç¥Ãâ
function Display_BankView(no)
{
  if (no == 0) {
    moneyView.style.display = 'block';
  }
  else {
    moneyView.style.display = 'none';
  }
}

// °ü½É´ÜÁö ¼­ºñ½º »èÁ¦
// gubun[0]: ¼öÁ¤Æû¿¡¼­ Ã³¸®, gubun[0]: Ã»¾àÃ¥°¥ÇÇ ¸ñ·Ï¿¡¼­ Ã³¸®
function DeleteData(no,gubun)
{
  if (confirm("ÇØ´ç ÀÚ·á¸¦ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) { // OKÀÌ¸é
    window.location.replace('/e_sale/process/my_book_act.php?act=svc_del&uid=' + no + '&gubun=' + gubun);
  }
}

// (Ã»¾àÃ¥°¥ÇÇ ³»)ºÐ¾ç°èÈ¹ Á¶È¸ > ºÎ¸Þ´º ÀÌµ¿ (Áö¿ªº° |¿ùº° |½Ã°ø»çº° |»ç¾÷º°)
function popupSubMenu_Submit(arg)
{
  // document.form.sub_menu.value = arg;
  // document.form.submit();
  window.location = "/e_sale/popup/sale_plan.htm?sub_menu=" + arg;
}

// ºÐ¾ç°èÈ¹ Á¶È¸ > ºÎ¸Þ´º ÀÌµ¿ (Áö¿ªº° |¿ùº° |½Ã°ø»çº° |»ç¾÷º°)
function SubMenu_Submit(arg1,arg2)
{
  // document.form.sub_menu.value = arg;
  // document.form.submit();
  window.location = "/e_sale/index.htm?page_name=saleinfo&menu_key=" + arg1 + "&sub_menu=" + arg2;
}

// ºÐ¾ç°èÈ¹ Á¶È¸ > Áö¿ªº° ¸Þ´º ÀÌµ¿
function MenuLocal_Submit(arg)
{
  document.form.step1.value = arg;
  document.form.step2.value = '';
  document.form.step3.value = '';
  document.form.submit();
}

// ºÐ¾ç°èÈ¹ Á¶È¸ > ¿ùº° ¸Þ´º ÀÌµ¿
function MenuDate_Submit(arg)
{
  document.form.sear_date.value = arg;
  document.form.submit();
}

// ºÐ¾ç°èÈ¹ Á¶È¸ > »ç¾÷º° ¸Þ´º ÀÌµ¿
function MenuGubun_Submit(arg)
{
  document.form.gubun.value = arg;
  document.form.submit();
}

// ºÐ¾ç°èÈ¹ Á¶È¸ > ½Ã°ø»çº° ¸Þ´º ÀÌµ¿
function MenuSigong_Submit(arg)
{
  document.form.sigong.value = arg;
  document.form.submit();
}

// ºÐ¾ç°èÈ¹ Á¶È¸ °Ë»öÁ¶°Ç
function chkSearch(form)
{
  step1 = form.step1.value; // ½Ã
  step2 = form.step2.value; // ±¸
  step3 = form.step3.value; // µ¿
  if (step1 == "") {
    alert("Á¶È¸ÇÏ°íÀÚ ÇÏ´Â Áö¿ªÀÇ ½Ã/µµ¸¦ ¼±ÅÃÇÏ¿© ÁÖ¼¼¿ä!!");
    return false;
  }
}

// ºÐ¾ç°èÈ¹/ºÐ¾çÁß/¹ÌºÐ¾ç °Ë»öÁ¶°Ç
function chkSearch1(form)
{
  step1 = form.step1.value; // ½Ã
  step2 = form.step2.value; // ±¸
  step3 = form.step3.value; // µ¿
}

// ³ªÀÇ °ü½É´ÜÁö µî·Ï
function MyBookMark()
{
  mycnt = document.myform.mycnt.value;
  tot_chk = document.myform.tot_chk.value;

  if (mycnt >= 5) {
    alert("5°³ÀÇ °ü½É´ÜÁö°¡ ¸ðµÎ µî·ÏµÇ¾ú½À´Ï´Ù.\n\nÇØ´ç ´ÜÁö¸¦ °ü½É´ÜÁö·Î µî·ÏÇÏ½Ã·Á¸é È¸¿ø´ÔÀÇ °ü½É´ÜÁö¸¦ Á¤¸®ÇÏ½Ã±æ ¹Ù¶ø´Ï´Ù.");
    return;
  }

  choice_cnt = 0;
  for (i = 0; i < tot_chk ; i++) {
    eval("chk_stat = document.myform.chk_" + i + ".checked");
    if (chk_stat == true) {
      choice_cnt++;
      break;
    }
  }
  if (choice_cnt == 0) {
    alert("°ü½É´ÜÁö·Î µî·ÏÇÏ°íÀÚ ÇÏ´Â ´ÜÁö¸¦ ¼±ÅÃÇÏ¿© ÁÖ¼¼¿ä!!");
    return;
  }
  document.myform.action = "/e_sale/process/my_book_act.php?act=svc_reg";
  document.myform.submit();
}

// ºÐ¾ç°èÈ¹ Á¶È¸ "ÆäÀÌÁö·ÎµùÁß" Ç¥Çö
nets = document.layers
ie   = document.all
function Page_Loading()
{
  if(ie || nets) {
    if(nets) {
      document.Load.visibility = "hidden"
    }
    else {
      Load.style.visibility = "hidden"
    }
  }
}

function SurveyPart(form)
{
  a_tmp = 0;
  for(a = 0; a < document.myform.dab_no.length; a++) {
    if(document.myform.dab_no[a].checked) {
      a_tmp++;
    }
  }

  if (a_tmp == 0) {
    alert("Ç×¸ñÀ» ¼±ÅÃÇÏ½ÅÈÄ Âü¿©ÇØ ÁÖ¼¼¿ä!!");
    return false;
  }
}

// eºê·£µå ºÐ¾ç/ÀÔÁÖ Ä¶¸°´õ > Áö¿ªº° ÀÌµ¿
function MenuArea_Submit(arg)
{
  document.myform.search_area.value = arg;
  document.myform.submit();
}

function Page_Move(form, page)
{
  eval(form + ".page.value = page;");
  eval(form + ".submit();");
}

function CfView(arg)
{
  // alert("CF º¸±â");
  Cf_Win = window.open('/e_sale/popup/brand_cf.htm?brand_no=' + arg, 'Cf_Tmp', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=0,left=0,width=500,height=410');
  Cf_Win.focus();
}

// eºê·£µå ¸ÞÀÎ ¼Óº¸ ½ºÅ©¸³Æ®
function StopScroll() {
  num = 0
}

function ResumeScroll() {
  num = 1
}

function TopImageScroll() {
  move();
  TopImageISpan.style.top = TopImagesHeight;
  TopImageISpan.style.visibility = 'visible';
}

function move() {
  if(TopImageISpan.style.pixelTop>0&&TopImageISpan.style.pixelTop<=num){
    TopImageISpan.style.pixelTop=0;
    setTimeout("move()",scrollspeed);
    setTimeout("move2()",scrollspeed);
    return
  }
  if(TopImageISpan.style.pixelTop>=TopImageISpan.offsetHeight*-1){
    TopImageISpan.style.pixelTop-=num
    setTimeout("move()",waitingtime)
  } else {
    TopImageISpan.style.pixelTop = TopImagesHeight;
    TopImageISpan.innerHTML = TopImages[iTop];
    if(iTop==TopImages.length-1) iTop=0
    else iTop++
  }
}

function move2() {
  if (TopImageIISpan.style.pixelTop>0&&TopImageIISpan.style.pixelTop<=num){
    TopImageIISpan.style.pixelTop=0
    setTimeout("move2()",scrollspeed)
    setTimeout("move()",scrollspeed)
    return
  }
  if (TopImageIISpan.style.pixelTop>=TopImageIISpan.offsetHeight*-1){
    TopImageIISpan.style.pixelTop-=num
    setTimeout("move2()",waitingtime)
  }
  else{
    TopImageIISpan.style.pixelTop=TopImagesHeight
    TopImageIISpan.innerHTML=TopImages[iTop]
    if (iTop==TopImages.length-1)
            iTop=0
    else
            iTop++
  }
}

