function initMenu() {
		$(".sidebar nav li a").click( // When a top menu item is clicked...
			function () {
				$(this).parent().siblings().find("ul").slideUp("slow"); // Slide up all sub menus except the one clicked
							
				$(this).parent().find("ul").slideToggle("normal"); // Slide down the clicked sub menu
				
				$(".sidebar nav li a").removeClass('active');
				$(this).removeClass('active');
				
				if ($(this).parent().find("ul").is(':visible')) {
					$(this).addClass('active');
				};
				
				return false;
			});
		
		$(".sidebar nav li a.no-children").click( // When a menu item with no sub menu is clicked...
			function () {
				window.location.href=(this.href); // Just open the link instead of a sub menu
				return false;
			}
		);  
	};
	
function initTabs(){
  $('.tabs div.tab').hide(); // Hide all divs

  $('.tabs ul.tab-navi li a').click(function(){ // When link is clicked
    $('.tabs ul.tab-navi li').removeClass('active'); // Remove active class from links
    $(this).parent().addClass('active'); //Set parent of clicked link class to active
    var currentTab = $(this).attr('href'); // Set currentTab to value of href attribute
    $('.tabs div.tab').hide(); // Hide all divs
    $(currentTab).show(); // Show div with id equal to variable currentTab
    return false;
  });
};



$(function() {
  initMenu();
  initTabs();

  			
});

function mycarousel_initCallback(carousel) {
	
	// Pause autoscrolling if the user moves with the cursor over the clip.
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};
	


