//////////////////////////////////////////////////////////////////////
//	共通のJavaScript
//		最終更新日時 : 2010年 3月 2日(火) 23時34分17秒
//////////////////////////////////////////////////////////////////////


////////// 基本URL情報
var WtPageCreator   = 'ほわいと';
var WtPageMainURL   = 'http://wtpage.info/';
var WtPageImageURL  = 'http://wtpage.info/images/';
var WtPageSourceURL = 'http://white.hobby-web.net/sources/';

var WtPageBaseURL   = 'http://wtpage.info/';
var CommufaBaseURL  = 'http://www.wa.commufa.jp/wtpage/';
var WakWakBaseURL   = 'http://park1.wakwak.com/~shiraki/';
var HomeSrvBaseURL  = 'http://wtpage.info/';
var Tok2ProBaseURL  = 'http://white.hobby-web.net/html/';
// var TokTokBaseURL   = 'http://www57.tok2.com/home/shiraki/';
// var YahooBaseURL    = 'http://www.geocities.jp/whitebowling/';
// var Fc2BaseURL      = 'http://wtpage.web.fc2.com/bowling/';
var InfoseekBaseURL = 'http://wt1.ld.infoseek.co.jp/';

////////// 空行用
var Space5 = '<img width="100%" height="5" alt="" src="'+WtPageImageURL+'sp.png" /><br />';
var Space2 = '<img width="100%" height="2" alt="" src="'+WtPageImageURL+'sp.png" /><br />';
var Space = Space2;


////////// ページ最上部の情報
function ShowTopInfo(clock, jsnote, engnote) {
  var count = 0;
  if ( clock != 0 ) count++;
  if ( jsnote != 0 ) count++;
  if ( engnote != 0 ) count++;
  if ( count > 0 ) {
    document.write('<div align="right" style="margin:0px; padding:0px;">');
    if ( jsnote != 0 ) {
      InsertSpace(10, -1);
      document.write('<span class="jsnote">This page needs javascript.</span>');     }
    if ( engnote != 0 ) {
      InsertSpace(10, -1);
      document.write('<span class="engnote">This page is designed for Internet Explorer with only Japanese.</span>');
    }
    if ( clock != 0 ) {
      InsertSpace(10, -1);
      document.write('<span class="wtclock" id="WtClock"></span>');
      InsertSpace(10, -1);
    }
    document.write('</div>');
    if ( clock != 0 ) {
      RefreshClock();
      window.setInterval("RefreshClock()", 1000);
    }
  }
  return;
}


////////// カウンタの表示
function ShowCounter(year, month, day, id) {
  var current  = new Date();
  var nowyear  = current.getYear();
  var nowmonth = current.getMonth()+1;
  var nowdate  = current.getDate();
  var cgi = WtPageMainURL+'cgi-bin/wtcount/wtcount';
  var alt;

  // 年号のチェック
  if ( year*512+month*32+day > nowyear*512+nowmonth*32+nowdate ) return;

  // document.write('<table align="right"><tr><td class="jscounter">');
  // if ( year != undefined && month != undefined && day != undefined ) {
  //   alt = 'Counter since '+month+'/'+day+'/'+year;
  // }
  // else {
  //   alt = 'Counter';
  // }
  // document.write('<img alt="'+alt+'" src="'+cgi+'?id='+id+'&fig=8&gif=11" />');
  // document.write('</td></tr></table><br clear=all />');

  document.write('<script type="text/javascript" src="'+cgi+'?id='+id+'&fig=8&js"></script>');

  return;
}


////////// 著作権情報＆カウンタ
function ShowCopyright(year, month, day, id) {
  ShowPageInfo(year, month, day, id);
}
function ShowPageInfo(year, month, day, id) {
  var current = new Date();
  var nowyear = current.getYear();
  var cgi = WtPageMainURL+'cgi-bin/wtcount/wtcount';

  if ( nowyear < 1900 ) nowyear += 1900;
  document.write('<div class="copyright">');
  if ( year == undefined || year == nowyear ) {
    document.write('Copyright (C) '+nowyear+' '+WtPageCreator+', All Rights Reserved.');
  }
  else {
    document.write('Copyright (C) '+year+'-'+nowyear+' '+WtPageCreator+', All Rights Reserved.');
  }
  document.write(' Written by <a href="'+WtPageMainURL+'sendmail.html">'+WtPageCreator+'</a>');
  document.write('</div>');
  if ( id != undefined ) {
    if ( NoBanner != undefined && NoBanner == 0 ) {
      document.write('<script type="text/javascript" src="'+cgi+'?id='+id+'&fig=8&js"></script>');
    }
  }
  if ( NoBanner != undefined && NoBanner == 0 ) {
    document.write('<div class="wtpage">');
    document.write('<script type="text/javascript" src="http://wtpage.info/cgi-bin/wtintro/wtintro"></script>');
    document.write('</div>');
  }
  else {
    document.write('<div class="wtpage">');
    document.write('<a href="http://wtpage.info/info.html"><img alt="wtpage.info" border="0" width="72" height="18" src="images/wtpage.png" /></a>');
    document.write('</div>');
  }

  return;
}


