/* JavaScript 外部ファイル */
/*            customize.js */
/*            Version 2006 */

/* クッキー取得 */
hpstart=getCookie("hps");
hpbgclr=getCookie("hpb");
hpfgclr=getCookie("hpf");
if(hpstart=="")
  hpstart="linkversion";
if(hpbgclr=="")
  hpbgclr="882222";
if(hpfgclr==""){
  hpfgclr="000000";
}

/* ラジオボタンチェック */
if(hpbgclr=="882222"){
  chkflg31="checked"; chkflg32=""; chkflg33=""; chkflg34=""; chkflg35=""; chkflg36="";
}
else if(hpbgclr=="FFFFCC"){
  chkflg31=""; chkflg32="checked"; chkflg33=""; chkflg34=""; chkflg35=""; chkflg36="";
}
else if(hpbgclr=="FFFFFF"){
  chkflg31=""; chkflg32=""; chkflg33="checked"; chkflg34=""; chkflg35=""; chkflg36="";
}
else if(hpbgclr=="99AA99"){
  chkflg31=""; chkflg32=""; chkflg33=""; chkflg34="checked"; chkflg35=""; chkflg36="";
}
else if(hpbgclr=="7777CC"){
  chkflg31=""; chkflg32=""; chkflg33=""; chkflg34=""; chkflg35="checked"; chkflg36="";
}
else if(hpbgclr=="000000"){
  chkflg31=""; chkflg32=""; chkflg33=""; chkflg34=""; chkflg35=""; chkflg36="checked";
}
else{
  chkflg31=""; chkflg32=""; chkflg33=""; chkflg34=""; chkflg35=""; chkflg36="";
}
if(hpfgclr=="000000"){
  chkflg41="checked"; chkflg42=""; chkflg43=""; chkflg44="";
}
else if(hpfgclr=="AAAAAA"){
  chkflg41=""; chkflg42="checked"; chkflg43=""; chkflg44="";
}
else if(hpfgclr=="44DD44"){
  chkflg41=""; chkflg42=""; chkflg43="checked"; chkflg44="";
}
else if(hpfgclr=="BBBB22"){
  chkflg41=""; chkflg42=""; chkflg43=""; chkflg44="checked";
}
else{
  chkflg41=""; chkflg42=""; chkflg43=""; chkflg44="";
}

/* クッキー取出 */
function getCookie(key)
{
  tmp = document.cookie + ";";
  tmp1 = tmp.indexOf(key, 0);
  if(tmp1 != -1){
    tmp = tmp.substring(tmp1, tmp.length);
    start = tmp.indexOf("=", 0) + 1;
    end = tmp.indexOf(";", start);
    return(unescape(tmp.substring(start, end)));
  }
  return("");
}

/* クッキー収納 */
function setCookie(key, val)
{
  tmp = key + "=" + escape(val) + "; ";
  tmp += "expires=Fri, 31-Dec-2010 23:59:59; ";
  document.cookie = tmp;
}

/* クッキー削除 */
function delCookie()
{
  if(document.cookie == ""){
    alert("Cookieは未使用です。")
  }
  else{
    tmp = document.cookie.split(";");
    acDate = new Date();
    acDate.setYear(acDate.getYear() - 1);
    for(i=0 ; i<tmp.length ; i++){
      temp1 = tmp[i].split("=")[0];
      document.cookie = temp1 + "=;acDate=" + acDate.toGMTString();
    }
    alert("Cookieを削除しました。\nブラウサを再起動してください。");
  }
}

/* カスタマイズエリア表示 */
function changeHpadr2()
{
  upDateTime = dispUpDate();
  if(hpstart == "customize"){
    document.write("<a href=index_j.htm onClick=setCookie('hps','linkversion')>" + upDateTime + "</a><br>");
  }
  else{
    document.write("<a href=index_j.htm onClick=setCookie('hps','customize')>" + upDateTime + "</a><br>");
  }
}
function changeHplst()
{
  if(hpstart == "customize"){
    document.write(cst);
  }
}

