function changeHTML(obj,string)
{
 obj.innerHTML = string;
}

function changeHTML2(layName,html){
  if(document.getElementById){        //e5,e6,n6,n7,m1,o7,s1用
    document.getElementById(layName).innerHTML=html
  } else if(document.all){            //e4用
    document.all(layName).innerHTML=html
  } else if(document.layers) {        //n4用
     with(document.layers[layName].document){
       open()
       write(html)
       close()
    }
  }
}


function dispsentences(attr)
{
 string = "";
 for (i=0; i<textarray01.length; i++) {
  str = textarray01[i][0] + textarray01[i][1];
  if ((str.indexOf(attr,0) > -1) || (attr == "All")){
   if (form1.selectlang[0].checked) {
    string += '<p onMouseover="' + "this.style.color='red';changeHTML(this,'" + textarray01[i][2] + " "
     + textarray01[i][4] + " [" + textarray01[i][0] +  "]" + "'" + ')"'
     + ' onMouseout="' + "this.style.color='black';changeHTML(this,'" + textarray01[i][2] + " "
     + textarray01[i][3] + " [" + textarray01[i][0] +  "]" + "'" + ')">'
     + textarray01[i][2] + " " + textarray01[i][3] + " [" + textarray01[i][0] +  "]" + '</p>';
   } else {
    string += '<p onMouseover="' + "this.style.color='red';changeHTML(this,'" + textarray01[i][2] + " "
     + textarray01[i][3] + " [" + textarray01[i][1] +  "]" + "'" + ')"'
     + ' onMouseout="' + "this.style.color='black';changeHTML(this,'" + textarray01[i][2] + " "
     + textarray01[i][4] + " [" + textarray01[i][1] +  "]" + "'" + ')">'
     + textarray01[i][2] + " " + textarray01[i][4] + " [" + textarray01[i][1] +  "]" + '</p>';
   }
  }
 }
//alert(string);
 return string;
}

function dispsentences2(attr1, attr2)
{
 string = "";
 counter = 0;
 for (i=0; i<textarray01.length; i++) {
  str = textarray01[i][0] + textarray01[i][1];
  if (((str.indexOf(attr1,0) > -1) && (str.indexOf(attr2,0) > -1))
   || ((str.indexOf(attr1,0) > -1) && (attr2 == "All"))
   || ((str.indexOf(attr2,0) > -1) && (attr1 == "All"))
   || ((attr1 == "All") && (attr2 == "All"))){
   if (form1.selectlang[0].checked) {
    string += '<p onMouseover="' + "this.style.color='red';changeHTML(this,'" + textarray01[i][2] + " "
     + textarray01[i][4] + " [" + textarray01[i][0] +  "]" + " [" + textarray01[i][1] +  "]" + "'" + ')"'
     + ' onMouseout="' + "this.style.color='black';changeHTML(this,'" + textarray01[i][2] + " "
     + textarray01[i][3] + " [" + textarray01[i][0] +  "]" + " [" + textarray01[i][1] +  "]" + "'" + ')">'
     + textarray01[i][2] + " " + textarray01[i][3] + " [" + textarray01[i][0] +  "]" + " [" + textarray01[i][1] +  "]" + '</p>';
   }
   if (form1.selectlang[1].checked) {
    string += '<p onMouseover="' + "this.style.color='red';changeHTML(this,'" + textarray01[i][2] + " "
     + textarray01[i][3] + " [" + textarray01[i][0] +  "]" + " [" + textarray01[i][1] +  "]" + "'" + ')"'
     + ' onMouseout="' + "this.style.color='black';changeHTML(this,'" + textarray01[i][2] + " "
     + textarray01[i][4] + " [" + textarray01[i][0] +  "]" + " [" + textarray01[i][1] +  "]" + "'" + ')">'
     + textarray01[i][2] + " " + textarray01[i][4] + " [" + textarray01[i][0] +  "]" + " [" + textarray01[i][1] +  "]" + '</p>';
   }
   if (form1.selectlang[2].checked) {
    string += '<p>'
     + textarray01[i][2] + " " + textarray01[i][3] + "<HR>" + textarray01[i][4] + " [" + textarray01[i][0] +  "]" + " [" + textarray01[i][1] +  "]" + '</p>';
   }
   counter += 1;
  }
 }
//alert(string);
 string = "（" + counter + "件）" + string + "（ファイルの最後です）";
 return string;
}

function dispsentences3(attr1, attr2)
{
 string = "";
 counter = 0;
 for (i=0; i<textarray01.length; i++) {
  str = textarray01[i][0] + textarray01[i][1];
  if (((str.indexOf(attr1,0) > -1) && (str.indexOf(attr2,0) > -1))
   || ((str.indexOf(attr1,0) > -1) && (attr2 == "All"))
   || ((str.indexOf(attr2,0) > -1) && (attr1 == "All"))
   || ((attr1 == "All") && (attr2 == "All"))){
    string += '<p>' + textarray01[i][2] + " " + textarray01[i][3] + "<HR>" + textarray01[i][4]
              + " [" + textarray01[i][0] +  "]" + " [" + textarray01[i][1] +  "]" + '</p>';
   counter += 1;
  }
 }
//alert(string);
 string = "（" + counter + "件）" + string + "（ファイルの最後です）";
 return string;
}

function write_menu(arrayname) {
 for (i=0; i<arrayname.length; i++) {
  document.write("<option>" + arrayname[i]);
 }
}

