var red_rollover_text_color = '#DC0009';
var text_color = '#666';
//var offset_top = -41;
var offset_top = 0;
var gotoAnchor = '';

$(document).ready(function()
{
	$('.product').mouseover(function()
	{
		$(this).find('.product_name').css({color:red_rollover_text_color});  //  label under photo
		$(this).find('.product_thb').css({'display':'none'});  // norm image
		$(this).find('.product_thb_red').css({'display':'block'});  // red image
		$(this).find('.prod_roll_label').css({'display':'block'});  // text inside of image
	});
	
	$('.product').mouseout(function()
	{
		$(this).find('.product_name').css({color:text_color});  // label under photo
		$(this).find('.product_thb').css({'display':'block'});  // norm image
		$(this).find('.product_thb_red').css({'display':'none'});  // red image
		$(this).find('.prod_roll_label').css({'display':'none'});  // text inside of image
	});
	
	$('.recent_item').mouseover(function()
	{
		$(this).find('.recent_thb').css({'display':'none'});  // norm image
		$(this).find('.recent_thb_red').css({'display':'block'});  // red image
	});
	
	$('.recent_item').mouseout(function()
	{
		$(this).find('.recent_thb').css({'display':'block'});  // norm image
		$(this).find('.recent_thb_red').css({'display':'none'});  // red image
	});	

	// //  for the sidebar to move
	// $('#heads,#handles,#gloves,#helmets,#protective,#bags,#footwear,#accessories,#training').bind('mouseenter', function()
	// {
	// 	var offset = $(this).offset();
	// 	var top = $('#sidebar').css('top');
	// 	if(parseInt(top) != (offset.top + offset_top))
	// 	{
	// 		$("#sidebar").animate({
	// 			top: offset.top + offset_top
	// 		}, {duration:500, easing:'easeInOutExpo'} );
	// 	}
	// });
	
});

// ========================================
// External Interface for Flash
// ========================================
var jsReady = false;
function isReady()
{
	return jsReady;
}

function flashInit()
{
	jsReady = true;
}

function scroll_to_anchor(a_name)
{
	gotoAnchor = a_name;
	
	//  IE 6 bs
	var browser = jQuery.browser;
	if(browser.msie && browser.version < 7)
	{
		window.location = gotoAnchor;
	}
	else
	{
		$.scrollTo(gotoAnchor, 750, {easing:'easeInOutExpo', onAfter:update_url});
	}
}

function update_url()
{
	// window.location = gotoAnchor;
}
