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

$(document).ready(function(){
	// Show the slider content
	$('#transcription').show();

	$('#transcription').each(function () {
		var current = $(this);
		current.attr("box_h", current.height());
	});

	$("#transcription").css("height", sliderHeight);
});

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

function sliderAction()
{
    if (slider_state == "close")
	{
		sliderOpen();
		slider_state = "open";
		$("#transcriptionBtn").html('<a href="#" onclick="return sliderAction();">Close Transcript </a>');
	}
	else if (slider_state == "open")
	{
		sliderClose();
		slider_state = "close";
		$("#transcriptionBtn").html('<a href="#" onclick="return sliderAction();">View Transcript</a>');
	}

	return false;
}

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

function sliderClose()
{
	$("#transcription").animate({"height": sliderHeight}, {duration: "slow" });
}
