$(document).ready(function(){

	CreateTabs();
	
});


//===========================================================
// InitializeTabs
//===========================================================
function CreateTabs() {
	try {

			$('.tabs').show();
			$('.tabPage').hide(); // Hide all tab pages
			$('.tabPage:first').show();
			$('.tabPage:first').addClass('tabPageSelected');
			$('.tabs li:first').addClass('tabSelected'); // Set the class of the first link to active
			
			$('.tabs li a').click(function(){ //When a tab link is clicked
				
				// switch tab
				$('.tabs li').removeClass('tabSelected'); // Remove active class from all links
				$(this).parent().addClass('tabSelected'); //Set clicked link class to active
				var tabPageToDisplay = $(this).attr('href'); // Set variable tabPageToDisplay to value of href attribute of clicked link
				
				//hide current tab page and show the next
				$(".tabPageSelected").fadeOut(200, function() {
					$(this).removeClass('tabPageSelected'); 						 
					$(tabPageToDisplay).fadeIn(300).addClass('tabPageSelected');
					});
				
				return false;
				
				});

		}
	catch (error) {
		window.status = ( "CreateTabs: " + error.description );
		}
	}
