$=jQuery.noConflict();

$(document).ready(function(){
	
	if(ex($("#featured-boxes"))) {
	
		$("#featured-boxes .pagination li a").each(function(){
			
			$(this).html("<strong>"+$(this).html()+"</strong>");
			
		});
		
		$(".featured-thumbnail").each(function(){
			
			$(this).css({
				backgroundImage: "url('"+$(this).find("img").attr("src")+"')",
				backgroundColor: $("body").css("background-color")
			});
			
		});
		
		$(".featured-excerpt").each(function(){
			
			firstP=$(this).find("p").eq(0);
			
			$(this).find("a").eq(0).remove();
			
			if(ex(firstP)) {
				if(firstP.html().length<2) {
					firstP.remove();				
				}
			}
			
			$(this).css({
				opacity: 0,
				display: "block"				
			});
			
		});
		
		$("#featured-boxes .featured-box").click(function(){
			document.location.href=$(this).attr("rel");			
		}).hover(function(){
			
			$(this).find(".featured-boxes-shadow").animate({
				opacity: .75			
			},500);
			
			$(this).find("h3").css("color","#88ccff");
						
		},function(){
			
			$(this).find(".featured-boxes-shadow").animate({
				opacity: .5			
			},500);
			
			$(this).find("h3").css("color","#ffffff");
			
		}).prepend("<div class=\"featured-boxes-shadow\"></div>");
		
		$(".featured-boxes-shadow").each(function(){ $(this).css({ opacity: .5 }); });
		
	}
	
});

function ex(element) {
	
	if(element.length>0) { return true; } else { return false; }
	
}
