$j(document).ready(function(){


// Clear Search Form Defaults on entering field

	$j('#siteSearchText').clearinput();

// Opening & Closing Preferences

	$j('.drawerContent').hide();
	$j('.drawerHeader').bind('click', function () {
		if ($j(this).next('.drawerContent').is(':hidden')) {
			$j('.drawerContent').slideUp('slow');
			$j('.drawerHeader').removeClass('open');
			$j(this).toggleClass('open');
			$j(this).next('.drawerContent').slideDown('slow');
		}
	});

// Home Page Tabs
	var startAnimation = 1
	var activeTab = 1
	
	function fadeTab () {
		if (startAnimation == 1) {
			if (activeTab == 5) {
				var nextTab = 1
			} else {
				var nextTab = activeTab + 1
			}
			// var activeHomeTab = 'homeTab-' + activeTab
			var nextHomeTab = 'homeTab-' + nextTab
			$j("#" + 'homeTab-' + activeTab + ' .activeTab').fadeOut("slow");
			$j("#" + 'homeTab-' + nextTab + ' .activeTab').fadeIn("slow");
			$j("#" + 'homeTabContent-' + activeTab).fadeOut("slow");
			$j("#" + 'homeTabContent-' + nextTab).fadeIn("slow");
			$j(this).oneTime (6000, function() {
				activeTab = nextTab;
				fadeTab ();
			});
		}
	}
	$j('.homeTabContent').hide();
	$j('.homeTab .activeTab').hide();
	$j('#homeTab-1 .activeTab').show();
	$j('#homeTabContent-1').show();
	setTimeout(function() { fadeTab();}, 6000);
	$j('.homeTab').bind('click', function () {
			startAnimation = 0;
			var thisID = $j(this).attr('id');
			$j('.homeTab .activeTab').hide();
			$j('#' + thisID + ' .activeTab').show();
			$j('.homeTabContent').hide();
			$j('.' + thisID).show();
		})

	
// Home Page Jump Links

	$j('#popUpJumplinks h5').click(function() {
		if ($j('#jumpLinks').is(':visible')) {
			$j('#jumpLinks').hide();
		}
		else {
			$j('#jumpLinks').show();
		}	
	});
	
	$j('#closeJumpLinks').click(function() {
		$j('#jumpLinks').hide();
	});
	

// Featured Customers--Disabled as may have other way
/*
	$j(".tx-t3references-pi1-listrow tr:eq(0)").addClass('featuredCustomer');
	$j(".tx-t3references-pi1-listrow tr:eq(0) td").addClass('featuredCustomer');
	$j(".tx-t3references-pi1-listrow tr:eq(1) td").addClass('featuredCustomer');
	$j(".tx-t3references-pi1-listrow tr:eq(2) td").addClass('featuredCustomer');
*/		
	


});
// End Document Ready