/* 
====================================================
 javaScript Test
====================================================
*/
var cNowIdtx="idtx1";//この変数宣言は、 <script type="text/javascript" src="ts.js"></script> としてロードされた htmlファイル 内部だけで有効。 htmlファイルが異なれば、同じ名前の変数でも、別物と扱われる。 だから クッキーが設けられている。

var cNowId="id1";
var mnuN=8;//メニューの項目最大数

function txch(tid,col1)
{
  //document.getElementById([tid].style.backgroundColor=col1;
  document.getElementById(tid).style.fontStyle="italic"; 
}

function txch2(tid,cfs)
{
  //document.getElementById([tid].style.backgroundColor=col1;
  //document.getElementById([tid].style.fontStyle=cfs;
  document.getElementById(tid).style.color=cfs;
  //document.getElementById([tid].style.fontStyle="big";

  if (cNowIdtx == tid ) {//現在、選択されているリンク文字上で...... 
    if (cfs=="#0000ff") { //マウスカーソルがリンク文字より離れた場合
      document.getElementById(cNowIdtx).style.color="#ffffff"; //現在、選択されているリンク文字の場合は白に戻す 
    }
  }
}

function celCh(tid,col1)
{
  var i,c,c2;

  for(i=1;i<=mnuN;i++) {
     c ="id"+i;
     document.getElementById(c).style.backgroundColor="#f4cfaa";

     c2="idtx"+i;
     document.getElementById(c2).style.color="#0000ff"; //リンク文字を青にする
  };
  
  cNowId = tid;
  document.getElementById(cNowId).style.backgroundColor=col1;

  cNowIdtx = "idtx"+tid.substr(2,1);
  //alert(c);//アラートで 変数Cの内容を表示
  //document.getElementById("idtx1").style.color="#ffffff"; //リンク文字を白にする
  //document.getElementById("idtx1").style.fontSize="24pt";//リンク文字を大きく表示する. 
  //document.getElementById(c).style.fontSize="24pt"; //リンク文字を大きく表示する. 
  document.getElementById(cNowIdtx).style.color="#ffffff"; //リンク文字を白にする
}


//トップメニュー表示色の初期化
function MenuInit()
{
  var i;

  for(i=1;i<=mnuN;i++) {
     c ="id"+i;
     top.topFr.document.getElementById(c).style.backgroundColor="#f4cfaa";

     c2="idtx"+i;
     top.topFr.document.getElementById(c2).style.color="#0000ff"; //リンク文字を青にする
  };

}


function tsMain1(ii,col1)
{
  var c1,c2;

  //alert("topFrのid2の背景色を緑に変えます");
  //alert("現在の cNowId の値は＝"+cNowId+" です");

  MenuInit(); //メニュー表示色の初期化

  c1 ="id"+ii;
  c2 ="idtx"+ii;

  top.topFr.document.getElementById(c1).style.backgroundColor=col1; //フレーム名"topFr"にあるオブジェクトの設定を変更する。この場合は、セルの背景を変えている.
  
  top.topFr.document.getElementById(c2).style.color="#ffffff"; //文字を白にする

  //document.getElementById(tid).style.fontColor=col2; 
}


