$(document).ready(
function()
{
	if ( ie6 )
	{
		return;
	}
	
/* 	startAnimation(5000); */
	
	$("#collection-news").click( function(){ window.location = $("#nav-next").attr("href"); } );

	$("#collection-product").click( function(){ window.location = $("#nav-previous").attr("href"); } );
	
	$(".collection-product-left-item").click( function(){ window.location = $("#nav-previous").attr("href"); } );

	$(".collection-product-group-right-item .collection-product-image img").css("zIndex","9999");

	$(".collection-product-group-right-item .collection-product-image img").hover(
		function()
		{
			var productID = $(this).parent().attr("id");
			
			showProduct( "#" + productID.substr(0, productID.length-6 ) );
			
/*
			if( productID == "intimates-fragrance-popcornyellow-small")
			{
				$(".collection-product-group-right-item .collection-product-image").not(this).fadeTo(200, 0.6);
			}
*/
			
		},
		function()
		{
			showProduct( ".collection-product-left,.visible-block" );
/* 			$(".collection-product-group-right-item .collection-product-image").fadeTo(200,1); */
		}
	);

	$(".collection-product-group-right-item .collection-product-image img").click( function(){ window.location = $("#nav-next").attr("href"); } );

/*
	$("#collection-product-group-right").hover(
		function()
		{
		}
		,
		function()
		{
			
		}
	);
*/

});

function animate( index )
{

	currentAnimation = index;
	
	animation = animations[index];
	
	showProduct( "" );
	
}


function showProduct( product )
{
	
	var current = $( product );
	
	$(".collection-product-left-item").not(current).fadeOut(200);

	current.fadeIn(200);
			
}

function animateTimer()
{

	animate(currentAnimation);

	animation = animations[currentAnimation];

	currentAnimation++;
	
	if (currentAnimation >= animations.length)
	{
		currentAnimation = 0;
	}
	
	startAnimation(animation.timing * 1000);
}

function startAnimation(timing)
{
	if (animationEnabled)
	{
		animationTimer = setTimeout("animateTimer()", timing);
	}
	else
	{
		animationTimer = null;
	}
}

function stopAnimation()
{
	clearTimeout( animationTimer );
}

function resetImages()
{

};
