// SECONDARY PROMO CAROUSEL

$(function() {
    // Create carousel
    // At launch, not needed as there are only 4 secondary promos
    $("#secondary_boxesa").jCarouselLite({
			btnPrev: "#prev",
			btnNext: "#next",
			visible: 4,
			scroll: 4,
			start: 0,
			circular: true
    });
    
		$("a.sb_controls").click(function(e){
			e.preventDefault();
		});

		$("a.sb_controls").mouseover(function(e){
			$(this).removeClass("offstate");
		});
		
		$("a.sb_controls").mouseout(function(e){
			$(this).addClass("offstate");
		});
	$("<img>").attr("src","./images/Arrow_Right_Blue.png");
	$("<img>").attr("src","./images/Arrow_Left_Blue.png");
	

	if (!($.browser.msie && ($.browser.version < 7.0))) {
		$("#secondary_boxesa li img").each(function() {
			src = $(this).attr("src");
			// Preload the hover states
			jQuery("<img>").attr("src",$(this).attr("src").replace(/\./,"_over."));
			
			$(this).mouseover(function() {
				if (!src.match("_over"))
					$(this).attr("src",$(this).attr("src").replace(/\.png/,"_over.png"));
					$(this).attr("src",$(this).attr("src").replace(/\.gif/,"_over.gif"));
			}).mouseout(function() {
				$(this).attr("src",$(this).attr("src").replace(/_over/,""));
			});
		})
	}
});