/* カスタマイズ反映 */
function changeBgclr(num)
{
  if(num == 1){
    document.bgColor = "#882222";
    setCookie("hpb", "882222");
  }
  else if(num == 2){
    document.bgColor = "#FFFFCC";
    setCookie("hpb", "FFFFCC");
  }
  else if(num == 3){
    document.bgColor = "#FFFFFF";
    setCookie("hpb", "FFFFFF");
  }
  else if(num == 4){
    document.bgColor = "#99AA99";
    setCookie("hpb", "99AA99");
  }
  else if(num == 5){
    document.bgColor = "#7777CC";
    setCookie("hpb", "7777CC");
  }
  else if(num == 6){
    document.bgColor = "#000000";
    setCookie("hpb", "000000");
  }
}
function changeFgclr(num)
{
  if(num == 1){
    document.fgColor = "#000000";
    setCookie("hpf", "000000");
  }
  else if(num == 2){
    document.fgColor = "#AAAAAA";
    setCookie("hpf", "AAAAAA");
  }
  else if(num == 3){
    document.fgColor = "#44DD44";
    setCookie("hpf", "44DD44");
  }
  else if(num == 4){
    document.fgColor = "#BBBB22";
    setCookie("hpf", "BBBB22");
  }
}

/* トップ画像ランダム表示 */
function randomDisp()
{
  imgCnt = 6;
  imgNum = Math.floor(Math.random() * imgCnt);
  if(imgNum == 0){
    txtString = "MAZDA RX-7 (FD3S)<br>GT-AD KIT<br>NISSAN SILVIA (PS13)<br>180FACE<br>";
    cntString = "INITIAL FD - 更新！・・・停滞中";
    adrString = "initialfd/index.htm";
  }
  else if(imgNum == 1){
    txtString = "BBQ Kit<br>ROBA Special<br>KARUIZAWA<br>";
    cntString = "ロバのインターネット - ブログも好評連載中！BBQも得意です。<br>";
    adrString = "roba/index.shtml";
  }
  else if(imgNum == 2){
    txtString = "TOYOTA MR2 (SW20)<br>TRD2000GT<br>Sports Land Yamanashi<br>";
    cntString = "MR通 - クルマは活動休止気味ですが、ホームページは随時更新してます。";
    adrString = "mr2/index.htm";
  }
  else if(imgNum == 3){
    txtString = "Renault F1 R25<br>Heikki Kovalainen<br>TOKYO AUTOSALON 2006<br>";
    cntString = "ギャラリー - 画像特集 TOKYO AUTOSALON 2006<br>";
    adrString = "gallery/tas2006/index.htm";
  }
  else if(imgNum == 4){
    txtString = "Ferrari F430 spider<br>TOKYO MOTOR SHOW 2005<br>";
    cntString = "ギャラリー - 画像特集 TOKYO AUTO SALON 2007 with NAPAC<br>";
    adrString = "gallery/tas2007/index.htm";
  }
  else if(imgNum == 5){
    txtString = "TECH SPORTS SK90<br>JMRC CHIBA GYMKHANA SERIES<br>";
    cntString = "レースレポート - JMRC千葉ジムカーナシリーズ参戦レポートを掲載";
    adrString = "report/index.htm";
  }
  else{
    txtString = "version 2006<br>";
    cntString = "負け犬ネット - Version 2006";
    adrString = "index_j.htm";
  }
  document.write('<table width="780" height="115" cellpadding="0" cellspacing="0" border="0" background="images/topimage' + imgNum + '.jpg">');
  document.write('<tr><td align="left" valign="top" width="580"><img src="images/makeinu.gif"></td>');
  document.write('<td align="left" valign="top" width="200">');
  document.write('<div style="color=#ffffff; font-size:13px;">' + txtString + '</div>');
  document.write('</td></tr><tr><td align="right" valign="bottom" colspan="2">');
  document.write('<a href="' + adrString + '"><div style="color=#ffffff; font-size:13px; font-weight:bold;">' + cntString + '</div></a>');
  document.write('</td></tr></table>');
}

/* 選択画像切替 */
function changeRegular(num)
{
  if(num == 1){
    document.myRegular.src = "initialfd/images/fd3sicon.jpg";
  }
  else if(num == 2){
    document.myRegular.src = "roba/images/robaicon.jpg";
  }
  else{
    document.myRegular.src = "mr2/sw20icon.jpg";
  }
}

/* クイックリンク */
function selectLink11()
{
  selurl = document.gymkhanaform.gymkhanasel.options[document.gymkhanaform.gymkhanasel.selectedIndex].value;
  if (selurl != "")
    location.href = selurl;
}
function selectLink12()
{
  selurl = document.circuitform.circuitsel.options[document.circuitform.circuitsel.selectedIndex].value;
  if (selurl != "")
    location.href = selurl;
}

/* 更新日時表示 */
function dispUpDate(){
  upDate = new Date(document.lastModified);
  upMonth = upDate.getMonth() + 1;
  upDay = upDate.getDate();
  upYear = upDate.getYear();
  if(navigator.appName == "Netscape")
  upYear+= 1900;
  return(upYear + "/" + upMonth + "/" + upDay + "<br>更新");
}

