/*
	DevSaver Web Framework
	Copyright (c) 2013-2018 DevSaver. 
	All rights reserved.
		web:  www.devsaver.com
		mail: support@devsaver.com				
*/

var STBGlobalAccordion = Object.create(STBModule.prototype);

STBGlobalAccordion.name = "GlobalAccordion";

STBGlobalAccordion.initAccordion = function () {

	var elements = $('.accordion:not(.__done)');

	if (elements.length) {

		elements.each(function() {
			$(this).find(".panel").first().find("a.collapsed").trigger("click");
		});

		elements.addClass("__done");
	}

}


STBGlobalAccordion.runOnReady = function() {
	STBGlobalAccordion.initAccordion();
}

STBGlobalAccordion.runOnContentUpdate = function() {
	STBGlobalAccordion.initAccordion();
}


site.registerModule(STBGlobalAccordion);