////////// グラデーション領域
function AreaOpen(width, color, padding, image) {
  var imagebase = 'images/';
  var back = '';
  var style = '';

  if ( location.href.indexOf('tytlabs.co.jp') >= 0 ) {
    imagebase = 'images/';
  }
  else if ( image == 1 ) {
    imagebase = WtPageImageURL;
  }
  else if ( image == 2 ) {
    imagebase = 'http://wtpage.info/images/';
  }
  else {
    imagebase = 'images/';
  }

  if ( width != undefined && width != '' ) {
    width = 'width="'+width+'"';
  }

  if ( color == 'bc' ) {
    back = '#ccffff';
  }
  else if ( color == 'cd' ) {
    back = '#000099';
  }
  else if ( color == 'gd' ) {
    back = '#006600';
  }
  else if ( color == 'gl' ) {
    back = '#ccffcc';
  }
  else if ( color == 'oy' ) {
    back = '#ffffcc';
  }
  else if ( color == 'rly' ) {
    back = '#ffffcc';
  }
  else if ( color == 'ry' ) {
    back = '#ffff00';
  }
  else { // color == 'gy'
    color = 'gy';
    back = '#ffffcc';
  }

  if ( padding != undefined && padding != '' ) {
    padding = 'padding:'+padding+';';
  }

  if ( padding != '' ) {
    style = 'style="'+padding+'"';
  }

  document.write('<table '+width+' cellspacing="0" cellpadding="0">');
  document.write('<tr>');
  // document.write('<td width="8"><img alt="" width="8" height="8" src="'+imagebase+'frame-'+color+'-tl.png"></td>');
  document.write('<td width="8" height="8" background="'+imagebase+'frame-'+color+'-tl.png"></td>');
  document.write('<td height="8" background="'+imagebase+'frame-'+color+'-t.png"></td>');
  // document.write('<td width="8"><img alt="" width="8" height="8" src="'+imagebase+'frame-'+color+'-tr.png"></td>');
  document.write('<td width="8" height="8" background="'+imagebase+'frame-'+color+'-tr.png"></td>');
  document.write('</tr>');
  document.write('<tr>');
  document.write('<td height="8" background="'+imagebase+'frame-'+color+'-l.png"></td>');
  document.write('<td bgcolor="'+back+'" '+style+'>');

  return;
}


////////// グラデーション領域
function AreaClose(color, image) {
  var imagebase = 'images/';
  var back = '';

  if ( location.href.indexOf('tytlabs.co.jp') >= 0 ) {
    imagebase = 'images/';
  }
  else if ( image == 1 ) {
    imagebase = WtPageImageURL;
  }
  else if ( image == 2 ) {
    imagebase = 'http://wtpage.info/images/';
  }
  else {
    imagebase = 'images/';
  }

  if ( color == 'bc' ) {
  }
  else if ( color == 'cd' ) {
  }
  else if ( color == 'gd' ) {
  }
  else if ( color == 'gl' ) {
  }
  else if ( color == 'oy' ) {
  }
  else if ( color == 'rly' ) {
  }
  else if ( color == 'ry' ) {
  }
  else { // color == 'gy'
    color = 'gy';
  }

  document.write('</td>');
  document.write('<td background="'+imagebase+'frame-'+color+'-r.png"></td>');
  document.write('</tr>');
  document.write('<tr>');
  // document.write('<td><img alt="" width="8" height="8" src="'+imagebase+'frame-'+color+'-bl.png"></td>');
  document.write('<td width="8" height="8" background="'+imagebase+'frame-'+color+'-bl.png"></td>');
  document.write('<td height="8" background="'+imagebase+'frame-'+color+'-b.png"></td>');
  // document.write('<td><img alt="" width="8" height="8" src="'+imagebase+'frame-'+color+'-br.png"></td>');
  document.write('<td width="8" height="8" background="'+imagebase+'frame-'+color+'-br.png"></td>');
  document.write('</tr>');
  document.write('</table>');

  return;
}


////////// タイトル
function ShowTitle1(comment, image) {
  var imagebase = 'images/';

  if ( location.href.indexOf('tytlabs.co.jp') >= 0 ) {
    imagebase = 'images/';
  }
  else if ( image == 1 ) {
    imagebase = WtPageImageURL;
  }
  else if ( image == 2 ) {
    imagebase = 'http://wtpage.info/images/';
  }
  else {
    imagebase = 'images/';
  }

  document.write('<table width="100%" cellspacing="0" cellpadding="0" style="margin:10px 0px;">');
  document.write('<tr><td width="100%" height="64" background="'+imagebase+'backbar64-orange.png" style="padding:0px 20px; color:#003300; background-repeat:repeat-x; font-size:40px; font-weight:bold;">');
  document.write(comment);
  document.write('</td></tr>');
  document.write('</table>');
}