/* ヘッダーアイテム */
hed="";
hed+='<table width="800" cellpadding="0" cellspacing="0" border="0" bgcolor="#996666">';
hed+='<tr>';
hed+='<td align="center" valign="top" width="240" bgcolor="#FFCCCC">';
hed+='<a href="http://www.makeinu.net"><img src="http://www.makeinu.net/images/titleba.png" border="0" alt="負け犬ネット"></a>';
hed+='<div style="color=#7777CC; font-size:11px; font-weight:bold;">モータースポーツと日常の話題</div>';
hed+='</td>';
hed+='<td align="center" valign="top" width="468" height="60" bgcolor="#996666">';
hed+='<IFRAME frameBorder="0" allowTransparency="true" height="60" width="468" marginHeight="0" scrolling="no" src="http://ad.jp.ap.valuecommerce.com/servlet/htmlbanner?sid=2171972&pid=872360568" MarginWidth="0"><script Language="javascript" Src="http://ad.jp.ap.valuecommerce.com/servlet/jsbanner?sid=2171972&pid=872360568"></script><noscript><a Href="http://ck.jp.ap.valuecommerce.com/servlet/referral?sid=2171972&pid=872360568" target="_blank" ><img Src="http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=2171972&pid=872360568" height="60" width="468" Border="0"></a></noscript></IFRAME>';
hed+='</td>';
hed+='<td align="center" valign="middle" width="92" bgcolor="#994444">';
hed+='<img src="http://www.makeinu.net/images/print.jpg" width="90" height="57">';
hed+='</td>';
hed+='</tr>';
hed+='<tr>';
hed+='<td align="center" valign="bottom" height="25" colspan="3">';
hed+='<table cellpadding="0" cellspacing="0" border="0" bgcolor="#996666">';
hed+='<tr>';
hed+='<td>';
hed+='<img src="http://www.makeinu.net/images/navigation/left.gif" width="25" height="19" border="0"><a href="http://www.makeinu.net/index.htm"><img src="http://www.makeinu.net/images/navigation/top.gif" width="50" height="19" border="0" alt="トップページ"></a><a href="http://www.makeinu.net/about/index.htm"><img src="http://www.makeinu.net/images/navigation/about.gif" width="50" height="19" border="0" alt="はじめに"></a><a href="http://www.makeinu.net/cgi-bin/calendar.cgi"><img src="http://www.makeinu.net/images/navigation/board.gif" width="50" height="19" border="0" alt="スケジュール"></a><a href="http://www.makeinu.net/report/index.htm"><img src="http://www.makeinu.net/images/navigation/photo.gif" width="50" height="19" border="0" alt="レースレポート"></a><a href="http://www.makeinu.net/gallery/index.htm"><img src="http://www.makeinu.net/images/navigation/gallery.gif" width="50" height="19" border="0" alt="特設ギャラリー"></a><a href="http://www.makeinu.net/regular/index.htm"><img src="http://www.makeinu.net/images/navigation/content.gif" width="50" height="19" border="0" alt="常設コンテンツ"></a><a href="http://www.makeinu.net/bbs/index.htm"><img src="http://www.makeinu.net/images/navigation/bbs.gif" width="50" height="19" border="0" alt="掲示板"></a><a href="http://www.makeinu.net/recreation/index.htm"><img src="http://www.makeinu.net/images/navigation/other.gif" width="50" height="19" border="0" alt="レクリエーション"></a><a href="http://www.makeinu.net/link/index.htm"><img src="http://www.makeinu.net/images/navigation/link.gif" width="50" height="19" border="0" alt="リンク"></a><a href="mailto:webmaster@makeinu.net"><img src="http://www.makeinu.net/images/navigation/mail.gif" width="50" height="19" border="0" alt="メール"></a><img src="http://www.makeinu.net/images/navigation/right.gif" width="25" height="19" border="0">';
hed+='</td>';
hed+='</tr>';
hed+='</table>';
hed+='</td>';
hed+='</tr>';
hed+='</table>';

