jQuery.noConflict();

jQuery(document).ready(function($){

	$('.accordion').click(function(e){
		e.preventDefault();
		var clickedElement = $(this).html();
		$(this).next().toggle(400);
		$('.accordion').each(function(){
			if($(this).html() != clickedElement) $(this).next().hide(400);
		});
		return false;
	}).next().hide();

	$('.main-item').each(function(){
		if (section == $(this).attr('id'))
		{
			$(this).addClass('active');
			if(getSubContent($(this).attr('class'))) $(this).next().show();
		}
	});

	$('.sub-item').each(function(){
		if (typeof subSection != 'undefined' && subSection == $(this).attr('id'))
		{
			$(this).addClass('active');
		}
	});

});

function getSubContent(targetClass)
{
	targetClass = targetClass.split(' ');
	return targetClass[0] == 'accordion';
}
