var $j = jQuery.noConflict();

var a = 1;
function scroll_gradient()
{
	if( a == 0 )
	{
			$j('#topbar #gradient').stop();
			$j('#topbar #gradient').animate( {backgroundPosition: "-4000px 0" }, 20000 );
			a = 1;
	}
	else
	{
			$j('#topbar #gradient').stop();
			$j('#topbar #gradient').animate( {backgroundPosition: "0 0" }, 20000 );
			a = 0;
	}
	
		
}

$j(function() {

	var $infoDisplay = $j('#powerline #infodisplay');
	
	
	$j(document).ready( function() {
		$j('#topbar #gradient').css( { backgroundPosition: "0  0" } );
		$j('#topbar #gradient').animate( {backgroundPosition: "-4000px 0" }, 20000 );
		setInterval( "scroll_gradient()", 20000 );

	} );

	$j('#categories div').hover( function() { 
			$j(this).addClass( 'category-item-lvl' + $j(this).attr('colorLevelHover') ); },
		function() {
			$j(this).removeClass( 'category-item-lvl' + $j(this).attr('colorLevelHover') ); 
		}
	) ;

	$j('div .clickable').click( function() {
		window.location = $j(this).attr('url');
		return false;
	});

	$j('#powerline #fb-icon a').hover(
		function() {
			$infoDisplay.html("Connect to my Facebook Profile.");
			$infoDisplay.fadeIn('fast');
		},
		function() {
			$infoDisplay.hide('fast');
		}
	 );

	$j('#powerline #linkedin-icon a').hover(
		function() {
			$infoDisplay.html("Connect to my LinkedIn Profile.");
			$infoDisplay.fadeIn('fast');
		},
		function() {
			$infoDisplay.hide('fast');
		}
	 );

	$j('#powerline #twitter-icon a').hover(
		function() {
			$infoDisplay.html("Follow me on Twitter.");
			$infoDisplay.fadeIn('fast');
		},
		function() {
			$infoDisplay.hide('fast');
		}
	 );

	$j('#powerline #rss-icon a').hover(
		function() {
			$infoDisplay.html("Subscribe to ionorbit.com via RSS Feeds.");
			$infoDisplay.fadeIn('fast');
		},
		function() {
			$infoDisplay.hide('fast');
		}
	 );

	$j('#powerline #photo-gallery a').hover(
		function() {
			$infoDisplay.html("Visit My Photo Gallery.");
			$infoDisplay.fadeIn('fast');
		},
		function() {
			$infoDisplay.hide('fast');
		}
	 );

} );
