﻿
function popchk() {


	
	//날짜체크-----------------------------------------------
	
	var Day = new Date();
	var ToDay = Day.getDate() 
	var ToMonth = Day.getMonth()
	var ToYear = Day.getYear()
	
	var ToDate = new Date (ToYear,ToMonth,ToDay);
	
		
	
	//팝업 쿠키,경로 설정-----------------------------------
	var cookie_name1 = "popQfeet";
	var popup_file1 = "/Q-feet/Event1_List.aspx";
	//팝업 마감날짜 셋팅
	var popup_SDate1 = new Date(2010,08-1,16);
	var popup_EDate1 = new Date(2010,09-1,10);
	if ( ToDate <= popup_EDate1 && ToDate >= popup_SDate1  ){
	    if (GetCookie2(cookie_name1) != "done") {
		//window.open("/member/popup_login.asp", "login", "width=300,height=314,scrollbars=no");
	        window.open(popup_file1, cookie_name1, "left=0,top=0,width=900,height=600,scrollbars=no");
		}

    }

    //팝업 쿠키,경로 설정-----------------------------------
    var cookie_name1 = "pop20110303";
    var popup_file1 = "/Popup/20110303/popup.html";
    //팝업 마감날짜 셋팅
    var popup_SDate1 = new Date(2010, 08 - 1, 16);
    var popup_EDate1 = new Date(2011, 03 - 18, 18);
    if (ToDate <= popup_EDate1 && ToDate >= popup_SDate1) {
        if (GetCookie2(cookie_name1) != "done") {
            //window.open("/member/popup_login.asp", "login", "width=300,height=314,scrollbars=no");
            window.open(popup_file1, cookie_name1, "left=0,top=0,width=400,height=550,scrollbars=no");
        }

    }
   
}


function getCookie(name)
{
	var from_idx = document.cookie.indexOf(name+'=');
	if (from_idx != -1)
	{
		from_idx += name.length + 1
		to_idx = document.cookie.indexOf(';', from_idx)

		if (to_idx == -1)
		{
			to_idx = document.cookie.length
		}
		return unescape(document.cookie.substring(from_idx, to_idx))
	}
}

function GetCookie2(name){

	var arg = name + "=";
    	var alen = arg.length;
    	var clen = document.cookie.length;
    	var i = 0;

    	while(i < clen){
        		var j = i + alen;
        		if(document.cookie.substring(i, j) == arg)
        		return getCookieVal(j)
        		i = document.cookie.indexOf(" ", i) + 1
        		if(i == 0) break
    	}
    	return null
}

function getCookieVal(offset){

	var endstr = document.cookie.indexOf(";", offset)
    	if(endstr == -1)
        	endstr = document.cookie.length
		return unescape(document.cookie.substring(offset, endstr))
}


document.onload = popchk();


