$(document).ready(function(){
	var FAQ = {
		init: function()
		{
			$('div.panel').each(function() {
				$(this).hide();
			});

			$('li.question').each(function() {
				$(this).bind('click', function () {
					var question = $(this).html();
					$(this).children('div.faq_answer').each(function() {
						$('#faq_answer').html('<h5>'+question+'</h5>'+$(this).html());
					});
				});
			});

			$('div.faq_answer').each(function () {
				$(this).hide();
			});

			$('h4.toggle').bind('click', function() {
				$(this).parent().children('div.panel').each(function() {

					$('div.panel').each(function() {
						$(this).slideUp('slow');
						$(this).parent().children('h4.toggle').removeClass('expanded');
					});
					if ($(this).is(':hidden'))
					{
						$(this).slideDown('slow');
						$(this).parent().children('h4.toggle').addClass('expanded');
					} else
					{
						$(this).parent().children('h4.toggle').removeClass('expanded');
					}
				});
			});
		}
	};

	FAQ.init();

	$('#default_toggle').trigger('click');
	$('#default_toggle_question').trigger('click');
});