function ShowTitle2(comment, image) {
  var imagebase = 'images/';

  if ( location.href.indexOf('tytlabs.co.jp') >= 0 ) {
    imagebase = 'images/';
  }
  else if ( image == 1 ) {
    imagebase = WtPageImageURL;
  }
  else if ( image == 2 ) {
    imagebase = 'http://wtpage.info/images/';
  }
  else {
    imagebase = 'images/';
  }

  AreaOpen('95%', 'gl', '5px', image);

  document.write('<div style="color:#003300; font-size: 200%; font-weight: bold;">');
  document.write(comment);
  document.write('</div>');

  AreaClose('gl', image);

  return;
}

function ShowTitle3(comment, image) {
  var imagebase = 'images/';

  if ( location.href.indexOf('tytlabs.co.jp') >= 0 ) {
    imagebase = 'images/';
  }
  else if ( image == 1 ) {
    imagebase = WtPageImageURL;
  }
  else if ( image == 2 ) {
    imagebase = 'http://wtpage.info/images/';
  }
  else {
    imagebase = 'images/';
  }

  InsertSpace(10, 5);
  document.write('<table cellspacing="0" cellpadding="0">');
  document.write('<tr><td height="32" background="'+imagebase+'backbar32-cyan.png" style="padding:0px 20px; color:#003300; background-repeat:repeat-x; font-size:18px; font-weight:bold;">');
  document.write(comment);
  document.write('</td></tr>');
  document.write('</table>');
}


////////// クッキーの取得と保存
function GetCookie(key) {
  var tmp = document.cookie + ";";
  var index1 = tmp.indexOf(key+"=", 0);
  if ( index1 != -1 ) {
    tmp = tmp.substring(index1, tmp.length);
    var index2 = tmp.indexOf("=", 0) + 1;
    var index3 = tmp.indexOf(";", index2);
    return(unescape(tmp.substring(index2, index3)));
  }
  return("");
}

////////// クッキー保存
function SetCookie(key, val) {
  document.cookie = key + "=" + escape(val) + ";expires=Fri, 31-Dec-2030 23:59:59;";
  return;
}


////////// ページジャンプ
function PageJump(Object) {
  if ( Object.options[Object.selectedIndex].value != "" ) {
    location.href = Object.options[Object.selectedIndex].value;
  }
  return;
}


////////// ダウンロード
function Download(siteFile, target) {
  var cgi = WtPageMainURL+'cgi-bin/download/download.cgi';
  var FileName;
  var url;

  switch ( siteFile ) {
  default:
  case 0:
    // Tok2 Professional
    FileName = WtPageSourceURL + target;
    break;
  case 1:
    // ホームサーバ
    FileName = WtPageMainURL+'sources/' + target;
    break;
  case 2:
    // Infoseek 1
    FileName = 'http://wt1.hp.infoseek.co.jp/sources/' + target;
    break;
  case 3:
    // Infoseek 2
    FileName = 'http://wt1.ld.infoseek.co.jp/sources/' + target;
    break;
  case 4:
    // Infoseek 3
    FileName = 'http://n-shiraki.ld.infoseek.co.jp/sources/' + target;
    break;
  }

  url = cgi+'?file=' + FileName;

  location.href = url;

  return;
}


////////// 選択ダウンロード
function SelectDownload(Object) {
  if ( Object.options[Object.selectedIndex].value != "" ) {
    Download(1, Object.options[Object.selectedIndex].value);
  }
  return;
}


////////// 幅設定
function SetWidth(cls, size) {
  var i;
  for ( i = 0 ; i < document.all.length ; i++ ) {
    if ( document.all(i).className == cls ) {
      document.all(i).style.width = size;
    }
  }
  return;
}


////////// フォントサイズ設定
function SetFontSize(cls, size) {
  var i;
  for ( i = 0 ; i < document.all.length ; i++ ) {
    if ( document.all(i).className == cls ) {
      document.all(i).style.fontSize = size;
    }
  }
  return;
}


////////// 曜日取得
function GetWeekday(year, month, day) {
  var wday;
  var days = new Array("日", "月", "火", "水", "木", "金", "土");

  if ( month <= 2 ) {
    // 1月，2月は前年の13月，14月と見なして計算
    month += 12;
    year--;
  }

  // Zellerの公式
  wday = ( ( year + Math.floor(year/4) - Math.floor(year/100)
		  + Math.floor(year/400) + Math.floor(2.6*month+1.6) + day ) % 7 );

  return days[wday];
}


////////// 日別・曜日別アナウンス
function Announce(year, mon, date, day, from, to, message) {
  var current  = new Date();
  var nowyear  = current.getYear();
  var nowmonth = current.getMonth()+1;
  var nowdate  = current.getDate();
  var nowday   = current.getDay();
  var nowhour  = current.getHours();

  if ( nowyear < 1900 ) {
    nowyear += 1900;
  }

  if (
	( year == -1 || year == nowyear )
	&&
	( mon  == -1 || mon  == nowmonth )
	&&
	( date == -1 || date == nowdate )
	&&
	( day  == -1 || day  == nowday )
	&&
	( from == -1 || from <= nowhour )
	&&
	( to   == -1 || to   >= nowhour )
     ) {
    document.write('<div class="announce">');
    document.write(message);
    document.write('</div>');
  }

  return;
}


