﻿/*
	prototype is required ^^^^ for this these tabs to work...

	http://www.prototypejs.org/download

*/
/*
	This function shows the tab.
	$activeTab = The tab to make active
	$totalTabs = The total number of tabs within this tab collection
	$tabLink = The id prefix for the li element that will need setting to active
	$tabArea = The id prefix for the div element that contains the tab contents

*/

function ShowTab($activeTab, $totalTabs, $tabLink, $tabArea) {

	// Remove 'active' class from all the tabs
	try {
		for($i = 1; $i <= $totalTabs; $i++) {
			$($tabLink + $i).removeClassName('active');
		}
	} 
	catch(e) {
	}
	// Add 'active' class to current active tab
	try {
		$($tabLink + $activeTab).addClassName('active');
	}
	catch(e) {
	}

	// Hide all tab content
	try {
		for($i = 1; $i <= $totalTabs; $i++) {
			$($tabArea + $i).hide();
		}
	} 
	catch(e) {
	}

	// Show active tab content
	try{
		$($tabArea + $activeTab).show();
	}
	catch(e) {
	}

}