/*

タブ切り替え表示処理

作成　2008.03.24 graphic co.Ltd.,

*/

//タブクリック時に実行される関数
function tabchange01() {
	if (getId('topics2') != null) {
		getId('topics').style.display = 'block';
		getId('topics2').style.display = 'none';
		getId('tabbtn01').style.color = '#ffffff';
		getId('tabbtn01').style.backgroundColor = '#dc6e70';
		if (getId('tabbtn01').className.substr(0, 3) != "on-") {
			getId('tabbtn01').className = "on-" + getId('tabbtn01').className;
		}

		getId('tabbtn02').style.color = '#858585';
		getId('tabbtn02').style.backgroundColor = '#cccccc';
		if (getId('tabbtn02').className.substr(0, 3) == "on-") {
			getId('tabbtn02').className = getId('tabbtn02').className.substr(3);
		}
	}
}

function tabchange02() {
	if (getId('topics') != null) {
		getId('topics').style.display = 'none';
		getId('topics2').style.display = 'block';
		getId('tabbtn02').style.color = '#ffffff';
		getId('tabbtn02').style.backgroundColor = '#dc6e70';
		if (getId('tabbtn02').className.substr(0, 3) != "on-") {
			getId('tabbtn02').className = "on-" + getId('tabbtn02').className;
		}

		getId('tabbtn01').style.color = '#858585';
		getId('tabbtn01').style.backgroundColor = '#cccccc';
		if (getId('tabbtn01').className.substr(0, 3) == "on-") {
			getId('tabbtn01').className = getId('tabbtn01').className.substr(3);
		}
	}
}

//document.getElementById() を短い名前に
function getId(n) {
	return document.getElementById(n);
}

//最初のタブ表示用
window.onload = function() {
	if (getId('tabbtn01') == null) {
		getId('topics2').style.display = 'block';
		getId('tabbtn02').style.color = '#ffffff';
		getId('tabbtn02').style.backgroundColor = '#dc6e70';
	} else {
		getId('tabbtn01').style.color = '#ffffff';
		getId('tabbtn01').style.backgroundColor = '#dc6e70';
		if (getId('tabbtn01').className.substr(0, 3) != "on-") {
			getId('tabbtn01').className = "on-" + getId('tabbtn01').className;
		}
	}

}

