(function($) {

/*-----------------------------------------------------------------------------------*/
/* Footer sitemap expander */
/*-----------------------------------------------------------------------------------*/

		$(function() {
	  /*$('<div></div>').attr('id', 'overlay').css('opacity', 0.85).hover(function(){
		  $(this).addClass('active');
		}, function() {
		  $(this).removeClass('active');
		  setTimeout(function(){
			$('#overlay:not(.active)').slideUp(function(){
			  $('a.cart-hover').removeClass('cart-hover');
			});
		  }, 800);
		}).prependTo('#footer');*/
		$('#sitemap ul.menu li.menu-item-home').hide();
	  $('#sitemap').hover(function(){
		  $(this).addClass('active');
		}, function() {
		  $(this).removeClass('active');
		  setTimeout(function(){
			$('#sitemap:not(.active)').slideUp(function(){
			  $('a.cart-hover').removeClass('cart-hover');
			});
		  }, 800);
		});
		
	  $('a.expander').click(function(){
		$(this).addClass('cart-hover');
		$('#sitemap:not(:animated)').addClass('active').slideDown();      
	  });
	});

/*-----------------------------------------------------------------------------------*/
/* Homepage tabbed content */
/*-----------------------------------------------------------------------------------*/

	$(function() {
		//make tab links
		var classes = new Array();
		$('.tab_container .tab_content').each(function(){
			classes = this.className.split(" ");
			$('<li><a href="#' + classes.pop() + '">' + $(this).children('h3').text() + '</a></li>').appendTo('.tabs');
		});
		
		$('.tab_container .tab_content').hide(); //Hide all content
		$('ul.tabs li:first').addClass('active').show(); //Activate first tab
		$('.tab_content:first').show(); //Show first tab content
	
		//On Click Event
		$('ul.tabs li').click(function() {
	
			$('ul.tabs li').removeClass('active'); //Remove any "active" class
			$(this).addClass('active'); //Add "active" class to selected tab
			$('.tab_content').hide(); //Hide all tab content
	
			var activeTab = $(this).find('a').attr('href'); //Find the href attribute value to identify the active tab + content
			activeTab = activeTab.replace('#', '.');
			$(activeTab).fadeIn(); //Fade in the active ID content
			return false;
		});
	});
	
/*-----------------------------------------------------------------------------------*/
/* Biog expander */
/*-----------------------------------------------------------------------------------*/
	$(function() {
		  //hide the all of the element with class bcd_expander_body
		  $('.bcd_expander_body').hide();
		  //toggle the component with class bcd_expander_head
		  $('.bcd_expander_head').click(function()
		  {
			$(this).next('.bcd_expander_body').slideToggle(600);
		  });
	});

})(jQuery);

