$(document).ready(function() {
	$("div.panel_button").click(function(){
		$("div#panel").animate({
			height: "6100px"
		})
		.animate({
			height: "6000px"
		}, "fast");
		$("div.panel_button").toggle();
	
	});	
	
   $("div#hide_button").click(function(){
		$("div#panel").animate({
			height: "0px"
		}, "fast");
   });	
	
	// No idea how the above is supposed to work. Instead:
	$('p.slide a.btn-slide').click(function() {
		$("div#panel").show();
		return false;
	});

	// Hide/show credit card details on Downloads page
	$('#download_payment_method').change(function() {
		check_download_payment_method();
	});

});

function check_download_payment_method() {
	var payment_method  = $('#download_payment_method').val();		
	if (payment_method == 'creditcard') {
		$('#card_details').show();
		$('#paypal_details').hide();
	}
	else if (payment_method == 'paypal') {
		$('#card_details').hide();	
		$('#paypal_details').show();
	}
}

$(function() {
	$('ul.directory li a.heading').click(function() {
		$(this).parent('li').children('ul').toggle();
		return false;
	});
});
