//Beginners Site Check by KENS 2008.02.07

function DRCookieCheck(mid){
	times = getCookie("panbeg");
	if (times == "1") {
		document.main.reprint.checked=true;
		/*document.main.reprint1.checked=true;*/
		if(mid != "_") {
			
			if(mid == "null") {
				location.href="/index.action";
			} else {
				location.href="/index.action?mid=" + mid ;
			}
		}
	} else {
		document.main.reprint.checked=false;
		/*document.main.reprint1.checked=false;*/
	}
}

function DRCookieAdd(){
	setCookie("panbeg", 1);
}

function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
    tmp1 = " " + document.cookie + ";";
    xx1 = xx2 = 0;
    len = tmp1.length;
    while (xx1 < len) {
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}

function setCookie(key, val, tmp) {
    tmp = key + "=" + escape(val) + "; ";
    tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
    document.cookie = tmp;
}

function clearCookie() {
    document.cookie = "panbeg=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
}
function CookieValue() {
	times = getCookie("panbeg");
	if (times == "1") {
		clearCookie();
	} else {
		DRCookieAdd();
	}
}

