﻿function ShowTab($activeTab, $totalTabs, $tabLink, $tabArea) {

	// Remove 'active' class from all the tabs
	for($i = 1; $i <= $totalTabs; $i++) {
		try {
			jQuery('#' + $tabLink + $i).removeClass('active');
		} 
		catch(e) {
		}
	}

	// Add 'active' class to current active tab
	try {
		jQuery('#' + $tabLink + $activeTab).addClass('active');
	} 
	catch(e) {
	}

	// Hide all tab content
	for($i = 1; $i <= $totalTabs; $i++) {
		try {		
			jQuery('#' + $tabArea + $i).hide();
		} 
		catch(e) {
		}
	}
	// Show active tab content
	try {
		jQuery('#' + $tabArea + $activeTab).show();
	} 
	catch(e) {
	}		

}

jQuery(document).ready( function() {
	ShowTab(1, 3, 'mapsLink_', 'mapsArea_');
	ShowTab(1, 2, 'newsLink_', 'newsArea_');
	ShowTab(1, 2, 'welcomeLink_', 'welcomeArea_');
	ShowTab(1, 2, 's_mapsLink_', 's_mapsArea_'); //New Sponsorship page
	ShowTab(1, 2, 'mww_find_link_', 'mww_find_form_'); //New Making Woods Work
});
