var $j=jQuery.noConflict();

$j(document).ready(function(){
	/*var hSlideSpeed = 250;
	var vSlideSpeed = 175;
	$j('#featured li').mouseenter( function(){
		$j('#featured li p').hide();
		$j('#featured li .learnMore').hide();
		$j('#featured li').stop().animate( {'width':'14em'}, hSlideSpeed ).children('img').stop().animate( {'paddingLeft':'2.1em'}, hSlideSpeed );
		$j(this).css('text-align', 'left').stop().animate( {'width':'31em'}, hSlideSpeed );
		$j(this).children('h2').stop().animate( {'paddingLeft':'5em', backgroundPosition:'14px 4px'}, hSlideSpeed );
		$j(this).children('img').stop().animate( {'paddingLeft':'1em'}, hSlideSpeed, function(){
			$j(this).parent().children('p').slideDown(vSlideSpeed);
			$j(this).parent().children('.learnMore').slideDown(vSlideSpeed);  
		});
	});
	$j('#featured li').mouseleave( function(){
		$j('#featured li').stop().animate( {'width':'19.4em'}, hSlideSpeed ).children('img').stop().animate( {'paddingLeft':'5.8em'}, hSlideSpeed );
		$j(this).children('h2').stop().animate( {'paddingLeft':'0em', backgroundPosition:'-62px 4px'}, hSlideSpeed );
		$j(this).children('p').hide();
		$j(this).children('.learnMore').hide();
	});*/
	$j('#featured li').hover( function(){
		$j(this).children('div').slideDown(300);
	}, function(){
		$j(this).children('div').slideUp(600);
	}); 
	
	$j('#featured .learnMore img').hover( function(){
		$j(this).attr('src', '/custom/frontierbk/image/learnMoreFlareHover.png');
	}, function(){
		$j(this).attr('src', '/custom/frontierbk/image/learnMoreFlare.png');
	});
	$j(".categoryPage #secondaryProducts ul li").click(function(){
	 window.location=$j(this).find("a").attr("href"); return false;
	});
	$j(".categoryPage #secondaryProducts ul li").hover(
		function(){
			$j(this).addClass("active");
		},
		function(){
			$j(this).removeClass("active");
		}
	);
	
	$j('.categoryPage #featuredProduct h1, .categoryPage #secondaryProducts h2 a, .productPage .productHead h1').each( function(){
		var stringHolder = $j(this).text();
		var findSpace = stringHolder.indexOf(" ");
		var newString = "<span>" + stringHolder.substring(0, findSpace) + "</span>";
		newString = newString + stringHolder.substring(findSpace)
		$j(this).html(newString);
	});
});