var $j = jQuery.noConflict();

$j(document).ready(function() {
	
	var skip = (typeof(sc_cat) != "undefined") ? sc_cat : 999;
	var barid;
	var menuid;	
	
	/*
	for (var i = 1; i < 6; i++) {
		if (i == skip){
			//$j(menuid).css({background: #fff});
			continue;
		}
		menuid = '#catmenu-' + i;
		barid = '#catbar-' + i;

		// Fade out category bars
		$j(barid).animate({opacity: 0.4}, 800);

		// Handle mouse over and click events for category menu
		$j(menuid).hover(
			function() { $j(barid).stop().animate({opacity: 1.0}, 200); },
			function() { $j(barid).stop().animate({opacity: 0.4}, 500); }
		);
		//window.alert('menuid= ' + menuid + " \nbarid= " + barid);
	}
	*/
	
	// Fade out category bars
	if (skip != 1) $j('#catbar-1').animate({opacity: 0.4}, 800);
	if (skip != 2) $j('#catbar-2').animate({opacity: 0.4}, 800);
	if (skip != 3) $j('#catbar-3').animate({opacity: 0.4}, 800);
	if (skip != 4) $j('#catbar-4').animate({opacity: 0.4}, 800);
	if (skip != 5) $j('#catbar-5').animate({opacity: 0.4}, 800);
	
	// Handle mouse over and click events for category menu
	if (skip != 1) $j('#catmenu-1').hover( function() { $j('#catbar-1').stop().animate({opacity: 1.0}, 200); }, function() { $j('#catbar-1').stop().animate({opacity: 0.4}, 500); } );
	if (skip != 2) $j('#catmenu-2').hover( function() { $j('#catbar-2').stop().animate({opacity: 1.0}, 200); }, function() { $j('#catbar-2').stop().animate({opacity: 0.4}, 500); } );
	if (skip != 3) $j('#catmenu-3').hover( function() { $j('#catbar-3').stop().animate({opacity: 1.0}, 200); }, function() { $j('#catbar-3').stop().animate({opacity: 0.4}, 500); } );
	if (skip != 4) $j('#catmenu-4').hover( function() { $j('#catbar-4').stop().animate({opacity: 1.0}, 200); }, function() { $j('#catbar-4').stop().animate({opacity: 0.4}, 500); } );
	if (skip != 5) $j('#catmenu-5').hover( function() { $j('#catbar-5').stop().animate({opacity: 1.0}, 200); }, function() { $j('#catbar-5').stop().animate({opacity: 0.4}, 500); } );

	
	// Handle mouse over and click events for category menu
	/*
	$j('#catmenu-1').hover(
		function() { $j('#catbar-1').stop().animate({opacity: 1.0}, 200); },
		function() { $j('#catbar-1').stop().animate({opacity: 0.4}, 500); }
	);
	$j('#catmenu-2').hover(
		function() { $j('#catbar-2').stop().animate({opacity: 1.0}, 200); },
		function() { $j('#catbar-2').stop().animate({opacity: 0.4}, 500); }
	);
	$j('#catmenu-3').hover(
		function() { $j('#catbar-3').stop().animate({opacity: 1.0}, 200); },
		function() { $j('#catbar-3').stop().animate({opacity: 0.4}, 500); }
	);
	$j('#catmenu-4').hover(
		function() { $j('#catbar-4').stop().animate({opacity: 1.0}, 200); },
		function() { $j('#catbar-4').stop().animate({opacity: 0.4}, 500); }
	);
	$j('#catmenu-5').hover(
		function() { $j('#catbar-5').stop().animate({opacity: 1.0}, 200); },
		function() { $j('#catbar-5').stop().animate({opacity: 0.4}, 500); }
	);
	*/
});

