var cycling = false;

$(function()
{	
	$(".option h3 a, .flickr h3 a, .coolcats h3 a").parent().next().hide();
	$(".option li.alt").hide();
	
	$("a.show, a.hide").click(function(){
		$("div.featured-holder, div.featured-holder-closed").slideToggle("slow");
		return false;
	});
	
	$(".option h3 a, .flickr h3 a, .coolcats h3 a, .post h3 a").click(function(){
		$(this).parent().next().slideToggle("slow");
		return false;
	});
	
	$(".option li a.plus").click(function(){
		$(this).parent().css({"border-bottom":"none"});
		$(this).parent().next().slideToggle("slow",function(){
			if($(this).css("display")=="none")
				$(this).prev().css({"border-bottom":"1px dotted #999"});
		});
		return false;
	});
	
	if($("div.featured-holder").length>0){
		cycleFeatures();
	}else if($("div.featured-holder-closed").length>0){
		$("a.show, a.hide").click(function(){
			cycleFeatures();
			return false;
		});
	}
});

function cycleFeatures()
{	
	if(cycling==false)
	{
		$('.featured').cycle({ 
		    fx:    'scrollHorz', 
		    pause:  1,
	    	timeout:  8000
		});
		cycling = true;
	}
}