/*-------------------------------------------
    Tabbing for Home page
-------------------------------------------*/

$$("a.tab").each( function(el) {
	el.observe("click", function(ev) {
		el = Event.element(ev);
		Event.stop(ev);
		id = el.name;
		if (!id)
			id = el.up("a").name;
		var tabs = $$(".tab_content");
		x = 0;
		while (x < tabs.length) {
			tab = tabs[x];
			if (tab.id.replace("tab_","") == id)
				tab.style.display = "block";
			else
				tab.style.display = "none";
			x++;
		}
		var tabs = $$(".tab");
		x = 0;
		while (x < tabs.length) {
			tab = tabs[x];
			if (tab.name == id)
				tab.addClassName("active");
			else
				tab.removeClassName("active");
			x++;
		}
	});
});
