
function GetCookie(sName) {
  	var aCookie = document.cookie.split("; ");
  	for (var i=0; i < aCookie.length; i++)  {
  		var aCrumb = aCookie[i].split("=");
    	if (sName == aCrumb[0]) {
	        return unescape(aCrumb[1]);
		  }
  	}
  	// a cookie with the requested name does not exist
  	return "";
}

function setCookie(name,value)
{
    var todayDate = new Date();
    todayDate.setTime(todayDate.getTime() + (1000 * 3600) * 24 * 1); 	//1ÀÏ
    document.cookie = name+"="+escape(value)+"; path=/;expires="+todayDate.toGMTString()+";";
}


function openNotice_eng() {


	if(GetCookie("notice_pop")!="done" && timelimit(2005, 8, 10, 15, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/notice_eng.htm', 'notice_pop', 'scrollbars=no,resizable=no,copyhistory=no,width=100,height=100,left=0,top=0' );
  }//end if

}//end fun

//ÇÔ¼ö´Â »èÁ¦ÇÏ¸é ¾ÈµÊ !!
//index.php¿¡¼­ openNotice ¶Ç´Â openNotice_eng ¹«Á¶°Ç È£Ãâ
//-> popup ÀÌ ¾øÀ» °æ¿ì window.open ¸¸ »èÁ¦ ¶Ç´Â timelimit ÇÔ¼ö ÀÌ¿ë




function openNotice() {

if(GetCookie("company")!="done" && timelimit(2009, 12, 10, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/20091210.html', 'Newyear', 'scrollbars=no,resizable=no,copyhistory=no,width=430,height=569,left=520,top=0' );
  }//end if
/* 
if(GetCookie("company")!="done" && timelimit(2009, 10, 31, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/20090911.html', 'notice_map', 'scrollbars=no,resizable=no, copyhistory=no, width=535, height=900, left=520, top=0' );
  }//end if

if(GetCookie("company")!="done" && timelimit(2008, 12, 27, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/2009.html', '2009»õÇØÀÎ»ç', 'scrollbars=no,resizable=no,copyhistory=no,width=535,height=640,left=520,top=0' );
  }//end if

 if(GetCookie("company")!="done" && timelimit(2008, 2, 14, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/kecs_2008.html', 'º¸¾ÈÀûÇÕ¼ºÅë°ú', 'scrollbars=no,resizable=no,copyhistory=no,width=535,height=640,left=520,top=0' );
  }//end if

 if(GetCookie("company")!="done" && timelimit(2008, 2, 30, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/gs_2008.html', 'GSÀÎÁõ', 'scrollbars=no,resizable=no,copyhistory=no,width=670,height=660,left=0,top=0' );
  }//end if

 if(GetCookie("company")!="done" && timelimit(2005, 10, 17, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/notice_20070918.html', 'isms', 'scrollbars=no,resizable=no,copyhistory=no,width=560,height=660,left=0,top=0' );
  }//end if


 if(GetCookie("company")!="done" && timelimit(2005, 10, 17, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/notice_20070919.html', 'isms1', 'scrollbars=no,resizable=no,copyhistory=no,width=560,height=660,left=0,top=0' );
   }//end if

 if(GetCookie("isms")!="done" && timelimit(2007, 12, 5, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/notice_20080104.htm', 'isms', 'scrollbars=no,resizable=no,copyhistory=no,width=509,height=700,left=0,top=0' );
  }//end if

 if(GetCookie("company")!="done" && timelimit(2007, 12, 17, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/isa_2008.html', 'isms2', 'scrollbars=no,resizable=no,copyhistory=no,width=560,height=660,left=520,top=0' );
  }//end if

 if(GetCookie("isms")!="done" && timelimit(2007, 4, 14, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/isms.htm', 'isms', 'scrollbars=no,resizable=no,copyhistory=no,width=560,height=600,left=0,top=0' );
  }//end if

 //È¸»ç ÀÌÀü ¾È³»
 if(GetCookie("notice_map")!="done" && timelimit(2006, 6, 2, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/map_move.htm', 'notice_map2', 'scrollbars=no,resizable=no,copyhistory=no,statusbar=no,width=100,height=100,left=0,top=0' );
  }//end if

 //È¸»çÀÌÀü À¥¼­¹ö ´Ù¿î ¾Ë¸² 
  if(GetCookie("notice_20060530")!="done" && timelimit(2006, 5, 2, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/notice_20060530.htm', 'notice_20060530', 'scrollbars=no,resizable=no,copyhistory=no,statusbar=no,width=100,height=100,left=0,top=0' );
  }//end if

	
	
/*
 //DeepSight±³À° ¼¼¹Ì³ª ¾Ë¸² 
 if(GetCookie("notice_deepsight")!="done" && timelimit(2006, 3, 1, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/notice_deepsight.htm', 'notice_deepsight', 'scrollbars=no,resizable=no,copyhistory=no,statusbar=no,width=100,height=100,left=0,top=0' );
  }//end if

	//»ç°íÁ¶Ä¡ À¥¼­¹ö ´Ù¿î ¾Ë¸² 
  if(GetCookie("notice_20060321")!="done" && timelimit(2006, 3, 10, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/notice_20060224.htm', 'notice_20060321', 'scrollbars=no,resizable=no,copyhistory=no,statusbar=no,width=100,height=100,left=0,top=0' );
  }//end if
  
	if(GetCookie("notice_pop")!="done" && timelimit(2005, 8, 10, 15, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/notice.htm', 'notice_pop', 'scrollbars=no,resizable=no,copyhistory=no,width=100,height=100,left=0,top=0' );
  }//end if

	if(GetCookie("thank_pop")!="done" && timelimit(2005, 8, 19, 23, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/pop_thanksgiving Day.htm', 'thank_pop', 'scrollbars=no,resizable=no,copyhistory=no,width=100,height=100,left=0,top=0' );
  }//end if

	if(GetCookie("com_pop")!="done" && timelimit(2005, 8, 30, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/com_pop.htm', 'com_pop', 'scrollbars=no,resizable=no,copyhistory=no,width=100,height=100,left=0,top=0' );
  }//end if

	if(GetCookie("concert_pop")!="done" && timelimit(2005, 8, 30, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/concert_pop.htm', 'concert_pop', 'scrollbars=no,resizable=no,copyhistory=no,width=100,height=100,left=460,top=0' );
  }//end if

	if(GetCookie("ubank_pop")!="done" && timelimit(2005, 9, 07, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/20051006popup.htm', 'ubank_pop', 'scrollbars=no,resizable=no,copyhistory=no,width=100,height=100,left=0,top=0' );
  }//end if
  
	if(GetCookie("zone_pop")!="done" && timelimit(2005, 10, 04, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/Zone_H_pop.htm', 'zone_pop', 'scrollbars=no,resizable=no,copyhistory=no,statusbar=no,width=100,height=100,left=0,top=0' );
  }//end if

	if(GetCookie("UTM_pop")!="done" && timelimit(2006, 2, 1, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/utm.htm', 'UTM_pop', 'scrollbars=no,resizable=no,copyhistory=no,statusbar=no,width=100,height=100,left=0,top=0' );
  }//end if
  
	if(GetCookie("new_year_pop")!="done" && timelimit(2006, 0, 10, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/2006_newyear.htm', 'new_year_pop', 'scrollbars=no,resizable=no,copyhistory=no,statusbar=no,width=100,height=100,left=300,top=0' );
  }//end if 

	if(GetCookie("chennel_pop")!="done" && timelimit(2006, 2, 17, 0, 0, 0)=="yes") {
  	window.open('http://www.infosec.co.kr/popup/chennel.htm', 'chennel_pop', 'scrollbars=no,resizable=no,copyhistory=no,width=560,height=600,left=0,top=0' );
  }//end if
  
*/

}//end func

function timelimit(in_y,in_m,in_d,in_h,in_i,in_s) {
    //date_time ¿¡ ¼³Á¤
    //date_time = "yyyy,m-1, d,  h, i, s"
    //ÀÔ·Â Çü½Ä = 2005-(0~11)-(1~31) (0~23):(0~59):(0~59)

    //ÇöÀç °ª
    var zero_fil="";
    var zero_d="";
    var todayDate = new Date();
    var temp_time = todayDate.toString();
    if (todayDate.getMonth() < 9) zero_fil = "0" ;
    if (todayDate.getDate() <= 9) zero_d = "0" ;
    var temp_date = todayDate.getFullYear()+""+zero_fil+(parseInt(todayDate.getMonth()) + 1)+""+zero_d+todayDate.getDate() ;

    //¼¼ÆÃ °ª
    var zero_m="";
    var zero_d="";
    var setdate = new Date(in_y,in_m,in_d,in_h,in_i,in_s);
    var set_time = setdate.toString();
    if (setdate.getMonth() < 9) zero_m = "0" ;
    if (setdate.getDate() <= 9) zero_d = "0" ;
    var set_date = setdate.getFullYear()+""+zero_m+(parseInt(setdate.getMonth()) + 1)+""+zero_d+setdate.getDate() ;

//    alert(set_date+" - "+parseInt(set_date));

    var limit = "no";
    if ((parseInt(temp_date) <= parseInt(set_date))){
            limit = "yes";
          if ((parseInt(temp_date) == parseInt(set_date)) && (todayDate.getHours() > setdate.getHours())){
            limit = "no";
          }//END IF
    }//END IF

/*
      alert(parseInt(temp_date)+" : "+parseInt(set_date));
      alert(todayDate.getHours()+" : "+setdate.getHours());
      alert(limit);
*/
      return limit;
}//end fun
