var arrElt = new Array();
var arrTimerID = new Array();
var newWindow = "";

function toVisible(idx) {
	clearTimeout(arrTimerID[idx]);
	arrElt[idx] = document.getElementById('m' + idx + 's');
//	arrTimerID[idx] = setTimeout("toVisibility("+idx+",'visible')", 100);
	setTimeout("toVisibility("+idx+",'visible')", 100);
	return;
}
function toHidden(idx) {
	arrElt[idx] = document.getElementById('m' + idx + 's');
	arrTimerID[idx] = setTimeout("toVisibility("+idx+",'hidden')", 100);
	return;
}
function toVisibility(idx,mode) {
	arrElt[idx].style.visibility = mode;
	return;
}
function toURL(strURL){
	if (strURL != ""){
		location.href=strURL;
	}
}

function toURL2(strURL,WID,HEI){

	var lLeft = (window.screen.width - WID) / 2;
	var lTop = (window.screen.height - HEI) / 2;

	if (newWindow != ""){
		newWindow.close();
	}

	newWindow = window.open(strURL,"SubWindow","toolbar=no" + ","
											 + "location=no" + ","
											 + "status=no" + ","
											 + "directories=no" + ","
											 + "menubar=no" + ","
											 + "scrollbars=yes" + ","
											 + "resizable=yes" + ","
											 + "top=" + lTop + ","
											 + "left=" + lLeft + ","
											 + "width=" + WID + ","
											 + "height=" + HEI);
	newWindow.focus();
}

function toToiawase(email,subject){
	toURL2("about:blank",640,560);
	with(document.Toiawase){
		HID_email.value = email;
		HID_subject.value = subject;

		submit();
	}
}

function ImagePreLoad()
{
  var appVer=parseInt(navigator.appVersion);
  var isNC=(document.layers && (appVer >= 4)); // Netscape Navigator 4.0 or later
  var isIE=(document.all    && (appVer >= 4)); // Internet Explorer  4.0 or later
  if (isNC || isIE)
  {
    if (document.images)
    {
      var imgName = ImagePreLoad.arguments[0];
      var cnt;
      swImg[imgName] = new Array;
      for (cnt = 1; cnt < ImagePreLoad.arguments.length; cnt++)
      {
        swImg[imgName][ImagePreLoad.arguments[cnt]] = new Image();
        swImg[imgName][ImagePreLoad.arguments[cnt]].src = "images/m0_menu_" + ImagePreLoad.arguments[cnt] + ".gif";
      }
    }
  }
}

// ImageSwap: 画像を入れ換えます
function ImageSwap(imgName, imgSrc)
{
  var appVer=parseInt(navigator.appVersion);
  var isNC=(document.layers && (appVer >= 4)); // Netscape Navigator 4.0 or later
  var isIE=(document.all    && (appVer >= 4)); // Internet Explorer  4.0 or later
  if (isNC || isIE)
  {
    if (document.images)
    {
      imgSrc = "images/" + imgSrc;
      imgName.src = imgSrc;
    }
  }
}

// ImageSwap2: 画像を入れ換えます(TDタグ用)
function ImageSwap2(imgName, imgSrc)
{
  var appVer=parseInt(navigator.appVersion);
  var isNC=(document.layers && (appVer >= 4)); // Netscape Navigator 4.0 or later
  var isIE=(document.all    && (appVer >= 4)); // Internet Explorer  4.0 or later
  if (isNC || isIE)
  {
    imgSrc = "images/" + imgSrc;
    imgName.background = imgSrc;
  }
}

var mouse_idx;
mouse_idx = 1

function MouseCursorMove(x,y){
	mouse.style.top = y-10;
	mouse.style.left = x-10;
}

function MouseColorChange(){
	var wkTime = new Date();

	if (mouse_idx >= 7)	mouse_idx = 1;
	else				mouse_idx = mouse_idx + 1;

	mouse_img.src = "images/m0_cursor_star" + mouse_idx + ".gif";

	if ((Math.floor(Math.random() * wkTime.getSeconds()) % 2) == 0){
		setTimeout("MouseColorChange()",500);
	}
}

