function viewMoreInfo()
{
	var tab = document.getElementById('tab');
	var more = new Array();
	more[0] = document.getElementById('ranking_more');
	more[1] = document.getElementById('yahoo_more');
	more[2] = document.getElementById('real_more');
	more[3] = document.getElementById('graph_more');
	more[4] = document.getElementById('review_more');
	more[5] = document.getElementById('owner_more');
	var infomation = new Array();
	infomation[0] = document.getElementById('price');
	infomation[1] = document.getElementById('info');
	infomation[2] = document.getElementById('graph');
	infomation[3] = document.getElementById('review');
	infomation[4] = document.getElementById('owner');
	infomation[5] = document.getElementById('tech');
	infomation[6] = document.getElementById('pp');
	var tab0 = document.getElementById('tab0');
	var tab1 = document.getElementById('tab1');
	var tab2 = document.getElementById('tab2');
	var tab3 = document.getElementById('tab3');
	var tab4 = document.getElementById('tab4');
	var tab5 = document.getElementById('tab5');
	var tab6 = document.getElementById('tab6');
	var UA = navigator.userAgent;
	for(var i=0;i<=more.length-1;i++) {
		if (UA.indexOf('MSIE') != -1) {
			if (tab.childNodes[i].nodeType == 1) {
				if (more[i] != null) {
					more[i].onclick = function(){
						for(var j=0;j<=infomation.length-1;j++) {
							infomation[j].setAttribute('className', 'none');
						}
						for (j = 0; j <= tab.childNodes.length - 1; j++) {
							if (tab.childNodes[j].nodeType == 1) {
								if (tab.childNodes[j].getAttribute('className') == 'tab_class_selected') {
									tab.childNodes[j].setAttribute('className', 'tab_class');
								} else if (tab.childNodes[j].getAttribute('className') == 'long_tab_selected') {
									tab.childNodes[j].setAttribute('className', 'long_tab');
								}
							}
						}
						if (this.lastChild != '') {
							if (this.getAttribute('id') == 'ranking_more') {
								infomation[0].setAttribute('className', 'display');
								tab.childNodes[0].setAttribute('className', 'tab_class_selected');
							} else if(this.getAttribute('id') == 'yahoo_more' || this.getAttribute('id') == 'real_more') {
								infomation[1].setAttribute('className', 'display');
								tab.childNodes[1].setAttribute('className', 'tab_class_selected');
							} else if(this.getAttribute('id') == 'graph_more') {
								infomation[2].setAttribute('className', 'display');
								tab.childNodes[2].setAttribute('className', 'tab_class_selected');
							} else if(this.getAttribute('id') == 'review_more') {
								infomation[3].setAttribute('className', 'display');
								tab.childNodes[3].setAttribute('className', 'tab_class_selected');
							} else if(this.getAttribute('id') == 'owner_more') {
								infomation[4].setAttribute('className', 'display');
								tab.childNodes[4].setAttribute('className', 'tab_class_selected');
							}
						}
					}
				}
			}
		} else {
			if(more[i] != null) {
				more[i].onclick = function(){
					for(var j=0;j<=infomation.length-1;j++) {
						infomation[j].setAttribute('class', 'none');
					}
					for (j = 0; j <= tab.childNodes.length - 1; j++) {
						if (tab.childNodes[j].nodeType == 1) {
							if (tab.childNodes[j].getAttribute('class') == 'tab_class_selected') {
								tab.childNodes[j].setAttribute('class', 'tab_class');
							} else if (tab.childNodes[j].getAttribute('class') == 'long_tab_selected') {
								tab.childNodes[j].setAttribute('class', 'long_tab');
							}
						}
					}
					if (this.getAttribute('id') == 'ranking_more') {
						infomation[0].setAttribute('class', 'display');
						tab0.setAttribute('class', 'tab_class_selected');
					} else if(this.getAttribute('id') == 'yahoo_more' || this.getAttribute('id') == 'real_more') {
						infomation[1].setAttribute('class', 'display');
						tab1.setAttribute('class', 'tab_class_selected');
					} else if(this.getAttribute('id') == 'graph_more') {
						infomation[2].setAttribute('class', 'display');
						tab2.setAttribute('class', 'tab_class_selected');
					} else if(this.getAttribute('id') == 'review_more') {
						infomation[3].setAttribute('class', 'display');
						tab3.setAttribute('class', 'tab_class_selected');
					} else if(this.getAttribute('id') == 'owner_more') {
						infomation[4].setAttribute('class', 'display');
						tab4.setAttribute('class', 'tab_class_selected');
					}
				}
			}
		}
	}
}
function setDisplay()
{
	/* 価格情報以外を見えなくして初期状態に */
	var tab = document.getElementById('tab');
	var infomation = new Array();
	infomation[0] = document.getElementById('price');
	infomation[1] = document.getElementById('info');
	infomation[2] = document.getElementById('graph');
	infomation[3] = document.getElementById('review');
	infomation[4] = document.getElementById('owner');
	infomation[5] = document.getElementById('tech');
	infomation[6] = document.getElementById('pp');
	var UA = navigator.userAgent;
	for (var i=1;i<=infomation.length-1;i++) {
		if (UA.indexOf('MSIE') !=-1 )
			infomation[i].setAttribute('className', 'none');
		else
			infomation[i].setAttribute('class', 'none');
	}
	for (i=0;i<=tab.childNodes.length-1;i++) {
		if (UA.indexOf('MSIE') != -1) {
			if (tab.childNodes[i].nodeType == 1) {
				tab.childNodes[i].onclick = function() {
					for (var j=0;j<=infomation.length-1;j++) {
						infomation[j].setAttribute('className', 'none');
					}
					for (j=0;j<=tab.childNodes.length-1;j++) {
						if (tab.childNodes[j].nodeType == 1) {
							if (tab.childNodes[j].getAttribute('className') == 'tab_class_selected') {
								tab.childNodes[j].setAttribute('className', 'tab_class');
							} else if (tab.childNodes[j].getAttribute('className') == 'long_tab_selected') {
								tab.childNodes[j].setAttribute('className', 'long_tab');
							}
						}
					}
					if (this.lastChild != '') {
						if (this.getAttribute('id') == "tab0") {
							this.setAttribute('className', 'tab_class_selected');
							infomation[0].setAttribute('className', 'display');
						} else if (this.getAttribute('id') == "tab1") {
							this.setAttribute('className', 'tab_class_selected');
							infomation[1].setAttribute('className', 'display');
						} else if (this.getAttribute('id') == "tab2") {
							this.setAttribute('className', 'tab_class_selected');
							infomation[2].setAttribute('className', 'display');
						} else if (this.getAttribute('id') == "tab3") {
							this.setAttribute('className', 'tab_class_selected');
							infomation[3].setAttribute('className', 'display');
						} else if (this.getAttribute('id') == "tab4") {
							this.setAttribute('className', 'tab_class_selected');
							infomation[4].setAttribute('className', 'display');
						} else if (this.getAttribute('id') == "tab5") {
							this.setAttribute('className', 'long_tab_selected');
							infomation[5].setAttribute('className', 'display');
						} else if (this.getAttribute('id') == "tab6") {
							this.setAttribute('className', 'long_tab_selected');
							infomation[6].setAttribute('className', 'display');
						}
					}
				}
			}
		} else {
			if (tab.childNodes[i].nodeType == 1) {
				tab.childNodes[i].onclick = function() {
					for (var j=0;j<=infomation.length-1;j++) {
						infomation[j].setAttribute('class', 'none');
					}
					for (j=0;j<=tab.childNodes.length-1;j++) {
						if (tab.childNodes[j].nodeType == 1) {
							if (tab.childNodes[j].getAttribute('class') == 'tab_class_selected') {
								tab.childNodes[j].setAttribute('class', 'tab_class');
							} else if (tab.childNodes[j].getAttribute('class') == 'long_tab_selected') {
								tab.childNodes[j].setAttribute('class', 'long_tab');
							}
						}
					}
					if (this.lastChild != '') {
						if (this.lastChild.data == "価格") {
							this.setAttribute('class', 'tab_class_selected');
							infomation[0].setAttribute('class', 'display');
						} else if (this.lastChild.data == "時価情報") {
							this.setAttribute('class', 'tab_class_selected');
							infomation[1].setAttribute('class', 'display');
						} else if (this.lastChild.data == "グラフ") {
							this.setAttribute('class', 'tab_class_selected');
							infomation[2].setAttribute('class', 'display');
						} else if (this.lastChild.data == "レビュー") {
							this.setAttribute('class', 'tab_class_selected');
							infomation[3].setAttribute('class', 'display');
						} else if (this.lastChild.data == "保有者") {
							this.setAttribute('class', 'tab_class_selected');
							infomation[4].setAttribute('class', 'display');
						} else if (this.lastChild.data == "テクニカルノート") {
							this.setAttribute('class', 'long_tab_selected');
							infomation[5].setAttribute('class', 'display');
						} else if (this.lastChild.data == "パーカーポイント") {
							this.setAttribute('class', 'long_tab_selected');
							infomation[6].setAttribute('class', 'display');
						}
					}
				}
			}
		}
	}
}
addLoadEvent(setDisplay);
addLoadEvent(viewMoreInfo);

