var ie=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
var opera=window.opera?1:0


function refresh_items(){
}

function switchdisp(subobj) {
	var folder=''
	if (ie||ns6||opera) {
		folder=ns6?document.getElementById(subobj).style:document.all(subobj).style;
		if(folder.display == "none"){
			folder.display="";
      document.getElementById("switch_disp").innerHTML ="<div class=\"btn_close\">閉じる</div>";
		}else{
			folder.display = "none";
      document.getElementById("switch_disp").innerHTML ="<div class=\"btn_open\">すべてを表示</div>";
		}
	}
}

function switchToggle(subobj) {
	var folder=''
	if (ie||ns6||opera) {
		folder = ns6?document.getElementById(subobj).style:document.all(subobj).style;
		if(folder.display == "none"){
			folder.display="";
			document.getElementById("toggle_search").style.backgroundPosition="left bottom";
		}else{
			folder.display = "none";
			document.getElementById("toggle_search").style.backgroundPosition="left top";
		}
	}
}


function switchphrase_en() {
  refresh_cover();
	var folder=''
	if (ie||ns6||opera) {
		folder=ns6?document.getElementById("cover_en").style:document.all("cover_en").style;
		if(folder.display == "none"){
			folder.display="";
      document.getElementById("toggle_en").innerHTML ="<a href=\"javascript:void(0);\" onclick=\"switchphrase_en();\" class=\"toggle_open\">英文を見る</a>";
		}else{
			folder.display = "none";
      document.getElementById("toggle_en").innerHTML ="<a href=\"javascript:void(0);\" onclick=\"switchphrase_en();\" class=\"toggle_close\">英文をかくす</a>";
		}
	}
}

function switchphrase_jp() {
  refresh_cover();
	var folder=''
	if (ie||ns6||opera) {
		folder=ns6?document.getElementById("cover_jp").style:document.all("cover_jp").style;
		if(folder.display == "none"){
			folder.display="";
      document.getElementById("toggle_jp").innerHTML ="<a href=\"javascript:void(0);\" onclick=\"switchphrase_jp();\" class=\"toggle_open\">訳文を見る</a>";
		}else{
			folder.display = "none";
      document.getElementById("toggle_jp").innerHTML ="<a href=\"javascript:void(0);\" onclick=\"switchphrase_jp();\" class=\"toggle_close\">訳文をかくす</a>";
		}
	}
}


function refresh_cover(){
  this_height = document.getElementById("p_en").offsetHeight;
  document.getElementById("cover_en").style.height = this_height +"px";
  this_height = document.getElementById("p_jp").offsetHeight;
  document.getElementById("cover_jp").style.height = this_height +"px";
}

function linkpages(){
  obj = document.slctlang.linkselect;
  index = obj.selectedIndex;
  if (index != 0){
    href = obj.options[index].value;
    location.href = href;
  }
}


function phrasePlayer(movie){
document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"55\" height=\"21\" id=\"phrase_player\" align=\"middle\">");
document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\">");
document.write("<param name=\"movie\" value=\"/swf/phrase_player.swf\">");
document.write("<param name=\"quality\" value=\"high\">");
document.write("<param name=\"wmode\" value=\"transparent\">");
document.write("<param name=\"bgcolor\" value=\"#ffffff\">");

if(movie){
	document.write("<PARAM NAME=\"FlashVars\" VALUE=\"movie="+movie+"\">");
}
document.write("<embed src=\"/swf/phrase_player.swf\" wmode=\"transparent\"");

if(movie){
	document.write("FlashVars=\"movie="+movie+"\"");
}

document.write(" quality=\"high\" bgcolor=\"#ffffff\" width=\"55\" height=\"21\" name=\"phrase_player\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">");

document.write("</object>");

}


function phrasePlayerList(movie){
document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"29\" height=\"21\" id=\"phrase_player\" align=\"middle\">");
document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\">");
document.write("<param name=\"movie\" value=\"/swf/phrase_player_list.swf\">");
document.write("<param name=\"quality\" value=\"high\">");
document.write("<param name=\"wmode\" value=\"transparent\">");
document.write("<param name=\"bgcolor\" value=\"#ffffff\">");

if(movie){
	document.write("<PARAM NAME=\"FlashVars\" VALUE=\"movie="+movie+"\">");
}
document.write("<embed src=\"/swf/phrase_player_list.swf\" wmode=\"transparent\"");

if(movie){
	document.write("FlashVars=\"movie="+movie+"\"");
}

document.write(" quality=\"high\" bgcolor=\"#ffffff\" width=\"29\" height=\"21\" name=\"phrase_player\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">");

document.write("</object>");

}
