var bk_color=0;

// 「全てのカレンダーを表示する」で表示されるカレンダーを表示します。
function hideCal(elm)             		//----detail_i.php,detail_d.php,detail_a.php
{
 	Element.hide(elm);
}

// 「全てのカレンダーを表示する」で表示されるカレンダーを非表示にします。
function toggleCal(elm)       			//----detail_i.php,detail_d.php,detail_a.php
{
	Element.toggle(elm);
}

// マウスオーバーによりバックグランドカラーを変更します。
function mounseon(ddid)           	 //----detail_i.php,detail_d.php
{
	bk_color=document.getElementById(ddid).style.backgroundColor;
	document.getElementById(ddid).style.backgroundColor = "#FFCF8C";
}

// マウスオーバーによりバックグランドカラーを変更したものを元に戻します。
function mounseout(ddid)             //----detail_i.php,detail_d.php
{

	document.getElementById(ddid).style.backgroundColor = bk_color;
}

//tour_i.phpとtour_d.php画像がない場合、キャプション/イメージ（文字列）を非表示する
function myTourPh()              //----detail_i.php,detail_d.php
{
	var imgElm01 = document.getElementById("myTourPh_1");
	if(imgElm01)
	{
		if (imgElm01.width >= 100 || imgElm01.height >= 80)
		{
			document.getElementById("ph1").style.display = "";
			document.getElementById("ph1").style.visibility = "visible";
			//imgElm01.parentNode.hide();
			//imgElm01.next().innerHTML = "";
		}
		else
		{
/*　090706 delete 
			document.getElementById("ph1").style.display = "none";
*/
		}
	}

	var imgElm02 = document.getElementById("myTourPh_2");
	if(imgElm02)
	{
		if (imgElm02.width >= 100 || imgElm02.height >= 80)
		{
			document.getElementById("ph2").style.display = "";
			document.getElementById("ph2").style.visibility = "visible";
			//imgElm02.parentNode.hide();
			//imgElm02.next().innerHTML = "";
		}
		else
		{
/*　090706 delete 
			document.getElementById("ph2").style.display = "none";
*/
		}
	}

	var imgElm03 = document.getElementById("myTourPh_3");
	if(imgElm03)
	{
		if (imgElm03.width >= 100 || imgElm03.height >= 80)
		{
			document.getElementById("ph3").style.display = "";
			document.getElementById("ph3").style.visibility = "visible";
			//imgElm03.parentNode.hide();
			//imgElm03.next().innerHTML = "";
		}
		else
		{
/*　090706 delete 
			document.getElementById("ph3").style.display = "none";
*/
		}
	}
	imgElm01_height = 0;
	imgElm02_height = 0;
	imgElm03_height = 0;
	try{
		if(imgElm01.height){
			imgElm01_height = imgElm01.height; 
		}
	}catch(e){}
	try{
		if(imgElm02.height){
			imgElm02_height = imgElm02.height; 
		}
	}catch(e){}
	try{
		if(imgElm03.height){
			imgElm03_height = imgElm03.height; 
		}
	}catch(e){}

	sum_heiht = imgElm01_height + imgElm02_height + imgElm03_height;
/* 090706 修正 
	if(document.getElementById("myTourPh")){
*/
	if(sum_heiht > 50){
		var ph1OffHeight = 0;
		var ph2OffHeight = 0;
		var ph3OffHeight = 0;
		if(document.getElementById("ph1")){ph1OffHeight = Element.getHeight("ph1Text");}
		if(document.getElementById("ph2")){ph2OffHeight = Element.getHeight("ph2Text");}
		if(document.getElementById("ph3")){ph3OffHeight = Element.getHeight("ph3Text");}
		var maxOffset = [ph1OffHeight,ph2OffHeight,ph3OffHeight].max() + 150 + 'px';
		Element.setStyle("myTourPh", { height:maxOffset});
	}

}
