date1="2010/07/29"   // ÆË¾÷ ½ÃÀÛÇÒ³¯Â¥
date2="2010/08/30"   // ÆË¾÷ ¾È³ª¿À°Ô(½ÃÀÛ)ÇÒ ³¯Â¥

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="2008/11/27"
date5="2008/12/27"

var begin1 = new Date();
var end1   = new Date();
begin1     = new Date(date4);
end1       = new Date(date5);

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("notice20100729") != "done") {

	// Á¶°Ç¿¡ ¸ÂÀ¸¸é ÆË¾÷À» ¶ç¿ò...
	if (now >= begin && now <= end) {

		noticeWindow = window.open("/mycredit/service/pop_event_summer_vacation.html", "notice20100729", "top=0,left=0,width=505,height=660,scrollbars=no, status=0,toolbar=0,menubar=0");
		noticeWindow.opener = self;
		noticeWindow.focus();
	}
}
/*
if(getCookie("mentor20081104") != "done"){
	
	if(now >= begin1 && now <= end1) {
		
		mentorWindow = window.open("/mycredit/service/pop_mentor_event.htm","mentor20081104","top=0,left=400,width=450,height=580,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]);
}