currentTab = "";
tabs = "";
tab_contents = "";

function initTabs(){
	tabs = document.getElementsBySelector(".tabcontainer .tabs span");
	tab_contents = document.getElementsBySelector(".tabcontainer .tabcontents div");
	currentTabArr = document.getElementsBySelector(".tabcontainer .tabs span.current");
	currentTab = currentTabArr[0];
	for(var i=0; i<tabs.length; i++) {
		if(tabs[i]!=currentTab)
			document.getElementById(tabs[i].getAttribute('for')).style.display = "none";
	}
	YAHOO.util.Event.addListener(tabs, "click", switchTabs);
}
function switchTabs(e) {
	document.getElementById(currentTab.getAttribute('for')).style.display = "none";
	document.getElementById(this.getAttribute('for')).style.display = "block";
	
	YAHOO.util.Dom.removeClass(currentTab, "current");
	YAHOO.util.Dom.addClass(this, "current");
	
	currentTab = this;
}

YAHOO.util.Event.addListener(window, "load", initTabs);