////////// 特別な日のあいさつ
function ShowSpecialDay() {
  var current  = new Date();
  var nowyear  = current.getYear();
  var nowmonth = current.getMonth()+1;
  var nowdate  = current.getDate();
  var nowday   = current.getDay();
  var nowhour  = current.getHours();

  var imagebase = 'images/';

  if ( location.href.indexOf('tytlabs.co.jp') >= 0 ) {
    imagebase = 'images/';
  }
  else if ( location.href.indexOf('Help/') >= 0 || location.href.indexOf('Help\\') >= 0 ) {
    imagebase = 'images/';
  }
  else if ( location.href.indexOf('/cgi-bin/') >= 0 ) {
    imagebase = 'http://wtpage.info/images/';
  }
  else {
    imagebase = WtPageImageURL;
  }

  if ( nowyear < 1900 ) {
    nowyear += 1900;
  }

  if ( nowmonth == 1 && nowdate >= 1 && nowdate <= 21 ) {
    document.write('<div class="announce">');
    document.write('あけましておめでとうございます！ 今年もよろしくお願いします<br /><a href="'+WtPageMainURL+'happy/newyear'+nowyear+'.html" target="_blank"><img alt="新年のごあいさつ" border="0" src="'+imagebase+'banner-newyear.png"></a>');
    document.write('</div>');
  }
  else if ( nowmonth == 12 && nowdate == 31 ) {
    document.write('<div class="announce">');
    document.write('大晦日です．今年もあとわずか・・・');
    document.write('</div>');
  }
  else if ( nowmonth == 8 && nowdate == 26 ) {
    document.write('<div class="announce">');
    document.write('明日は何の日でしょう？？（笑）');
    document.write('</div>');
  }
  else if ( nowmonth == 8 && nowdate == 27 ) {
    document.write('<div class="announce">');
    document.write('今日は管理人の誕生日でーす♪');
    document.write('</div>');
  }
  else if ( nowmonth == 6 && nowdate == 21 ) {
    document.write('<div class="announce">');
    document.write('<a href="'+WtPageMainURL+'bowling/">明日はボウリングの日です！</a>');
    document.write('</div>');
  }
  else if ( nowmonth == 6 && nowdate == 22 ) {
    document.write('<div class="announce">');
    document.write('<a href="'+WtPageMainURL+'bowling/">今日はボウリングの日です！</a>');
    document.write('</div>');
  }

  return;
}


////////// 新年のメッセージ
function NewYear(year, message) {
  var current  = new Date();
  var nowyear  = current.getYear();
  var nowmonth = current.getMonth()+1;
  var nowdate  = current.getDate();
  var nowday   = current.getDay();
  var nowhour  = current.getHours();

  if ( nowyear < 1900 ) {
    nowyear += 1900;
  }

  if ( nowyear == year && nowmonth == 1 && nowdate >= 1 && nowdate <= 21 ) {
    document.write('<div class="announce">');
    document.write(message);
    document.write('</div>');
  }

  return;
}


////////// 線
function ShowLine(color) {
  if ( color == undefined ) color = 'blue';
  document.write('<div>');
  document.write('<img width="100%" height="5" alt="" src="'+WtPageImageURL+'hr-'+color+'.png" />');
  document.write('</div>');
  return;
}


////////// 点
function ShowPoint(color) {
  if ( color == undefined ) color = 'pink';
  document.write('<img alt="" align="middle" src="'+WtPageImageURL+'point-'+color+'.png" /> ');
  return;
}


////////// 空白
function InsertSpace(width, height) {
  var w = width, h = height;
  if ( width == undefined || width == '' || width < 1 ) w = '100%';
  if ( height == undefined || height == '' || height < 1 ) h = 5;
  document.write('<img width="'+w+'" height="'+h+'" alt="" src="'+WtPageImageURL+'sp.png" />');
  if ( height > 0 ) document.write('<br />');
  return;
}


