

// ツリーメニュー
function tree2(menu_class,menu_id) {
 var div=document.getElementById(menu_id);
 if (div.style.display == "block") div.style.display="block";
 else {
  var sib=div.parentNode.childNodes;
  for (var i=0; i < sib.length; i++)
   if (sib[i].className == menu_class) sib[i].style.display="none";
  div.style.display="block";
 }


num = 2; // 入れ替える画像の枚数(最初の画像も含める)
exp = "gif" // 拡張子
cnt = 0;
  cnt++;
  cnt %= num;

  document.img1.src = "img/menu/center/a.gif";
  document.img2.src = "img/menu/center/b.gif";
  document.img3.src = "img/menu/center/c.gif";
  document.img4.src = "img/menu/center/d.gif";
  document.img5.src = "img/menu/center/e.gif";

if(menu_id == "menu1")
{
nme = "img/menu/center/a" // 画像のディレクトリとファイル名の数字と拡張子より前の部分
  document.img1.src = nme + cnt + "." + exp;
}

if(menu_id == "menu2")
{
nme = "img/menu/center/b" // 画像のディレクトリとファイル名の数字と拡張子より前の部分
  document.img2.src = nme + cnt + "." + exp;
}

if(menu_id == "menu3")
{
nme = "img/menu/center/c" // 画像のディレクトリとファイル名の数字と拡張子より前の部分
  document.img3.src = nme + cnt + "." + exp;
}

if(menu_id == "menu4")
{
nme = "img/menu/center/d" // 画像のディレクトリとファイル名の数字と拡張子より前の部分
  document.img4.src = nme + cnt + "." + exp;
}

if(menu_id == "menu5")
{
nme = "img/menu/center/e" // 画像のディレクトリとファイル名の数字と拡張子より前の部分
  document.img5.src = nme + cnt + "." + exp;
}

}


// ツリーメニュー（検索用）
function tree3(menu_class,menu_id) {
 var div=document.getElementById(menu_id);
 if (div.style.display == "block") div.style.display="block";
 else {
  var sib=div.parentNode.childNodes;
  for (var i=0; i < sib.length; i++)
   if (sib[i].className == menu_class) sib[i].style.display="none";
  div.style.display="block";
 }

a1.style.color='';
a2.style.color='';
a3.style.color='';
a4.style.color='';
a5.style.color='';
a6.style.color='';
a7.style.color='';

if(menu_id == "all")
{
	a1.style.color='#ff0000';
}

if(menu_id == "wii")
{
	a2.style.color='#ff0000';
}
if(menu_id == "ds")
{
	a3.style.color='#ff0000';
}
if(menu_id == "xbox")
{
	a4.style.color='#ff0000';
}
if(menu_id == "ps3")
{
	a5.style.color='#ff0000';
}
if(menu_id == "ps2")
{
	a6.style.color='#ff0000';
}
if(menu_id == "psp")
{
	a7.style.color='#ff0000';
}


}