date1="2010/01/27"   // ÆË¾÷ ½ÃÀÛÇÒ³¯Â¥

date2="2010/03/02"   // ÆË¾÷ ¾È³ª¿À°Ô(½ÃÀÛ)ÇÒ ³¯Â¥

var date3 = new Date();  // ÇöÀç³¯Â¥ °´Ã¼

var now = new Date();  // ÇöÀç³¯Â¥ ±¸ÇÏ°í...

var begin = new Date();

var end   = new Date();

begin = new Date(date1);

end   = new Date(date2);

date4="2009/07/17";
date5="2009/12/31";
var begin1 = new Date();
var end1   = new Date();
begin1 = new Date(date4);
end1   = new Date(date5);


date6="2010/01/14";
date7="2010/03/31";
var begin2 = new Date();
var end2   = new Date();
begin2 = new Date(date6);
end2   = new Date(date7);


var rand_val

var rand_ban_index

rand_val=Math.floor(Math.random()*100); 

if(         rand_val<20)      {rand_ban_index=1}  

else if(20<=rand_val && rand_val<40) {rand_ban_index=2}  

else if(40<=rand_val && rand_val<60) {rand_ban_index=3}  

else if(60<=rand_val && rand_val<80) {rand_ban_index=4}  

else                   {rand_ban_index=0}  



	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 setCookie( name, value, expiredays ) {

		var todayDate = new Date();

		todayDate.setDate( todayDate.getDate() + expiredays );

		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"

	}





    
	if ( getCookie("popnameevent") != "done" ) 

    {

   		// Á¶°Ç¿¡ ¸ÂÀ¸¸é ÆË¾÷À» ¶ç¿ò...

		if(now >= begin && now <= end) 

		{

	        noticeWindow    = window.open("/mycredit/service/eventzone/pop_name_event.html","discountByPoint","top=0,left=10,width=420,height=495,scrollbars=no, status=0,toolbar=0,menubar=0");

	        noticeWindow.opener = self;

	        noticeWindow.focus();

	    }
    }

/*
	if(getCookie("noticePointDiscount") != "done"){
		
		if(now >= begin1 && now <= end1) {
			
			mentorWindow = window.open("/mycredit/service/eventzone/pop_event_noticePointDiscount.html","noticePointDiscount","top=0,left=0,width=420,height=660,scrollbars=0, status=0,toolbar=0,menubar=0");
			mentorWindow.opener = self;
			mentorWindow.focus();
		}
	}
*/	
	
	if(getCookie("popname") != "done"){
		
		if(now >= begin2 && now <= end2) {
			
			mentorWindow = window.open("/mycredit/service/eventzone/pop_name.html","popname","top=0,left=440,width=420,height=625,scrollbars=0, status=0,toolbar=0,menubar=0");
			mentorWindow.opener = self;
			mentorWindow.focus();
		}
	}


	function random_banner_img() { 

		var img = new Array(); 

		img[0]='<td style="padding:0 0 8;text-align:center"><a href="creditSmsIntroduce.do"><img src="/mycredit/service/img/main/ban_nmprotect.gif" border="0"></a><a href="javascript:" onclick="aa=window.open(\'/mycredit/service/pop_giftcard.htm\',\'giftcard\',\'width=635,height=600,toolbars=0,scrollbars=1,statubar=0\');"><img src="/mycredit/service/img/main/ban_giftcard.gif" border="0"></a></td>'; 

/*		img[1]='<td style="padding:0 0 8;text-align:center"><a href="javascript:menu_onClick(\'A0301000\' , \'eventJune\');"><img src="/mycredit/service/img/event/event_june_ban_180.gif" width=180 height=70 border="0"></a></td>';

		img[1]='<td style="padding:0 0 8;text-align:center"><a href="/mycredit/getPage.do?page=/evsvc/main_event_quiz.jsp"><img src="/mycredit/service/img/event/event18_ban.gif" border="0"></a></td>';

		img[2]='<td style="padding:0 0 8;text-align:center"><a href="/mycredit/getPage.do?page=/evsvc/main_event_quiz.jsp"><img src="/mycredit/service/img/event/event18_ban.gif" border="0"></a></td>';

*/

		var n = rand_ban_index % 1; 

//		n = 0;

		document.write(img[n]);                 

	}  

	