﻿

function NoticeGetCookie( name ){
    var nameOfCookie = name + "=";
    var x = 0;
    while ( x <= document.cookie.length )
    {
            var y = (x+nameOfCookie.length);
            if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                    if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                            endOfCookie = document.cookie.length;
                    return unescape( document.cookie.substring( y, endOfCookie ) );
            }
            x = document.cookie.indexOf( " ", x ) + 1;
            if ( x == 0 )
                    break;
    }
    return "";
}


function OpenPopupEvent(url,name, value, width, height)
{
    
    if ( NoticeGetCookie(name) != escape( value ) )
    {
            var win = window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, width='+width+',height='+height+',top=100,left=100'); // 팝업윈도우의 경로와 크기를 설정 하세요
            if(win) win.focus(); 
    }
}


function ClosePopCookie(name, value, expiredays) {

    if (document.frm.chkEvent.checked)
    {
	   var endDate = new Date();
      endDate.setDate( endDate.getDate()+ expiredays );
      document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + endDate.toGMTString() + ";"
	}
	
	self.close();
}

function goURL(a) {
	opener.location.href = a;
	self.close();
}

function tagetURL() {
	self.close();
}


