<!--
///////////////////////////////////////////////////////////
//                                                       //
//  The Function To useful                               //
//                                                       //
///////////////////////////////////////////////////////////

ie=false;
ns6=false;
ns4=false;
ns3=false;
if(navigator.appName == "Microsoft Internet Explorer"){
  if(parseInt(navigator.appVersion.substring(0,1)) >= 4){
    ie=true;
  }
}else if(navigator.appName == "Netscape"){
  if(parseInt(navigator.appVersion.substring(0,1)) >= 5){
    ns6=true;
  }
  else if(parseInt(navigator.appVersion.substring(0,1)) >= 4){
    ns4=true;
  }
  else if(parseInt(navigator.appVersion.substring(0,1)) >= 3){
    ns3=true;
  }
}

function writeMenu(ph){

  str="";
  str+="<img name=\"info\" src=\"" + ph + "images/spacer.gif\" border=0 width=\"17\" height=\"22\">";
  str+="<a href=\""+ph+"cgi-bin/info/u_diary.cgi\" onmouseover=\"chimg('info','on');showDiv('info');\" onmouseout=\"chimg('info','out');showDiv('info');\">";
  str+="<img src=\"" + ph + "images/main/info.gif\" border=0 width=\"86\" height=\"22\">";
  str+="</a>";

  str+="<img name=\"mem\" src=\"" + ph + "images/spacer.gif\" border=0 width=\"17\" height=\"22\">";

  str+="<a href=\"" + ph + "mem.html\" onmouseover=\"chimg('mem','on');showDiv('mem');\" onmouseout=\"chimg('mem','out');showDiv('mem');\">";
  str+="<img src=\"" + ph + "images/main/member.gif\" border=0 width=\"71\" height=\"22\">";
  str+="</a>";

  str+="<img name=\"rec\" src=\"" + ph + "images/spacer.gif\" border=0 width=\"17\" height=\"22\">";

  str+="<a href=\"" + ph + "rec.html\" onmouseover=\"chimg('rec','on');showDiv('rec');\" onmouseout=\"chimg('rec','out');showDiv('rec');\">";
  str+="<img src=\"" + ph + "images/main/records.gif\" border=0 width=\"64\" height=\"22\">";
  str+="</a>";

  str+="<img name=\"bbs\" src=\"" + ph + "images/spacer.gif\" border=0 width=\"17\" height=\"22\">";

  str+="<a href=\"" + ph + "cgi-bin/bbs/apeboard_plus.cgi\" onmouseover=\"chimg('bbs','on');showDiv('bbs');\" onmouseout=\"chimg('bbs','out');showDiv('bbs');\">";
  str+="<img src=\"" + ph + "images/main/bbs.gif\" border=0 width=\"35\" height=\"22\">";
  str+="</a>";

  str+="<img name=\"photo\" src=\"" + ph + "images/spacer.gif\" border=0 width=\"17\" height=\"22\">";

  str+="<a href=\"" + ph + "photo/photo.html\" onmouseover=\"chimg('photo','on');showDiv('photo');\" onmouseout=\"chimg('photo','out');showDiv('photo');\">";
  str+="<img src=\"" + ph + "images/main/photo.gif\" border=0 width=\"49\" height=\"22\">";
  str+="</a>";
  str+="<img name=\"index\" src=\"" + ph + "images/spacer.gif\" border=0 width=\"17\" height=\"22\">";
  str+="<a href=\"" + ph + "\" onmouseover=\"chimg('index','on');showDiv('index');\" onmouseout=\"chimg('index','out');showDiv('index');\">";
  str+="<img src=\"" + ph + "images/main/index.gif\" border=0 width=\"46\" height=\"22\">";
  str+="</a><br>";
  document.writeln(str);
}

var skillName=new Array(
  '三人掛',
  '仏骨攻',
  '伏虎地二',
  '開祖投',
  '袖巻返',
  '天秤投',
  '巻小手',
  '引天秤'
);