////////// リンク
function ShowOneLink(url, name, width, color, bold, blank) {
  ShowOneLink20(url, name, width, color, bold, blank);
}
function ShowOneLink16(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '16', '10px');
}
function ShowOneLink20(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '20', '12px');
}
function ShowOneLink24(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '24', '14px');
}
function ShowOneLink28(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '28', '16px');
}
function ShowOneLink32(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '32', '18px');
}
function ShowOneLink36(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '36', '20px');
}
function ShowOneLink40(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '40', '22px');
}
function ShowOneLink44(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '44', '24px');
}
function ShowOneLink48(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '48', '26px');
}
function ShowOneLink52(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '52', '28px');
}
function ShowOneLink56(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '56', '30px');
}
function ShowOneLink60(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '60', '32px');
}
function ShowOneLink64(url, name, width, color, bold, blank) {
  ShowOneLinkDetail(url, name, width, color, bold, blank, '64', '36px');
}
function ShowOneLinkDetail(url, name, width, color, bold, blank, barsize, fontsize) {
  var html = '';
  var imagebase = 'images/';

  if ( location.href.indexOf('tytlabs.co.jp') >= 0 ) {
    imagebase = 'images/';
  }
  else if ( location.href.indexOf('bowling/') >= 0 || location.href.indexOf('Help/') >= 0 || location.href.indexOf('Help\\') >= 0 ) {
    imagebase = 'images/';
  }
  else if ( location.href.indexOf('/cgi-bin/') >= 0 ) {
    imagebase = 'http://wtpage.info/images/';
  }
  else {
    imagebase = WtPageImageURL;
  }

  if ( color == undefined || color == '' ) color = 'cyan';
  if ( bold == undefined ) bold = '';
  if ( barsize == undefined || barsize == '' ) barsize = '16';
  if ( fontsize == undefined || fontsize == '' ) fontsize = '12ps';
  if ( blank == undefined || blank == '' ) {
    blank = '';
  }
  else {
    blank = ' target="_blank"';
  }

  if ( width != undefined && width != '' ) {
    html += '<td width="'+width+'" height="'+barsize+'" valign="middle" align="center" background="'+imagebase+'backbar'+barsize+'-'+color+'.png" style="font-size: '+fontsize+'; background-repeat: repeat-x;">';
  }
  else {
    html += '<td height="'+barsize+'" valign="middle" align="center" background="'+imagebase+'backbar'+barsize+'-'+color+'.png" style="font-size: '+fontsize+'; background-repeat: repeat-x;">';
  }
  if ( url != '' ) {
    html += '<a href="' + url + '" style="width:100%; padding:0px 5px;"'+blank+'>';
  }
  else {
    html += '<font color="#999999">';
  }
  if ( bold != '' ) {
    html += '<b>' + name + '</b>';
  }
  else {
    html += name;
  }
  if ( url != '' ) {
    html += '</a>';
  }
  else {
    html += '</font>';
  }
  html += '</td>';

  document.write(html);

  return;
}

function ShowLink(url, name, color, bold) {
  var html = '';

  if ( color == undefined || color == '' ) color = 'cyan';

  document.write('<tr>');
  ShowOneLink(url, name, '100%', color, bold);
  document.write('</tr>');

  return;
}

function ShowMirror(url, name) {
  document.write('<tr>');
  ShowOneLink(url, name, '100%', 'green');
  document.write('</tr>');
  return;
}


////////// リンクリスト：メインページ
function ShowLinkMain() {
  ShowMainLink();
}
function ShowLinkMainSub() {
  ShowMainLink();
}
function ShowMainLink() {
  var sp = Space2;
  var wakwak   = 'http://park1.wakwak.com/~shiraki/';
  var wtpage   = WtPageMainURL;
  var homesrv  = 'http://wtpage.info/';
  var tok2pro  = 'http://white.hobby-web.net/html/';
  // var fc2      = 'http://wtpage.web.fc2.com/';
  var infoseek = 'http://wt1.ld.infoseek.co.jp/';
  var base     = wakwak;

  BannerTitle('サイト内リンク', 'サイト内の主要リンクです');

  // サイトマップ
  document.write('<table width="100%" cellspacing="0" cellpadding="0">');
  ShowLink(base+'sitemap.html', 'サイトマップ', 'red', 1);
  document.write('</table>');
  document.write(sp);

  // ミラーサイト
  document.write('<table width="100%" cellspacing="1" cellpadding="0" bgcolor="#009900"><tr><th bgcolor="#00ff00" style="color:#0000ff; font-size:13px;">ミラーサイト</th></tr></table>');
  document.write('<table width="100%" cellspacing="0" cellpadding="0">');
  ShowMirror(wtpage,   'メインサーバ');
  ShowMirror(wakwak,   'わくわく');
  ShowMirror(tok2pro,  'Tok2 Pro');
  // ShowMirror(fc2,      'FC2');
  ShowMirror(homesrv,  'ホームサーバ');
  ShowMirror(infoseek, 'Infoseek');
  document.write('</table>');
  document.write(sp);

  ShowMainPages();

  return;
}


