$(document).ready(function() {  
	
	// *** Home Tabs ***

    $('#homeLayout #primaryContent').tabs({ fx: { opacity: 'toggle', duration: 'fast' } });
	
	$('#homeoptions-nav a').click(function () { 
		$('#homeoptions-nav .current').removeClass('current');
		$(this).addClass('current');
	});

	// *** ForkTrack Tabs ***

    $('#forktrackFeatures').tabs({ fx: { opacity: 'toggle', duration: 'fast' } });
	
	$('#forktrackfeatures-nav a').click(function () { 
		$('#forktrackfeatures-nav .current').removeClass('current');
		$(this).addClass('current');
	});
	
	
	// *** New Forklifts Tabs ***
	
	$('#newforklifts').tabs({ fx: { opacity: 'toggle', duration: 'fast' } }); 
	
	$('#newforkliftsNav a').click(function () { 
		$('#newforkliftsNav .current').removeClass('current');
		$(this).addClass('current');
	});

	// New Forklifts Animations
	
	$("#newforklifts .tabdiv a").hover(function() {
	    $(this).stop().animate({ top: "-10px" }, 200);
	},function(){
	    $(this).stop().animate({ top: "0px" }, 300);
	});
	
	// New Forklifts Animations (Product Detail Page)
	
	$(".interested a").hover(function() {
	    $(this).stop().animate({ top: "-10px" }, 200);
	},function(){
	    $(this).stop().animate({ top: "0px" }, 300);
	});

	
	// update the tab that is being shown
	
	$("#newforkliftsNav").bind('tabsselect', function(event, ui) {
		window.location.href=ui.tab;
		//window.location.href=ui.tab; // UPDATE THIS TO SHOW CURRENT TAB USING EE SEGMENTS (CATEGORIES)
	});
	
	// Update highlighted tab
/*	var url = $.url();
	tabSelect = url.segment(4); // UPDATE THIS
	
	if(tabSelect != null) {
		// update highlighted tab
		//tabSelect = url.segment(4);
		$('#newforkliftsNav .current').removeClass('current');
		$('#newforkliftsNav li a[href="#' + (tabSelect) + '"]').addClass("current");
	}*/
	
	
	if(document.location.hash!='') {
		// update highlighted tab
		tabSelect = document.location.hash.substr(1);
		$('#newforkliftsNav .current').removeClass('current');
		$('#newforkliftsNav li a[href="#' + (tabSelect) + '"]').addClass("current");
	}
	
});

