pageview = getCookie("pageview-c-c");

document.write("<div class='check_box'>");
if(pageview){
	document.write("<strong class='ok'>[ 年齢認証済み ]</strong> ");
	document.write("<a href='contents/'>どうぞお入りください</a>");
}else{
	document.write("<strong class='ng'>[ 年齢認証・未設定 ]</strong><br>");
	document.write("Cookieが切れているか、年齢認証をされていません。<br>");
	document.write("下のフォームから認証をお願い申し上げます。<br>");
	document.write("<iframe border=0 frameborder=0 src='error_form.html' width='600px' height='330px'>");
	document.write("<a href='error_form.html'>認証フォーム</a>");
	document.write("</iframe>");
}
document.write("</div>");

// by http://www.tohoho-web.com/
function getCookie(key) {
    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("");
}
