var sliderHeight = "100px";

$(document).ready
(
 	function()
	{
		$('#newsPage').accordion
		(
			{
				header: '.news-head',
				animated: 'bounceslide',
				alwaysOpen: false,
				autoHeight: false,
				clearStyle: true,
				fillSpace: false,
				active: 0
			}
		);
	}
);

function openSlider(clickObj)
{
	var mySlider = $("#"+clickObj.attr("id").replace("slider_menu", "slider"));
	
	var open_height = mySlider.attr("box_h") + "px";
	mySlider.animate
	(
	 	{"height": open_height}, 
		{
			duration: "slow",
			callback: function() {$("#" + mySlider.attr("id") + " > .articleBottomFade").hide() }
		}
	);
	
	clickObj.html('<a href="#" onclick="return false;">Close</a>');
	$("#" + clickObj.attr("id") + " > a").click(function() { closeSlider($(this).parent()) });

	//$("#" + mySlider.attr("id") + " > .articleBottomFade").hide();
}

function closeSlider(clickObj)
{
	var mySlider = $("#"+clickObj.attr("id").replace("slider_menu", "slider"));
	
	mySlider.animate({"height": sliderHeight}, {duration: "slow" });
	
	clickObj.html('<a href="#" onclick="return false;">Read More</a>');
	$("#" + clickObj.attr("id") + " > a").click(function() { openSlider($(this).parent()) });
	
	$("#" + mySlider.attr("id") + " > .articleBottomFade").show();
}