/* カテゴリーアイテム */
cat='';
cat+='<table cellpadding="0" cellspacing="0" border="0">';
cat+='<tr><td width="120" height="22" background="http://www.makeinu.net/images/menu/subsub.gif">';
cat+='<a href="http://www.makeinu.net/report/index.htm"><div style="color=#444444; font-size:12px; font-weight:bold;">　レースレポート</div></a>';
cat+='</td></tr>';
cat+='<tr><td>';
cat+='<a href="http://www.makeinu.net/report/index.htm#gymkhana"><font color="#444444">ジムカーナ</font></a><br>';
cat+='<a href="http://www.makeinu.net/report/index.htm#circuit"><font color="#444444">サーキット</font></a><br>';
cat+='<br>';
cat+='</td></tr>';
cat+='<tr><td width="120" height="22" background="http://www.makeinu.net/images/menu/subsub.gif">';
cat+='<a href="http://www.makeinu.net/gallery/index.htm"><div style="color=#444444; font-size:12px; font-weight:bold;">　特設ギャラリー</div></a>';
cat+='</td></tr>';
cat+='<tr><td>';
cat+='<a href="http://www.makeinu.net/gallery/index.htm#car"><font color="#444444">自動車イベント</font></a><br>';
cat+='<a href="http://www.makeinu.net/gallery/index.htm#cm"><font color="#444444">コスプレベント</font></a><br>';
cat+='<a href="http://www.makeinu.net/gallery/index.htm#beauty"><font color="#444444">サイトイベント</font></a><br>';
cat+='<br>';
cat+='</td></tr>';
cat+='<tr><td width="120" height="22" background="http://www.makeinu.net/images/menu/subsub.gif">';
cat+='<a href="http://www.makeinu.net/regular/index.htm"><div style="color=#444444; font-size:12px; font-weight:bold;">　常設コンテンツ</div></a>';
cat+='</td></tr>';
cat+='<tr><td>';
cat+='<a href="http://www.makeinu.net/mr2/index.htm"><font color="#444444">MR通</font></a><br>';
cat+='<a href="http://www.makeinu.net/initialfd/index.htm"><font color="#444444">イニシャルFD</font></a><br>';
cat+='<a href="http://www.makeinu.net/roba/index.shtml"><font color="#444444">ロバのインターネット</font></a><br>';
cat+='<br>';
cat+='</td></tr>';
cat+='<tr><td width="120" height="22" background="http://www.makeinu.net/images/menu/subsub.gif">';
cat+='<a href="http://www.makeinu.net/bbs/index.htm"><div style="color=#444444; font-size:12px; font-weight:bold;">　掲示板</div></a>';
cat+='</td></tr>';
cat+='<tr><td>';
cat+='<tr><td>';
cat+='<a href="http://www.makeinu.net/cgi-bin/trdbbs2.cgi"><font color="#444444">通常板</font></a><br>';
cat+='<a href="http://www.makeinu.net/cgi-bin/trdbbs3.cgi"><font color="#444444">走行板</font></a><br>';
cat+='<a href="http://www.makeinu.net/bbs/imgbbs/list.cgi"><font color="#444444">画像板</font></a><br>';
cat+='<a href="http://www67.tcup.com/6724/trd.html"><font color="#444444">遊戯板</font></a><br>';
cat+='<a href="http://www.tcup5.com/508/efd3s.html"><font color="#444444">臨時板</font></a><br>';
cat+='<br>';
cat+='</td></tr>';
cat+='<tr><td width="120" height="22" background="http://www.makeinu.net/images/menu/subsub.gif">';
cat+='<a href="http://www.makeinu.net/recreation/index.htm"><div style="color=#444444; font-size:12px; font-weight:bold;">　レクリエーション</div></a>';
cat+='</td></tr>';
cat+='<tr><td>';
cat+='<a href="http://www.makeinu.net/cgi-bin/carquiz.cgi"><font color="#444444">クルマカルトクイズ</font></a><br>';
cat+='<a href="http://www.makeinu.net/cgi-bin/trd3way.cgi"><font color="#444444">目指せ雑学王</font></a><br>';
cat+='<a href="http://www.makeinu.net/recreation/minich/index.htm"><font color="#444444">みにちゃんねる</font></a><br>';
cat+='<br>';
cat+='</td></tr>';
cat+='<tr><td width="120" height="22" background="http://www.makeinu.net/images/menu/subsub.gif">';
cat+='<a href="http://www.makeinu.net/link/index.htm"><div style="color=#444444; font-size:13px; font-weight:bold;">　リンク</div></a>';
cat+='</td></tr>';
cat+='<tr><td>';
cat+='<a href="http://www.makeinu.net/link/link1.htm#maker"><font color="#444444">メーカー</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link1.htm#works"><font color="#444444">ワークス</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link1.htm#parts"><font color="#444444">パーツ</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link1.htm#shop"><font color="#444444">ショップ</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link1.htm#books"><font color="#444444">雑誌</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link1.htm#event"><font color="#444444">イベント・ショールーム</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link1.htm#circuit"><font color="#444444">サーキット</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link1.htm#race"><font color="#444444">レース</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link1.htm#traffic"><font color="#444444">道路・交通情報</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link2.htm#game"><font color="#444444">ゲーム・占い</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link2.htm#owners"><font color="#444444">チーム・クラブ</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link2.htm#kscc"><font color="#444444">自動車</font></a><br>';
cat+='<a href="http://www.makeinu.net/link/link2.htm#friends"><font color="#444444">お店・お仲間</font></a><br>';
cat+='<br>';
cat+='</td>';
cat+='</tr>';
cat+='</table>';