////////// リンクリスト
function ShowMainPages() {
  var wtpage   = WtPageMainURL;
  var wakwak   = 'http://park1.wakwak.com/~shiraki/';
  var homesrv  = 'http://wtpage.info/';
  var tok2pro  = 'http://white.hobby-web.net/html/';
  var infoseek = 'http://wt1.ld.infoseek.co.jp/';
  var base     = wakwak;

  // メインページ
  document.write('<table width="100%" cellspacing="1" cellpadding="0" bgcolor="#0000ff"><tr><th bgcolor="#00ffff" style="color:#0000ff; font-size:13px;">ページリンク</th></tr></table>');
  document.write('<table width="100%" cellspacing="0" cellpadding="0">');
  ShowLink(wtpage,                                'メインページ');
  ShowLink(wakwak+'bowling/',                     'ボウリング講座');
  ShowLink(wtpage+'go/',                          '囲碁のページ');
  // ShowLink(wtpage+'radioactor/',                  'あの声優さん？');
  ShowLink(wtpage+'wtseries/',                    'WtSeries');
  ShowLink(wtpage+'download/',                    'ダウンロード');
  ShowLink(wtpage+'anpanman/',                    'アンパンマン');
  ShowLink(wtpage+'program/',                     'プログラム');
  ShowLink(wtpage+'pclecture/',                   'パソコン講座');
  ShowLink(wtpage+'wordbook/',                    '日常生活の英単語');
  ShowLink(wtpage+'themepark/',                   'テーマパーク情報');
  ShowLink(tok2pro+'gallery/',                    '写真館');
  ShowLink(wtpage+'dajare/',                      'だじゃれ');
  ShowLink(wtpage+'sendmail.html',                'メール送信');
  ShowLink(wtpage+'link.html',                    'リンク集');
  ShowLink(wtpage+'homeserver/',                  'ホームサーバ');
  ShowLink(wtpage+'drama/',                       'ドラマ鑑賞');
  ShowLink(wtpage+'sponsor.html',                 '広告一覧');
  // ShowLink(wtpage+'movie/',                       '映画鑑賞');
  // ShowLink(wtpage+'book/',                        '読書鑑賞');
  // ShowLink(wtpage+'number/',                      'ごろあわせ');
  // ShowLink(wtpage+'cgi-bin/wtnpb/wtnpb.cgi?mobile',         'プロ野球速報');
  document.write('</table>');

  return;
}


