var tabs, activeTab = null;


function tabInit(this_tab){ //protected
	if(arguments[0]!="undefined") bgImg = arguments[0];
	tabs = document.getElementById('tabs');
	tabs.top=tabs.offsetTop;
	if(IE5 && !MAC) tabs.style.top=(tabs.top+3)+"px";
	activeTab = document.getElementById(this_tab);
	activeTab.content= document.getElementById("current_content");
	activeTab.className="tabActive";
	tabs.onmouseover=tabOver;
	tabs.onmouseout=tabOff;
	if(MAC_IE5) document.body.setAttribute("onunload","switchTabs('tab2')"); // odd fix for odd behavior.
 }	
	
	function tabOver(e) {
		var tab= getTarget(e);

		if (tab.className.indexOf("tab") == -1 && tab.parentNode.className.indexOf("tab") == -1) return;
		if(!tab.id) tab = tab.parentNode;
		if (activeTab != tab)
			// don't give an id to elements that are nested in a tab.
		hoverTab(tab);
	}
	function tabOff(e) {
		var tab= getTarget(e);
		var contentName;
			
		if (tab.className.indexOf("tab") == -1 && tab.parentNode.className.indexOf("tab") == -1) return;
		if(!tab.id) tab= tab.parentNode;

		if (activeTab != tab) hoverOff(tab);
	}
function getTarget(event){
	return window.event ? window.event.srcElement : event.target.tagName ? event.target : 
	event.target.parentNode;
}
	function hoverTab(tab) {
		tab.className= "tabHover";
	}
	function hoverOff(tab) {
		tab.className= "tab";
	}
	function resetTab(tab) {
		tab.className= "tab";
		tab.className= "tabHover";
		tab.className= "tab";
	 	if(IE5 && !MAC) activeTab.filters.alpha.opacity=100;
		setVisible(tab.content,false);
	 	//alert("tab.id="+tab.id + "\n tab.style.top=" +tab.style.top+"\n\nactiveTab.id="+activeTab.id + "\n activeTab.style.top=" +activeTab.style.top);
	}

	function init(this_tab){
		tabInit(this_tab);
	}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
