  var bikky = document.cookie;

  function getCookie(name) { // use: getCookie("name");
    var index = bikky .indexOf(name + "=");
    if (index == -1) return null;
    index = bikky .indexOf("=", index) + 1;
    var endstr = bikky .indexOf(";", index);
    if (endstr == -1) endstr = bikky .length;
    return unescape( bikky .substring(index, endstr));
  }

  var today = new Date();
  var expiry = new Date(today.getTime() + 28 * 24 * 60 * 60 * 1000); // plus 28 days

  function setCookie(name, value) { // use: setCookie("name", value);
    if (value != null && value != "")
      document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString(); bikky = document.cookie; // update bikky
  }

  function clearCookie(key) {
	document.cookie = key + "=" + "xx; expires=1-Jan-1997 00:00:00;";
  } 
  // Your code goes here ...

	function off_adult(){
		clearCookie('allow_adult');
		setCookie('allow_adult', false);
		//window.alert('アダルト・オフ');
		window.location.reload(true);
	}
	
	function on_adult(){
		setCookie('allow_adult', true);
		//window.alert('アダルト・オン');
		window.location.reload(true);
	}

function user_env() {
	//document.write('navigator:' + navigator + '\<BR\>');
	
	$user_ref = ('ref=' +escape(document.referrer));
	$doc_url = ('&url=' +escape(document.URL));
	//$doc_title = ('&til=' + document.title);
	$user_plf = ('&plf=' + navigator.platform);
	$user_lng = ('&lng=' + navigator.language);
	$user_cookie = ('&cookie=' + navigator.cookieEnabled);
	$user_java = ('&java=' + navigator.javaEnabled());
	
	$user_environment  = ($user_ref + $doc_url + $user_plf + $user_lng + $user_cookie + $user_java);
	return ($user_environment);
	//document.write($user_environment);
	//document.write('<br>');
	
	//document.write('navigator.userAgent:' + navigator.userAgent + '\<BR\>');
	//document.write('navigator.platform:' + navigator.platform + '\<BR\>');
	//document.write('navigator.language:' + navigator.language + '\<BR\>');
	//document.write('navigator.cookieEnabled:' + navigator.cookieEnabled + '\<BR\>');
	//document.write('navigator.javaEnabled():' + navigator.javaEnabled() + '\<BR\>');
	
	//document.write('document.referrer:' + document.referrer + '\<BR\>');
	//document.write('document.lastModified:' + document.lastModified + '\<BR\>');
	//document.write('document.URL:' + document.URL + '\<BR\>');
} 