function randImg(ph){
  max=8;
  var num=Math.floor(max*Math.random());
  img = document.images['skill'];
  img.alt=skillName[num];
  num=num.toString();
  if(num.length < 2)
    num="0"+num;
  img.src = ph+"images/skill/skill"+num+".gif";
}


function check(){
  el=document.forms['form'].elements['icon'];
  el.v=el.options[el.selectedIndex].value
  if(!el.v){
    str="";
    str+="";
    str+="　　  ( うぇーん、「アイコン」がないよー\n";
    str+="　　　 ￣￣∨￣￣￣￣￣￣￣￣￣\n";
    str+="　 　ーー ∧＿∧\n";
    str+="　　 ー　（ ´Д⊂ヽ\n";
    str+="　 ー ⊂　　　　ノ\n";
    str+="　　ー　 人　 Ｙ\n";
    str+="　ーー　し （＿）\n";
    alert(str);
    return false;
  }else{
    return true;
   }
}

function writeSelect(){
  var maxicon=8;
  tmpstr="";
  if(ie || ns6){
  tmpstr+="<select class=\"ie\" name=\"icon\">";
  }
  else{
  tmpstr+="<select name=\"icon\">";
  }
  tmpstr+="<option value=\"\">-- Select !!</option>";
  for(i=0; i < maxicon; i++){
    tmpstr +="<option value=\""+ (i+1) +"\">- "+ skillName[i] +"</option>\n";
  }
  tmpstr+="</select>";
  document.writeln(tmpstr);
}

function writeNone(){
  str="";
  str+="<style type=\"text/css\">";
  str+=".dispIE{";
  str+="  display: none;";
  str+="  padding-left: 20px;";
  str+="}";
  str+="</style>";
  document.write(str);
}

var preImgArr=new Array();

function crtPreIMG(na,src){
  if(ie || ns6){
    if(!preImgArr.exist)
      preImgArr.exist=true;
    if(!preImgArr[na]){
      preImgArr[na]= new Image();
    }
    preImgArr[na].src=src;
  }
}


function chimg(tar,num,imgArr){
  if(ie || ns6){
    obj = document.images[tar];
    if(imgArr){
      obj.src = imgArr[num].src;
    }else{
      obj.src = preImgArr[num].src;
    }
  }
}


function disp(el){
  if(ie || ns6){
    el=getDisp(el);
    if(el.visible==null)
      el.visible=false;
    
    if(el.visible)
      el.style.display="none";
    else
      el.style.display="block";
    
    el.visible=!el.visible;
  }
}

function getDisp(el){
  while(el.className != "dispIE"){
    el=el.nextSibling;
  }
  return el;
}

function getNode(id){
  return document.getElementById(id);
}

function crtNode(ElementType){
  obj = document.createElement(ElementType);
  return obj;
}

function crtTxtNode(text){
  obj = document.createTextNode(text);
  return obj; 
}

function crtTxtRange(){
  obj = document.createTextRange();
  return obj;
}

function removeChildNodes(ParentNode){
  while(ParentNode.hasChildNodes()){
    ParentNode.removeChild(ParentNode.firstChild);
  }
}



//借り物関数
function AddNode(ParentId, ElementType, AddId, AddClass, AddText){ 
  var ParentNode, ElementNode, TextNode; 
  
  if(document.getElementById && document.createElement){ 
    ParentNode = document.getElementById(ParentId); 
    ElementNode = document.createElement(ElementType); 
    if(AddClass){ 
      ElementNode.className = AddClass; 
    } 
    if(AddText){ 
      TextNode = document.createTextNode(AddText); 
      ElementNode.appendChild(TextNode); 
    } 
    ParentNode.appendChild(ElementNode); 
    if(AddId){ 
      ParentNode.childNodes.item(ParentNode.childNodes.length - 1).id = AddId; 
    }
  }
}

// -->
