function pop_getCookie(Name) {
	var search = Name + "="
	if (document.cookie.length > 0) { // ÄíÅ°°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é
		offset = document.cookie.indexOf(search)
		if (offset != -1) { // ÄíÅ°°¡ Á¸ÀçÇÏ¸é
			offset += search.length
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset)
			// ÄíÅ° °ªÀÇ ¸¶Áö¸· À§Ä¡ ÀÎµ¦½º ¹øÈ£ ¼³Á¤
			if (end == -1) {
				end = document.cookie.length
			}
			return unescape(document.cookie.substring(offset, end));
		} else { return ""; }
	} else { return ""; }
}

function pop_isEventPeriod(start,end) {
	var dtNow = new Date();
	var s1 = start.substring(0,4);
	var s2 = start.substring(4,6);
	var s3 = start.substring(6,8);
	var s4 = start.substring(8,10);
	var s5 = start.substring(10,12);
	var i_s1 = parseInt(s1,10);
	var i_s2 = parseInt(s2,10)-1;
	var i_s3 = parseInt(s3,10);
	var i_s4 = parseInt(s4,10);
	var i_s5 = parseInt(s5,10);
	var e1 = end.substring(0,4);
	var e2 = end.substring(4,6);
	var e3 = end.substring(6,8);
	var e4 = end.substring(8,10);
	var e5 = end.substring(10,12);
	var i_e1 = parseInt(e1,10);
	var i_e2 = parseInt(e2,10)-1;
	var i_e3 = parseInt(e3,10);
	var i_e4 = parseInt(e4,10);
	var i_e5 = parseInt(e5,10);
	var dtStart  = new Date(i_s1,i_s2,i_s3,i_s4,i_s5);  // Month : 0~11... !!!!!!!
	var dtEnd  = new Date(i_e1,i_e2,i_e3,i_e4,i_e5);  // Month : 0~11... !!!!!!!

	if ( dtNow < dtStart ){return 1;}
	else if ( dtStart <= dtNow && dtNow <= dtEnd){return 2;}
	else { return 3;}
}


function pop_open(){
	if(pop_getCookie("seoul_pop") != "1"){
		window.open("http://www.seoul.go.kr/v2007/popup/marathon100313.html", "seoul_pop", "resizable=no, scrollbars=no, width=590, height=600, scrollbars=yes,left=0, top=0");
	}
}


var chek_time = pop_isEventPeriod('201003170000','201003212359');
if(chek_time==1){
}else if (chek_time==2){
	pop_open();
}else {
}

