/* tenpo-subHeader adjust function */
if(window.attachEvent){
	window.attachEvent("onload",adjustTabPosition);
}else if(window.addEventListener){
	window.addEventListener("load",adjustTabPosition,false);
}

function adjustTabPosition(){
	var debugResult = "";
	var tabs = [];
	var tabsIds = ["tenpoTab01","tenpoTab02","tenpoTab03","tenpoTab04","tenpoTab05","tenpoTab06","tenpoTab07"];
	var positionLeft = new Number();
	for(var tabOrder=0;tabOrder<tabsIds.length;tabOrder++){
		var tmpTarget = document.getElementById(tabsIds[tabOrder]);
		if(tmpTarget){
			tabs.push(tmpTarget);
			debugResult += "tabs.push("+tmpTarget.id+") ran.\n";
		}
	}
	debugResult += "tabs.length::"+tabs.length+".\n";
	if(window['defaultChild']){
		var defaultTab = document.getElementById(defaultChild);
		defaultTab.style.backgroundPosition = "center bottom";
		defaultTab.style.cursor = "auto";
	}
	for(var tabOrder2=0;tabOrder2<tabs.length;tabOrder2++){
		var targetEl = tabs[tabOrder2];
		targetEl.style.top = String(-29*tabOrder2) + "px";
		debugResult += "\""+targetEl.id+"\".style.top = "+targetEl.style.top+".\n";
		targetEl.style.left = String(positionLeft) + "px";
		debugResult += "\""+targetEl.id+"\".style.left = "+targetEl.style.left+".\n";
		positionLeft += Number(targetEl.clientWidth) - 1;
		targetEl.style.visibility = "visible";
	}
	return debugResult;
}
//tenpo-tabHeader toggle logic.
function tabMouseOver(targetName){
	var target = document.getElementById(targetName);
	if(target){
		target.style.backgroundPosition = "center bottom";
	}
}
function tabMouseOut(targetName){
	var target = document.getElementById(targetName);
	if(target){
		target.style.backgroundPosition = "center top";
	}
}
//adjust height of div#swf_body
function adjustSwfBody(targetId,height){
	var targetEl = document.getElementById(targetId);
	if(targetEl&&height){
		height = height.replace("px","")
		if(height){
			targetEl.style.height = height + "px";
		}
	}
}