// JavaScript Document

var tag;

function fx_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=fx_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function showTag(tag){
 	$(tag).show("slow");
}
function hideTag(tag){
	$("#q"+tag+".que").css("background-image","url(img-qa/q1.gif)");
	$("#a"+tag).hide("slow");
}
function toggleTag(tag){
	// 背景画像を状態により入れ替え
	if($("#a"+tag).css("display")!="none"){
		$("#q"+tag+".que").css("background-image","url(img-qa/q1.gif)");
	} else {
		$("#q"+tag+".que").css("background-image","url(img-qa/q2.gif)");
	}
	// トグル
	$("#a"+tag).toggle("slow");
}

function setTag(tag){
	// 別ページに飛ぶときに、現在ページのURLに戻ってきたときのためのタグを追加
	location.hash="#q"+tag;
}

$(document).ready(function() {  
  // 別ページに遷移し、戻ってきたときの対策
	tag = location.hash.substring(1, location.hash.length);
	if(tag == "taishibou") {
		// 体脂肪ページからの特別処理
		$.scrollTo("#06", 300);
	} else if (location.hash.length > 1) {
		tag=location.hash.substring(2, location.hash.length);
		$("#a"+tag).show();
	}
}); 
