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 "";
}


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 open_popup1()
{
  if ( getCookie( "popup1" ) != "done" )		
  {
    noticeWindow  =  window.open('/shilla/popup/event/040917.asp','popup1','width=420, height=650,left=10,top=10,scrollbars=auto');
    noticeWindow.window.focus
  }
}

function open_popup2()
{
  if ( getCookie( "popup2" ) != "done" )		
  {
    noticeWindow  =  window.open('/shilla/popup/event/081121.asp','popup2','width=500, height=670,left=10,top=10,scrollbars=auto');
    noticeWindow.window.focus
  }
}
  
  function open_popup3()
{
  if ( getCookie( "popup3" ) != "done" )		
  {
    noticeWindow  =  window.open('/shilla/popup/event/0711.asp','popup3','width=544, height=810,left=400,top=10,scrollbars=auto');
    noticeWindow.window.focus
  }
}
  
  function open_popup4()
{
  if ( getCookie( "popup4" ) != "done" )		
  {
    noticeWindow  =  window.open('/shilla/popup/event/0711_1.asp','popup4','width=450, height=680,left=800,top=10,scrollbars=auto');
    noticeWindow.window.focus
  }
}

function setCookie( name, value, expiredays )
    {
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
	}


function closeWin(objtar, objname) 
{ 
	if ( objtar.checked ) 
 		setCookie( objname, "done" , 1); 
	self.close(); 
}
