function goTop(str) {
	var base = "";
	if (location.protocol == "file:") {
		var p = location.href.indexOf("/geo/", 0);
		base = location.href.substring(0, p + 4);
	} else if (location.hostname == "www.geocities.co.jp") {
		base = "/SiliconValley/1824";
	} else {
		base = "http://www.geocities.co.jp/SiliconValley/1824";
	}
	document.write('<a href="', base, '/index.html" target="_top">', str, '</a>');
}

function convertURL(url, str) {
	var base = "";
	if (location.protocol == "file:") {
		var p = location.href.indexOf("/geo/", 0);
		base = location.href.substring(0, p + 4);
	} else if (url.substring(0,4) == "/vb/" || url.substring(0,6) == "/trip/") {
		base = "http://yama-chan.hoops.ne.jp";
	} else if (location.hostname == "www.geocities.co.jp") {
		base = "/SiliconValley/1824";
	} else {
		base = "http://www.geocities.co.jp/SiliconValley/1824";
	}
	document.write('<a href="', base, url, '">', str, '</a>');
}

function footer() {
  var d = new Date(document.lastModified);
  document.write('<p><center>');
  document.write(getYear2000(d), "/", d.getMonth() + 1, "/", d.getDate());
  document.write(' (c) <a href="mailto:yama-chan@geocities.co.jp">yamachan (Toshio Yamashita)</a><center></p>');
}

function HelpOn(obj, type, msg) {
  var hWidth = 200;
  var cBorder = "#ffff99";
  var cTitle = "#550000";
  var cTitleD = "#400000";
  var cBody = "#0a1428";
  var cBodyD = "#081019";

  if (document.layers) {
    var lnkX = obj.x;
    var lnkY = obj.y;
    var iWidth = window.innerWidth;
    var iHeight = window.innerHeight;
  } else if (document.all||document.getElementById) {
    var lnkX = 0;
    var lnkY = 0;
    var currentObj = obj;
    while (currentObj.tagName != "BODY") {
      lnkX += currentObj.offsetLeft;
      lnkY += currentObj.offsetTop;
      currentObj = currentObj.offsetParent;
    }
    var iWidth = document.width;
    var iHeight = document.height;
  }

  if ((lnkX + hWidth) > 760) {
    var hX = 760 - hWidth;
  } else {
    var hX = lnkX + 25;
  }

  if (((iHeight - lnkY) < 75) & (lnkY > 75)) {
    var hY = lnkY - 50;
  } else {
    var hY = lnkY + 25;
  }

  var hSRC = '<table border="0" cellspacing="0" cellpadding="0" width="' + hWidth + '">' +
	'<tr>' + sp(8,0,3,cBorder) + '</tr><tr>' +
	sp(1,2,0,cBorder) + sp(1,1,0,cTitleD) +
	'<td bgcolor=' + cTitle + '>&nbsp;</td><td height=20 bgcolor=' + cTitle + ' valign="center"><font color="#ffcccc"><b>';

  if (type == 0) {
    hSRC += 'メニュー情報</b></td>' + sp(1,12,0,cTitle);
  } else if (type == 50) {
    hSRC += 'Menu Information</b></td>' + sp(1,12,0,cTitle);
  } else {
    hSRC += '他サイトへのリンク</b></td>' + sp(1,12,0,cTitle);
  }

  hSRC += '<td bgcolor=' + cTitle + '>&nbsp;</td>'+
	sp(1,1,0,cTitleD) + sp(1,3,0,cBorder) + '</tr><tr>' +
	sp(1,3,3,cBorder) + sp(1,1,3,cBodyD) + sp(4,0,3,cBody) +
	sp(1,1,3,cBodyD) + sp(1,3,3,cBorder) + '</tr><tr>' +
	sp(1,3,0,cBorder) + sp(1,1,0,cBodyD) + '<td class="overlay" bgcolor=' + cBody + '>&nbsp;</td>' +
	'<td colspan=2 class="overlay" bgcolor=' + cBody + '><font color="#ffffff">' + msg +
	'</font></td>'+'<td class="overlay" bgcolor=' + cBody + '>&nbsp;</td>' + sp(1,1,0,cBodyD) +
	sp(1,3,0,cBorder) + '</tr><tr>' + sp(1,3,3,cBorder) + sp(1,0,3,cBodyD) +
	sp(4,0,3,cBody) + sp(1,0,3,cBodyD) + sp(1,3,3,cBorder) + '</tr><tr>' +
	sp(1,3,0,cBorder) + sp(6,1,0,cBodyD) + sp(1,3,0,cBorder) + '</tr><tr>' +
	sp(8,0,3,cBorder) + '</tr></table>';

  if (document.layers) {
    document.HelpLayer.moveTo(hX,hY);
    document.HelpLayer.document.writeln(hSRC);
    document.HelpLayer.document.close();
    document.HelpLayer.visibility='show';
  } else if (document.all) {
    document.all.HelpLayer.style.pixelLeft=hX;
    document.all.HelpLayer.style.pixelTop=hY;
    document.all.HelpLayer.innerHTML=hSRC;
    document.all.HelpLayer.style.visibility='visible';
  } else if (document.getElementById) {
    document.getElementById('HelpLayer').style.left=hX;
    document.getElementById('HelpLayer').style.top=hY;
    document.getElementById('HelpLayer').innerHTML=hSRC;
    document.getElementById('HelpLayer').style.visibility='visible';
  }
}

function HelpOff() {
  if (document.layers) {
    document.HelpLayer.document.writeln('');
    document.HelpLayer.document.close();
    document.HelpLayer.visibility='hide';
  } else if (document.all) {
    document.all.HelpLayer.innerHTML=' ';
    document.all.HelpLayer.style.visibility='hidden';
  } else if (document.getElementById) {
    document.getElementById('HelpLayer').innerHTML=' ';
    document.getElementById('HelpLayer').style.visibility='hidden';
  }
}

// *********************************************

function getYear2000(d) {
	y = d.getYear();
	if (y > 1900)
		return y;
	else
		return y + 1900;
}

function sp(s, w, h, c) {
  var ret='<td';

  if (s > 1) ret += ' colspan="' + s + '"';
  if (w > 1) ret += ' width="' + w + '"';
  if (h > 1) ret += ' height="' + h + '"';
  ret += ' bgcolor="'+c+'"><img width="1" height="1" src="s.gif" alt=""></td>';

  return ret;
}
