var now   = new Date();
now.setTime( now.getTime() - 60*60*1000 );  // ÇÑ½Ã°£ ÀÌÀüÀÇ  ½Ã°£À» ±¸ÇÑ´Ù.
var year  = now.getYear();
var month = now.getMonth() +1;
var day   = now.getDate();
var hour  = now.getHours();
var min   = now.getMinutes();
if( month < 10 )
   month = "0" + month ;
if( day < 10 )
   day = "0" + day;
if( hour < 10 )
   hour = "0" + hour;
if ( min < 10 )
   min = "0" + min;
var cookieValue = year + month + day + hour + min;

function closeWin(form, eventNM, expires, domain)
{
	if ( form.winCheck.checked )
	{
		var now   = new Date();
		var year  = now.getYear();
		var month = now.getMonth() +1;
		var day   = now.getDate();
		var hour  = now.getHours();
		var min   = now.getMinutes();

		if( month < 10 )
			month = "0" + month;
		if( day < 10 )
			day = "0" + day;
		if( hour < 10 )
			hour = "0" + hour;
		if ( min < 10 )
			min = "0" + min;

		var cookieValue = year + month + day + hour + min;

		setCookie(eventNM, cookieValue, expires, domain);
	}
	self.close();
}

function setCookie( name, value, expires, domain)
{
	var path;
	var secure;
	path = "/";

	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expires );
	todayDate.setHours( 23 );
	todayDate.setMinutes( 59 );
	todayDate.setSeconds( 59 );

	document.cookie = name + "=" + escape(value) +
	((path) ? "; path=" + path : "") +
	((expires) ? "; expires=" + todayDate.toGMTString() : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}

function getCookie( 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 "";
}

/*
if ( "http://www.pji.co.kr/" == location.href )
{
	if ( getCookie( "pji_event22" ) == "" )
		new_window2( 'pji_event22', 'http://www.pji.co.kr/popup/070730.php', 1, 1, 400, 385, '', '', '', '', '');
}
*/
