// Set the initial height
var sliderHeight = "100px";

$(document).ready(function(){
	// Show the slider content
	$('.slider').show();
	
	$('.slider').each(function () {
		var current = $(this);
		current.attr("box_h", current.height());
	});
	
	$(".slider").css("height", sliderHeight);
});

// Set the initial slider state
var slider_state = " 	";

function sliderAction(id)
{
	var s = "#" + id;
	alert(s);
	if (slider_state == "close")
	{
		
		sliderOpen(id);
		slider_state = "open"
		//$(".slider_menu").html('<a href="#" onclick="return sliderAction();">Close</a>');
		$(s).html('<a href="#" onclick="return sliderAction('+id+');">Close</a>');
	}
	else if (slider_state == "open")
	{
		sliderClose(id);
		slider_state = "close";
		//$(".slider_menu").html('<a href="#" onclick="return sliderAction();">More...</a>');
		$(s).html('<a href="#" onclick="return sliderAction('+id+');">More...</a>');
	}
	
	return false;
}

function sliderOpen(id)
{
	var s = "#"+ id;
	//var open_height = $(".slider").attr("box_h") + "px";
	var open_height = $(s).attr("box_h") + "px";
	alert(open_height);
	$(s).animate({"height": open_height}, {duration: "slow" });
	//$(id).animate({"height": open_height}, {duration: "slow" });
}

function sliderClose(id)
{
	var s = "#" + id;
	//$(".slider").animate({"height": sliderHeight}, {duration: "slow" });
	$(s).animate({"height": sliderHeight}, {duration: "slow" });
}
function sliderTest()
{
	
	$("fade_davidt").show("slow");
}