//======================================================================
// ウィンドウ・オープン
//======================================================================
function WinOpen(name,width,height) {
  var w;
  w = window.open("",name,'resizable=yes,toolbar=no,directories=no,menubar=no,scrollbars=yes,status=no,width='+width+',height='+height);
  w.moveTo(0,0);
  w.focus();
}

//======================================================================
// ウィンドウ・オープン(画像ファイル専用)
//======================================================================
function WinOpenPhoto(photo_pic) {
  var w;
  w = window.open("","photo","resizable=yes,toolbar=no,directories=no,menubar=no,scrollbars=yes,status=no,width=450,height=500");
  w.location.href="photo_view.html";
  w.document.images[0].src=photo_pic;
  w.moveTo(0,0);
  w.focus();
}

//======================================================================
// ウィンドウ・クローズ
//======================================================================
function WinClose() {
  opener.window.location.reload();
  close();
}

//======================================================================
// 画像ファイルのパスを作成
//======================================================================
function ImgSet(name, img, folder) {
  document.images[name].src = "images/" + folder + "/" + img;
}

//======================================================================
// 製品カテゴリ・ツリーの表示
//======================================================================
function show_hide(item, gpath) {
  if(navigator.appName == 'Microsoft Internet Explorer')
  {
    var src_element= window.event.srcElement;
    tree_item = document.all(src_element.id);
    test_string = tree_item.src.toString()
    if(item.style.display == 'none')
    {
      item.style.display = "";
      if(test_string.search("t-plus-mid.jpg") >= 0)
      {
        tree_item.src = gpath + "t-min-mid.jpg";
      }
      else if(test_string.search("t-min-mid2.jpg") >= 0)
      {
        tree_item.src=gpath + "t-min-mid2.jpg";
      }
      else
      {
        tree_item.src=gpath + "t-min-bot.jpg";
      }
    }
    else
    {
      item.style.display = "none";
      if(test_string.search("t-min-mid.jpg") >= 0)
      {
        tree_item.src = gpath + "t-plus-mid.jpg";
      }
      else if(test_string.search("t-min-mid2.jpg") >=0 )
      {
        tree_item.src = gpath + "t-min-mid2.jpg";
      }
      else
      {
        tree_item.src = gpath + "t-plus-bot.jpg";
      }
    }
  }
  else
  {
    document.layers[item].visibility = "show";
  }
}

//======================================================================
// キーワードフォームの入力チェック
//======================================================================
function chkKeyword(la) {
  var str;
  str = document.form1.keyword.value;
  if(str.length > 32) {
    if(la == "ja") {
      alert("入力されたキーワードの文字数が制限(半角３２文字)を超えています。");
    }
    else
    {
      alert("The number of characters of the inputted keyword is over restriction (half size of 16 characters).");
    }
    return false;
  }
  WinOpen("keyword","680","650");
  return true;
}

//======================================================================
// ナビ画像の表示（index.htmlのみ）
//======================================================================
 gifCnt = 16;
 gifTbl = new Array(
   "images/menu06_1.gif" , "images/menu06_2.gif",
   "images/menu07_1.gif" , "images/menu07_2.gif",
   "images/menu08_1.gif" , "images/menu08_2.gif",
   "images/menu09_1.gif" , "images/menu09_2.gif",
   "images/menu02_1.gif" , "images/menu02_2.gif",
   "images/menu03_1.gif" , "images/menu03_2.gif",
   "images/menu10_1.gif" , "images/menu10_2.gif",
   "images/menu05_1t.gif", "images/menu05_2t.gif"
 );

 srcTbl = new Array(gifCnt);
 for (i=0; i<gifCnt; i++){
 srcTbl[i] = new Image();
 srcTbl[i].src = gifTbl[i];
 }

 function chgPic(btnNo, tblNo){
   document.images["btn"+btnNo].src = srcTbl[tblNo].src;
 }

//======================================================================
// Copyrightの表示
//======================================================================
function SetCopyright() {
  var today = new Date;
  document.write("Copyright " + today.getYear() + " TLV CO., LTD. All rights reserved.");
}

