function treeMenu(id) {
 var disp = document.all(id).style.display;
 document.all(id).style.display = "none";

 if(disp == "none" || disp ==""){
   document.all(id).style.display = "block";
 }

// if(disp != "none" || disp == "") {
//   document.all(id).style.display = "none";
//  }
// else {
//   document.all(id).style.display = "block";
//  }
}

function topstyle(n){
 var mao = 4;//クラス数
 var t = Math.floor(Math.random()*4);
// var clas = document.all([0-9]).class;
 opp = new Array("g","p","r","y");//クラス名
 

 return opp[t];
}

function j(thread_num,sta,end){
 if(thread_num == "now"){
   var tt = document.URL;
   if(tt.match(/\?(n|p)(\d{10})/)){
     thread_num = RegExp.$2;
     var fl = RegExp.$1;
   }else{
     alert("ＵＲＩが不正です。on Javascript");
   }


 }else{
   alert("まだ未対応です。");
 }

 if(end == ""){
   var loop = "0000";
 }else{
   var loop = ("0000" + Math.abs(end - sta)).slice(-4);
 }
 
 sta = ("00000" + sta).slice(-5);
 
 location.href = "april.cgi?" + fl + thread_num + sta + "." + loop;
}

function gor(threadnum,startnum,loop){
 var snum = startnum;
 var fnum = Math.abs(startnum) + Math.abs(loop);

 var xmlfilename=threadnum + ".xml";

 var xmlt = new XMLHttpRequest();
 xmlt.open("GET",xmlfilename,true);
 xmlt.onload = function(){
  if(xmlt.readyState == 4){
   var xmld = xmlt.responseXML;
 xmlt.send(null);
  }
 }

 var xslt = new XMLHttpRequest();
 xslt.open("GET","../april.xsl",true);
 xslt.onload = function(){
  if(xslt.readyState == 4){
   var xsld = xslt.responseXML;
 xslt.send(null);
  }
 }
 
 var vali = new Array();
 //alert(xsld);
 try{
  vali=xsld.getElementsByTagName("xsl:variable");
 }catch(e){
  try{
   vali=xsld.getElementsByTagName("variable");
  }catch(e){
   alert("getElementsByTagName Error");
  }
 }
 vali[0].text=fnum;
 vali[1].text=snum;


 var htmld;
 htmld = xmld.transformNode(xsld);
 //var moji = htmld.replace("UTF-16","UTF-8");
 //htmld=moji;

 document.write(htmld);

}

function style(i){
    kigen = new Date();
    kigen.setTime(kigen.getTime() + (30 * 60 * 60 * 24));
    kigen2 = kigen.toGMTString();
　　document.cookie = "css=" + i + ";expires=" + kigen2;
 window.location.reload();
}


