// 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 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();
	}
}



//ÆË¾÷Ã¢ #1
function open_notice1(){
	if ( getCookie( "notice1" ) != "done" ){
		noticeWindow1 = window.open('/popup/20120214.html','notice1','width=517, height=765,  left=10, top=10, scrollbars=no');
		noticeWindow1.window.focus();
	}
}

//ÆË¾÷Ã¢ #2
function open_notice2(){
	if ( getCookie( "notice2" ) != "done" ){
		noticeWindow1 = window.open('/popup/120214.html','notice2','width=517 height=413,  left=535, top=10, scrollbars=no');
		noticeWindow1.window.focus();
	}
}

//ÆË¾÷Ã¢ #3
//function open_notice3(){
//	if ( getCookie( "notice3" ) != "done" ){
//		noticeWindow1 = window.open('/popup/111227.html','notice3','width=517, height=764,  left=700, top=10, scrollbars=no');
//		noticeWindow1.window.focus();
//	}
//}



function closeWin(objtar, objname)
{
	if ( objtar.checked )
 		setCookie( objname, "done" , 1);
	self.close();
}
