function clearTab () {
	document.getElementById ("profileBlock").style.display = "none";
	document.getElementById ("indexBlock").style.display = "none";
	document.getElementById ("impressionBlock").style.display = "none";
	document.getElementById ("popBlock").style.display = "none";
	document.getElementById ("freeBlock").style.display = "none";
	if (document.getElementById ("profileTab")) document.getElementById ("profileTab").src = "/book/common/images/tab_navigation/button_01.gif";
	if (document.getElementById ("indexTab")) document.getElementById ("indexTab").src = "/book/common/images/tab_navigation/button_02.gif";
	if (document.getElementById ("impressionTab")) document.getElementById ("impressionTab").src = "/book/common/images/tab_navigation/button_03.gif";
	if (document.getElementById ("popTab")) document.getElementById ("popTab").src = "/book/common/images/tab_navigation/button_04.gif";
	if (document.getElementById ("freeTab")) {
		document.getElementById ("freeTab").style.backgroundPosition = "0 0";
		document.getElementById ("freeTab").style.color = "#666";
		document.getElementById ("freeTab").firstChild.style.backgroundPosition = "right -60px";
	}
}
if (document.getElementById) {
	addWindowListener ("load", function () {
		if (document.getElementById ("profileTab")) {
			document.getElementById ("profileTab").style.cursor = "pointer";
			document.getElementById ("profileTab").onclick = function () {
				clearTab ();
				this.src = "/book/common/images/tab_navigation/button_01_selected.gif";
				document.getElementById ("profileBlock").style.display = "block";
			};
			document.getElementById ("profileTab").onmouseover = function () {
				if (document.getElementById ("profileBlock").style.display != "block") this.src = "/book/common/images/tab_navigation/button_01_over.gif";
			};
			document.getElementById ("profileTab").onmouseout = function () {
				if (document.getElementById ("profileBlock").style.display != "block") this.src = "/book/common/images/tab_navigation/button_01.gif";
			};
		}
		if (document.getElementById ("indexTab")) {
			document.getElementById ("indexTab").style.cursor = "pointer";
			document.getElementById ("indexTab").onclick = function () {
				clearTab ();
				this.src = "/book/common/images/tab_navigation/button_02_selected.gif";
				document.getElementById ("indexBlock").style.display = "block";
			};
			document.getElementById ("indexTab").onmouseover = function () {
				if (document.getElementById ("indexBlock").style.display != "block") this.src = "/book/common/images/tab_navigation/button_02_over.gif";
			};
			document.getElementById ("indexTab").onmouseout = function () {
				if (document.getElementById ("indexBlock").style.display != "block") this.src = "/book/common/images/tab_navigation/button_02.gif";
			};
		}
		if (document.getElementById ("impressionTab")) {
			document.getElementById ("impressionTab").style.cursor = "pointer";
			document.getElementById ("impressionTab").onclick = function () {
				clearTab ();
				this.src = "/book/common/images/tab_navigation/button_03_selected.gif";
				document.getElementById ("impressionBlock").style.display = "block";
			};
			document.getElementById ("impressionTab").onmouseover = function () {
				if (document.getElementById ("impressionBlock").style.display != "block") this.src = "/book/common/images/tab_navigation/button_03_over.gif";
			};
			document.getElementById ("impressionTab").onmouseout = function () {
				if (document.getElementById ("impressionBlock").style.display != "block") this.src = "/book/common/images/tab_navigation/button_03.gif";
			};
		}
		if (document.getElementById ("popTab")) {
			document.getElementById ("popTab").style.cursor = "pointer";
			document.getElementById ("popTab").onclick = function () {
				clearTab ();
				this.src = "/book/common/images/tab_navigation/button_04_selected.gif";
				document.getElementById ("popBlock").style.display = "block";
			};
			document.getElementById ("popTab").onmouseover = function () {
				if (document.getElementById ("popBlock").style.display != "block") this.src = "/book/common/images/tab_navigation/button_04_over.gif";
			};
			document.getElementById ("popTab").onmouseout = function () {
				if (document.getElementById ("popBlock").style.display != "block") this.src = "/book/common/images/tab_navigation/button_04.gif";
			};
		}
		if (document.getElementById ("freeTab")) {
			document.getElementById ("freeTab").style.cursor = "pointer";
			document.getElementById ("freeTab").onclick = function () {
				clearTab ();
				this.style.backgroundPosition = "0 -240px";
				this.style.color = "#fff";
				this.firstChild.style.backgroundPosition = "right -300px";
				document.getElementById ("freeBlock").style.display = "block";
			};
			document.getElementById ("freeTab").onmouseover = function () {
				if (document.getElementById ("freeBlock").style.display != "block") {
					this.style.backgroundPosition = "0 -120px";
					this.style.color = "#555";
					this.firstChild.style.backgroundPosition = "right -180px";
				}
			};
			document.getElementById ("freeTab").onmouseout = function () {
				if (document.getElementById ("freeBlock").style.display != "block") {
					this.style.backgroundPosition = "0 0";
					this.style.color = "#666";
					this.firstChild.style.backgroundPosition = "right -60px";
				}
			};
		}
		var id = location.search.getParameter ("select", "&");
		if (!id) {
		    if (typeof(defaultTab) == 'undefined' || !defaultTab) {
			id = document.getElementById ("profileTab") ? "profile" : (document.getElementById ("indexTab") ? "index" : (document.getElementById ("impressionTab") ? "impression" : (document.getElementById ("popTab") ? "pop" : "free")));
		    } else {
			id = defaultTab;
		    }
		}
		document.getElementById (id + "Tab").onclick ();
	});
}

