// Javascript for the What We Do page

// displays the info box for a service, using fancy effects

function showTab(tabName) {
	var newTab, oldTab;
	newTab = $('tab_'+tabName);
	if (newTab.visible()) return;
	
	tabs = document.getElementsByClassName('serviceInfo');
	
	for (i=0;i<tabs.length;i++) {
		if (tabs[i].visible()) {
			oldTab = tabs[i];

		}
	}
	
	$('link_'+tabName).addClassName('liveTab');
	$('link_'+tabName).blur();
	if (oldTab) {
		if ($('link_'+oldTab.id.substring(4,64)))
			$('link_'+oldTab.id.substring(4,64)).removeClassName('liveTab');
		new Effect.BlindUp(oldTab,{duration: 0.4});
	}
	new Effect.BlindDown(newTab,{delay: 0.2, duration: 0.4});
		
}