//----------------------------------------------------------------------------------------------------//
//　クッキー設定
//　引数：cnm		...クッキー名
//        val		...設定値
//　戻値：なし
function setCookie( cnm, val )
{
  if ( !document.getElementById ) return;
  document.cookie = " " + cnm + "=" + val + "; expires=Sat, 30-Sep-2034 23:59:59 GMT; path=/;";
}
//----------------------------------------------------------------------------------------------------//

//----------------------------------------------------------------------------------------------------//
//　クッキー設定値取得
//　引数：cnm		...クッキー名
//　戻値：クッキー値
function getCookie( cnm )
{
  if ( !document.getElementById ) return;
  var ret = "";
  var cookies = document.cookie.split( "; " );
  var j;
  var vals;
  for ( j = 0; j < cookies.length; j++ )
  {
    vals = cookies[ j ].split( "=" );
    if ( vals[ 0 ] == cnm )
    {
      ret = vals[ 1 ];
    }
  }
  return( ret );
}
//----------------------------------------------------------------------------------------------------//

//Win or Mac 判定によるスタイルシート設定
fName = "";
str = navigator.appName.toUpperCase();
if (str.indexOf("NETSCAPE") >= 0) fName = "mac.css";
if (str.indexOf("EXPLORER") >= 0) fName = "win.css";
document.write("<link rel='stylesheet' href='/css/" + fName + "' type='text/css'>");

//R-18用スタイルシート出力
r18 = getCookie( 'r18' );
document.write("<style TYPE='text/css'>");
document.write("<!--");
document.write("div.r18 {");
if ( r18 == "1" )
{
  document.write("visibility: visible;");
}else{
  document.write("visibility: hidden;");
}
document.write("}");
document.write("td.r18 {");
if ( r18 == "1" )
{
  document.write("");
}else{
  document.write("background-image: url(/img/bg_logo.gif);");
  document.write("background-repeat: no-repeat;");
}
document.write("}");
document.write("-->");
document.write("</style>");