/* カスタマイズアイテム */
cst="";
cst+='<center>';
cst+='<table cellpadding="0" cellspacing="0" border="0">';
cst+='<tr>';
cst+='<td align="center" width="145" height="17" background="images/menu/tlink.gif">';
cst+='<div style="color=#000000; font-size:13px; font-weight:bold;">Customize</div>';
cst+='</td>';
cst+='</tr>';
cst+='</table>';
cst+='</center>';
cst+='<table width="165" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFDDDD">';
cst+='<tr>';
cst+='<td><img src="images/table_link/ycorner1.gif" width="10" height="10"></td>';
cst+='<td background="images/table_link/yline1.gif"><img src="images/table_left/yspacer.gif" width="1" height="1"></td>';
cst+='<td><img src="images/table_link/ycorner2.gif" width="10" height="10"></td>';
cst+='</tr>';
cst+='<tr>';
cst+='<td background="images/table_link/yline2.gif"><img src="images/table_left/yspacer.gif" width="1" height="1"></td>';
cst+='<td background="images/table_link/ytable.gif" width="100%">';
cst+='<font style="filter:DropShadow(OffX=2,OffY=2,Color=#D8D897,Positive=true); height:12; color:#9F3F3E;">';
cst+='<table width="145" cellpadding="0" cellspacing="0" border="0">';
cst+='<tr>';
cst+='<td width="15" height="22" background="images/menu/off.gif"></td>';
cst+='<td width="130" height="22" background="images/menu/default.gif">';
cst+='<a href="link/index.htm">';
cst+='<div style="color=#333333; font-size:13px; font-weight:bold;">カスタマイズ</div>';
cst+='</a>';
cst+='</td>';
cst+='</tr>';
cst+='</table>';
cst+='<table>';
cst+='<tr>';
cst+='<td>';
cst+='<form>';
cst+='バックグラウンド<br>';
cst+='<input type=radio name=imgradio '+chkflg31+' onClick=changeBgclr(1)>赤';
cst+='<input type=radio name=imgradio '+chkflg32+' onClick=changeBgclr(2)>黄';
cst+='<input type=radio name=imgradio '+chkflg33+' onClick=changeBgclr(3)>白';
cst+='<br>';
cst+='<input type=radio name=imgradio '+chkflg34+' onClick=changeBgclr(4)>緑';
cst+='<input type=radio name=imgradio '+chkflg35+' onClick=changeBgclr(5)>青';
cst+='<input type=radio name=imgradio '+chkflg36+' onClick=changeBgclr(6)>黒';
cst+='</form>';
cst+='<form>';
cst+='フォント<br>';
cst+='<input type=radio name=imgradio '+chkflg41+' onClick=changeFgclr(1)><img src=images/blk.gif>';
cst+='<input type=radio name=imgradio '+chkflg42+' onClick=changeFgclr(2)><img src=images/gry.gif>';
cst+='<input type=radio name=imgradio '+chkflg43+' onClick=changeFgclr(3)><img src=images/grn.gif>';
cst+='<input type=radio name=imgradio '+chkflg44+' onClick=changeFgclr(4)><img src=images/ylw.gif>';
cst+='</form>';
cst+='</td>';
cst+='</tr>';
cst+='</table>';
cst+='<table><tr><td><font size="-2">';
cst+='Version 2006では、カスタマイズ機能はまだ実装されていません。<br>(試用版です)<br>';
cst+='</font></td></tr></table>';
cst+='</td>';
cst+='<td background="images/table_link/yline3.gif"><img src="spacer.gif" width="1" height="1"></td>';
cst+='</tr>';
cst+='<tr>';
cst+='<td><img src="images/table_link/ycorner3.gif" width="10" height="10"></td>';
cst+='<td background="images/table_link/yline4.gif"><img src="images/table_left/yspacer.gif" width="1" height="1"></td>';
cst+='<td><img src="images/table_link/ycorner4.gif" width="10" height="10"></td>';
cst+='</tr>';
cst+='</table>';
cst+='<br>';

