
var currentStationTab = 0;

function tabSwitcher1(id){
	var mytabcontent = $('allTabContent').childElements();
	mytabcontent.each(function(s){s.hide();})
	$(mytabcontent[id]).show();
	
	var tabbuttons = $('tabList').childElements();
	tabbuttons.each(
		function(s){
			s.removeClassName('active');
		}
	)
	$(tabbuttons[id]).addClassName('active');
	
	currentStationTab = id;
}  

//tabSwitcher('link1',1,'tabContent2')


/*for this function use link1, link2, link3... as ID for the element that must have the class="active"
use tabContent1, tabContent2, tabContent3... as ID for DIV that have to be visible or not*/
var thepreviouscid="tabContent1";
var thepreviouscid2="link1";

function tabSwitcher(ind,thebottom){
	//
	
	var mynode = "link"+ind;
	//
	document.getElementById(thepreviouscid).style.display="none";
	document.getElementById(thebottom).style.display="block";
	//
	
	var so = new SWFObject("swf/map_resp_00.swf", "map", "668", "380", "8", "#FFFFFF");
			
	so.addParam("allowScriptAccess", "always");
	so.addVariable("type", ind);
	so.write("tabContent1");
		
	thepreviouscid=thebottom;
	//
	targetElement2 = document.getElementById(thepreviouscid2);
	for (var k=0; k < targetElement2.attributes.length; k++) {
		if (targetElement2.attributes.item(k).nodeName == 'class') {
			if(targetElement2.attributes.item(k).nodeValue == 'lastActive'){
			targetElement2.attributes.item(k).nodeValue = "last";
			} else {
			targetElement2.attributes.item(k).nodeValue =  "";
			}
		}
	}
	//
	targetElement = document.getElementById(mynode);
	for (var k=0; k < targetElement.attributes.length; k++) {
		if (targetElement.attributes.item(k).nodeName == 'class') {
			if (targetElement.attributes.item(k).nodeValue=='last'){
		  		targetElement.attributes.item(k).nodeValue = "lastActive";
			} else {
				targetElement.attributes.item(k).nodeValue =  "active";
			}
		}
	}
	thepreviouscid2=mynode;
	
}

function tabExpander(cid,mynode){
	
	//alert("cid=" + cid + " and thepreviouscid=" + thepreviouscid)
	document.getElementById(thepreviouscid).style.display="none";
	document.getElementById(cid).style.display="block";
	thepreviouscid=cid;
	
	targetElement2 = document.getElementById(thepreviouscid2);
	for (var k=0; k < targetElement2.attributes.length; k++) {
		if (targetElement2.attributes.item(k).nodeName == 'class') {
			if(targetElement2.attributes.item(k).nodeValue == 'lastActive'){
			targetElement2.attributes.item(k).nodeValue = "last";
			} else {
			targetElement2.attributes.item(k).nodeValue =  "";
			}
		}
	}
	
	targetElement = document.getElementById(mynode);
	for (var k=0; k < targetElement.attributes.length; k++) {
		if (targetElement.attributes.item(k).nodeName == 'class') {
			if (targetElement.attributes.item(k).nodeValue=='last'){
		  		targetElement.attributes.item(k).nodeValue = "lastActive";
			} else {
				targetElement.attributes.item(k).nodeValue =  "active";
			}
		}
	}
	thepreviouscid2=mynode;
}

