current_tab=0;
archor = Array();
window.onload=function () {
	if(document.getElementById('tabs')) {
		var menu = document.getElementById('tabs');
		var lis = menu.getElementsByTagName('li');
		for(i=0;i<lis.length;i++)
		{
			archor[i]=lis[i].getElementsByTagName('a')[0];
			tab_select(archor[i],i,lis);
			if(i!=current_tab) {
				var root = archor[i].getAttribute('href').split('#');
				document.getElementById(root[1]).style.display='none';
				lis[i].setAttribute('class','');
				lis[i].setAttribute('className','');
			}else{
				var root2 = archor[i].getAttribute('href').split('#');
				document.getElementById(root2[1]).style.display='block';
				lis[i].setAttribute('class','current');
				lis[i].setAttribute('className','current');
			}
		}
	}
}
function tab_select(obj,i,lis) {
	obj.onclick=function() {
		lis[current_tab].setAttribute('class','');
		lis[current_tab].setAttribute('className','');
		lis[i].setAttribute('class','current');
		lis[i].setAttribute('className','current');
		var id_pre=obj.getAttribute('href').split('#');
		var id = id_pre[1];
		if(subcontent=document.getElementById(id)) {
			subcontent.style.display='block';
		}
		if(i!=current_tab) {
			
			var root3=archor[current_tab].getAttribute('href').split('#')
			document.getElementById(root3[1]).style.display='none';
		}else{
			var root4 = archor[current_tab].getAttribute('href').split('#');
			document.getElementById(root4[1]).style.display='block';
		}

		current_tab=i;
		return false;
	}
}
