// ¸ùº£¸£ Àü»ê½Ç ½Å±¤Çö 2004.04.05

// Request.ServerVariables("REMOTE_ADDR") ASP ÀÛ¼ºÀÚ IP

//ÄíÅ°°ªÀ» °¡Á®¿À´Â ÇÔ¼ö
function getCookie(name) {
  var from_idx = document.cookie.indexOf(name+'=');

  if( from_idx != -1) {
    from_idx += name.length + 1;
    to_idx = document.cookie.indexOf(';', from_idx);
    if (to_idx == -1) {
      to_idx = document.cookie.length;
    }
    return unescape(document.cookie.substring(from_idx, to_idx));
  }
  else {
    return 0;
  }
}

// ÄíÅ° ¼³Á¤
function setCookie(name, value, expiredays) {
  var expire_date = new Date();
  expire_date.setDate(expire_date.getDate() + expiredays );
  document.cookie = name + "=" + escape( value ) + "; expires=" + expire_date.toGMTString() + "; path=/";
}

function setCookieTime(name, value, expiretime) {
  var expire_date = new Date();
  expire_date.setDate(expire_date.getHours() + expiretime );
  document.cookie = name + "=" + escape( value ) + "; expires=" + expire_date.toGMTString() + "; path=/";
}

//ÄíÅ° ¼Ò¸ê ÇÔ¼ö
function clearCookie(name) {
  var expire_date = new Date();
  expire_date.setDate(expire_date.getDate()-1); // ÀÌÀü³¯ÀÚ¸¦ ¼³Á¤ÇÏ¿© ÄíÅ°¼Ò¸ê
  document.cookie = name + "= " + "; expires=" + expire_date.toGMTString() + "; path=/"
}


function open_main()     //main popupÀ» ¿­¶§....ºñ±³ÇÏ±â À§ÇØ Áö¿ìÁö ¾Ê¾ÒÀ½
{
  if ( getCookie( "Notice" ) != "done" )		
  {
    noticeWindow  =  window.open('http://www.drbenest.com/event/booking.html','Notice','width=395, height=205,scrollbars=0');
    noticeWindow.window.focus
  }
}

function index_popup() {
  // ÆË¾÷ ¹«Á¶°Ç ¶ì¿ò
  popupWindow = window.open('/mont/popup/20040403.asp','index_popup','width=516, height=284,left=4,top=4,scrollbars=auto');
  popupWindow.window.focus();

  return;
  
  if ( getCookie( "index_popup" ) == 0 )		
  {
//    setCookie("index_popup","visit",0);
    popupWindow = window.open('/mont/popup/20040403.asp','_blank','width=516, height=284,left=4,top=4,scrollbars=auto');
    popupWindow.window.focus();
  }
}


function open_notice()   //ÆË¾÷Ã¢ 
{
  if ( getCookie( "notice1" ) != "done" )		
  {
    noticeWindow  =  window.open('/popup/060414.html','notice1','width=382, height=260,left=0, top=0, scrollbars=auto');
    noticeWindow.window.focus
  }
}



// var CloseDate = new Date("Feb 4, 2004"); //ÆË¾÷ À©µµ¿ì¸¦ ´Ý°íÀÚ ÇÏ´Â ³¯Â¥¸¦ ÀÔ·ÂÇÏ¼¼¿ä.
// var Today = new Date(); //¿À´Ã ³¯Â¥¸¦ ÀÇ¹ÌÇÕ´Ï´Ù. ¼öÁ¤ÇÏÁö ¸¶¼¼¿ä.



/*
function controlCookie(elemnt) {
  if(elemnt.checked) { //Ã¼Å© ¹Ú½º¸¦ ¼±ÅÃÇßÀ» °æ¿ì ÄíÅ° »ý¼º ÇÔ¼ö È£Ãâ
    setCookie("op1","true", 1)
  }
  else {  //Ã¼Å© ¹Ú½º¸¦ ÇØÁ¦ÇßÀ» °æ¿ì ÄíÅ° ¼Ò¸ê ÇÔ¼ö È£Ãâ
    clearCookie("op1")
  }
  return
}

<form name="form1" method="post" action=""> 
<input type="checkbox" name="closeEvent" onClick="controlCookie(this)">¿À´Ã ÇÏ·ç ÀÌ Ã¢À» ¿­Áö ¾Ê½À´Ï´Ù!
</form>

*/


function closeWin(objtar, objname) 
{ 
	if ( objtar.checked ) 
 		setCookie( objname, "done" , 1); 
	self.close(); 
}
