(function ($) {
  Drupal.behaviors.customOmegaSubthemeJS = {
    attach: function(context, settings) {
	var cur_stus;
	
	//close all on default
	$('.view-faq-panel p').hide();
	$('.view-faq-panel h4').attr('class', '');
	       
	//open default data
	$('.view-faq-panel p:eq(0)').slideDown(650);
	$('.view-faq-panel h4:eq(0)').attr('class', 'active');

	$('.view-faq-panel h4').click(function(){
		cur_stus = $(this).attr('class');
		if(cur_stus != "active")
		{
			//reset everthing - content and attribute
			$('.view-faq-panel p').slideUp(650);
			$('.view-faq-panel h4').attr('class', '');
			
			//then open the clicked data
			$(this).next().slideDown(650);
			$(this).attr('class', 'active');
		}
		//Remove else part if do not want to close the current opened data
		else
		{
			$(this).next().slideUp(650);
			$(this).attr('class', '');
		}
		return false;
	});
/*

	$('.view-faq-panel').accordion({headerSelector: 'h4',
				panelSelector: 'p',
				activeClass: 'myAccordionActive',
				hoverClass: 'myAccordionHover',
				panelHeight: 650,
				speed: 300});

*/	


    }
  };
})(jQuery);
;