////////// 各ページへのリンク
function ShowLinkToMainPage() {
  var wtpage  = WtPageMainURL;
  var wakwak  = 'http://park1.wakwak.com/~shiraki/';
  var tok2pro = 'http://white.hobby-web.net/html/';
  var base = wakwak;

  document.write('<table cellspacing="2" cellpadding="0"><tr>');
  ShowOneLink20(wtpage,             'メインページ',   '20%', 'cyan', 1);
  ShowOneLink20(base+'bowling/',    'ボウリング講座', '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'go/',       '囲碁のページ',   '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'wtseries/', 'WtSeries',       '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'download/', 'ダウンロード',   '20%', 'cyan', 1);
  document.write('</tr>');
  document.write('<tr>');
  ShowOneLink20(wtpage+'anpanman/',  'アンパンマン',     '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'program/',   'プログラム',       '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'pclecture/', 'パソコン講座',     '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'wordbook/',     '日常生活の英単語', '20%', 'cyan', 1);
  // ShowOneLink20(wtpage+'radioactor/', 'あの声優さん？',   '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'themepark/', 'テーマパーク情報', '20%', 'cyan', 1);
  document.write('</tr>');
  document.write('<tr>');
  ShowOneLink20(wtpage+'drama/',        'ドラマ鑑賞', '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'webpage/',      'HTML講座',   '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'dajare/',       'だじゃれ',   '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'sponsor.html',  '広告一覧',   '20%', 'cyan', 1);
  ShowOneLink20(wtpage+'sendmail.html', 'メール送信', '20%', 'cyan', 1);
  document.write('</tr></table>');

  return;
}


////////// アクセス時刻
function AddSpace(val) {
  if ( val < 10 ) {
    document.write(" ");
  }
  return;
}
function ShowTime(time) {
  var nowyear = current.getYear();

  if ( nowyear < 1900 ) {
    nowyear += 1900;
  }

  document.write(nowyear, "年");
  AddSpace(time.getMonth()+1);
  document.write(time.getMonth()+1, "月");
  AddSpace(time.getDate());
  document.write(time.getDate(), "日");
  // document.write("(", datestring[time.getDay()], ")");
  // document.write(" ");
  AddSpace(time.getHours());
  document.write(time.getHours(), "時");
  AddSpace(time.getMinutes());
  document.write(time.getMinutes(), "分");
  AddSpace(time.getSeconds());
  document.write(time.getSeconds(), "秒");
  return;
}
function ShowNowTime() {
  var current = new Date();
  document.write("現在時刻 : ");
  ShowTime(current);
  document.write("<br />");
}
function ShowLastModified() {
  var str = document.lastModified;
  document.write("更新時刻 : ");
  document.write(str.substr(6, 4), "年");
  AddSpace(str.substr(0, 2)*1);
  document.write(str.substr(0, 2)*1, "月");
  AddSpace(str.substr(3, 2)*1);
  document.write(str.substr(3, 2)*1, "日");
  document.write(" ");
  AddSpace(str.substr(11, 2)*1);
  document.write(str.substr(11, 2), "時");
  AddSpace(str.substr(14, 2)*1);
  document.write(str.substr(14, 2)*1, "分");
  AddSpace(str.substr(17, 2)*1);
  document.write(str.substr(17, 2)*1, "秒");
  document.write("<br />");
  return;
}
function ShowTimes() {
  ShowNowTime();
  ShowLastModified();
  return;
}


////////// リンクつきイメージ
function ShowImageWithLink(image, alt, width, height, align) {
  if ( alt == undefined ) alt = '';
  if ( align == undefined || align == '' ) {
    align = '';
  }
  else {
    align = 'align='+align;
  }
  if ( width == undefined || width <= 0 ) {
    width = '';
  }
  else {
    width = 'width="'+width+'"';
  }
  if ( height == undefined || height <= 0 ) {
    height = '';
  }
  else {
    height = 'height="'+height+'"';
  }

  document.write('<a href="'+image+'" target="_blank">');
  document.write('<img alt="'+alt+'" '+align+' '+width+' '+height+' src="'+image+'" />');
  document.write('</a>');

  return;
}


////////// 動画
function ShowMovie(movie, image, width, comment, bowling) {
  // var cgi = 'http://white.hobby-web.net/cgi-bin/gallery/showmovie.cgi';
  var cgi = 'http://wtpage.info/cgi-bin/gallery/showmovie.cgi';
  var html;

  if ( movie == undefined || movie == '' ) return;
  if ( image == undefined ) image = '';
  if ( comment == undefined ) comment = '';
  if ( width == undefined || width == '' ) {
    width = '';
  }
  else {
    width = 'width="' + width + '"';
  }

  if ( bowling != undefined ) {
    bowling = '&bowling=1';
  }
  else {
    bowling = '';
  }

  html = '<div style="margin:2px;"><b>';

  if ( comment != '' ) {
    html += '<a href="'+cgi+'?file='+escape(movie)+'&comment='+comment+bowling+'">';
  }
  else {
    html += '<a href="'+cgi+'?file='+escape(movie)+bowling+'">';
  }
  if ( image != '' ) {
    html += '<img alt="'+comment+'" '+width+' src="'+image+'" />';
    if ( comment != '' ) {
      html += '<br />';
      html += comment+'の動画';
    }
  }
  else {
    if ( comment != '' ) {
      html += '→ '+comment+'の動画';
    }
  }
  html += '</a>';
  html += '</b></div>';

  document.write(html);

  return;
}


////////// お気に入り登録
function WtFavorite(linkurl, name) {
  var browserVersion = navigator.appVersion.charAt(0);
  var browserName = navigator.appName.charAt(0);

  if ( linkurl != undefined && name != undefined ) {
    if ( ( browserVersion >= 4 ) && ( browserName == "M" ) ) {
      window.external.AddFavorite(linkurl, name);
    }
    else {
      // window.alert("IE4以上のみの対応");
    }
  }

  return;
}


////////// 検索ウィンドウ
function ShowSearch(word) {
  var cgi;
  var image;

  if ( NoBanner != undefined && NoBanner != 0 ) return;

  if ( location.href.indexOf('tlu.tytlabs.co.jp') >= 0 ) {
    cgi   = 'http://www.tlu.tytlabs.co.jp/cgi-bin/';
    image = 'http://www.tlu.tytlabs.co.jp/images/';
  }
  else if ( location.href.indexOf('tytlabs.co.jp') >= 0 ) {
    cgi   = 'http://acerola.mosk.tytlabs.co.jp/cgi-bin/';
    image = 'http://acerola.mosk.tytlabs.co.jp/images/';
  }
  else {
    cgi   = WtPageMainURL + 'cgi-bin/';
    image = WtPageImageURL;
  }

  if ( word == undefined ) {
    word = '';
  }

  document.write('<table cellspacing="0" cellpadding="0">');
  document.write('<tr>');

  // Google検索
  document.write('<form method="GET" action="http://www.google.co.jp/custom" target="google">');
  document.write('<td align="left" nowrap>');
  document.write('<input type="text" name="q" size="25" maxlength="255" value="'+word+'" id="wm-google" onFocus="FocusText(this);" onBlur="BlurText(this, \'url('+image+'wm-google.png)\');" />');
  document.write('</td>');
  document.write('<td>');
  document.write('<input type="submit" name="sa" value=" 検索 " />');
  document.write('<input type="hidden" name="client" value="pub-3193981371795511" />');
  document.write('<input type="hidden" name="forid" value="1" />');
  document.write('<input type="hidden" name="ie" value="Shift_JIS" />');
  document.write('<input type="hidden" name="oe" value="Shift_JIS" />');
  document.write('<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;" />');
  document.write('<input type="hidden" name="hl" value="ja" />');
  document.write('</td>');
  document.write('</form>');

  document.write('<td width="10"></td>');

  // アマゾン
  document.write('<form method="post" action="'+cgi+'search-amazon/amazon.cgi">');
  document.write('<td align="left" nowrap>');
  document.write('<input type="text" name="WtAmazon" size="25" value="'+word+'" id="wm-amazon" onFocus="FocusText(this);" onBlur="BlurText(this, \'url('+image+'wm-amazon.png)\');" />');
  document.write('</td>');
  document.write('<td>');
  document.write('<input type="submit" value=" 検索 " />');
  document.write('</td>');
  document.write('</form>');

  document.write('<td width="10"></td>');

  // 楽天ブックス
  document.write('<form method="post" action="'+cgi+'search-rakuten/rakuten.cgi">');
  document.write('<td align="left" nowrap>');
  document.write('<input type="hidden" name="WtType" value="books" />');
  document.write('<input type="text" name="WtRakuten" size="25" value="'+word+'" id="wm-rbooks" onFocus="FocusText(this);" onBlur="BlurText(this, \'url('+image+'wm-rbooks.png)\');" />');
  document.write('</td>');
  document.write('<td>');
  document.write('<input type="submit" value=" 検索 " />');
  document.write('</td>');
  document.write('</form>');

  document.write('</tr>');

  document.write('<tr>');

  // Yahooショッピング
  document.write('<form method="post" action="'+cgi+'search-yahoo/yahoo.cgi">');
  document.write('<td align="left" nowrap>');
  document.write('<input type="text" name="WtYahoo" size="25" valu="'+word+'" id="wm-yshop" onFocus="FocusText(this);" onBlur="BlurText(this, \'url('+image+'wm-yshop.png)\');" />');
  document.write('</td>');
  document.write('<td>');
  document.write('<input type="submit" value=" 検索 " />');
  document.write('</td>');
  document.write('</form>');

  document.write('<td width="10"></td>');

  // Yahooオークション
  document.write('<form method="post" action="'+cgi+'search-yahoo/yahoo.cgi">');
  document.write('<td align="left" nowrap>');
  document.write('<input type="hidden" name="WtType" value="auction" />');
  document.write('<input type="text" name="WtYahoo" size="25" value="'+word+'" id="wm-yauction" onFocus="FocusText(this);" onBlur="BlurText(this, \'url('+image+'wm-yauction.png)\');" />');
  document.write('</td>');
  document.write('<td>');
  document.write('<input type="submit" value=" 検索 " />');
  document.write('</td>');
  document.write('</form>');

  document.write('<td width="10"></td>');

  // 楽天市場
  document.write('<form method="post" action="'+cgi+'search-rakuten/rakuten.cgi" target="rakuten">');
  document.write('<td align="left" nowrap>');
  document.write('<input type="hidden" name="WtType" value="rakuten" />');
  document.write('<input type="text" name="WtRakuten" size="25" value="'+word+'" id="wm-rakuten" onFocus="FocusText(this);" onBlur="BlurText(this, \'url('+image+'wm-rakuten.png)\');" />');
  document.write('</td>');
  document.write('<td>');
  document.write('<input type="submit" value=" 検索 " />');
  document.write('</td>');
  document.write('</form>');

  document.write('</tr>');
  document.write('</table>');

  return;
}

function FocusText(obj) {
  obj.style.backgroundImage = 'url()';
}

function BlurText(obj, url) {
  obj.style.backgroundImage = url;
}


////////// 2つのID要素の高さを揃える
function SameHeight() {
  if ( arguments.length < 2 ) return;

  var i, elem, maxHeight;

  maxHeight = 0;
  for ( i = 0 ; i < arguments.length ; i++ ) {
    elem = document.getElementById(arguments[i]);
    if ( elem == undefined ) continue;
    if ( maxHeight < elem.offsetHeight-elem.style.borderWidth*2-elem.style.paddingTop-elem.style.paddingBottom ) {
      maxHeight = elem.offsetHeight-elem.style.borderWidth*2-elem.style.paddingTop-elem.style.paddingBottom;
    }
  }

  if ( maxHeight < 1 ) return;

  for ( i = 0 ; i < arguments.length ; i++ ) {
    elem = document.getElementById(arguments[i]);
    if ( elem == undefined ) continue;
    elem.style.height = maxHeight;
  }

  return;
}


////////// 2つのID要素の幅を揃える
function SameWidth(id1, id2) {
  if ( arguments.length < 2 ) return;

  var i, elem, maxWidth;

  maxWidth = 0;
  for ( i = 0 ; i < arguments.length ; i++ ) {
    elem = document.getElementById(arguments[i]);
    if ( elem == undefined ) continue;
    if ( maxWidth < elem.offsetWidth-elem.style.borderWidth*2-elem.style.paddingLeft-elem.style.paddingRight ) {
      maxWidth = elem.offsetWidth-elem.style.borderWidth*2-elem.style.paddingLeft-elem.style.paddingRight;
    }
  }

  if ( maxWidth < 1 ) return;

  for ( i = 0 ; i < arguments.length ; i++ ) {
    elem = document.getElementById(arguments[i]);
    if ( elem == undefined ) continue;
    elem.style.width = maxWidth;
  }

  return;
}
