$(document).ready(function(){
	
	$(".collapsiblePanel").hide();

// MK 19-Aug-2011 - Set arrow/chevrons based on whether the following panel is display none or block. 
// This is the same as before, only caters for Mortgage Finder Collapsible Panels too - covering instances 
// when user opens the panel then leaves to switch to a different tab.
	$(".collapsiblePanelShowHide").click(function(){ 
	  panelDisplayState = $(this).next(".collapsiblePanel").css('display');
	  if (panelDisplayState == 'none') $(this).addClass("active");
	  else $(this).removeClass("active");
	  return false;
	});
	
/* // Old chevron switching
$(".collapsiblePanelShowHide").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
	});	 */
	
	$(".collapsiblePanelShowHide").click(function(){	
		$(this).next(".collapsiblePanel").slideToggle("slow");
	});
	
	

});


$(function(){			   
	$("#showAllTerms").click(function() {
		$(".collapsiblePanelShowHide").addClass('active');	
		$(".collapsiblePanel").show();
		$(".collapsiblePanelShowHide").unbind("click");		
	});
});
