function initMenu() {

	$('ul.main_nav ul').hide();
	//$('.main_nav ul:first').show();

	$('ul.main_nav li a').click(function(){
		if( $(this.parentNode).is('li.menu-item-home') && !$(this.parentNode).hasClass('current-menu-item') )
			return true;
		
		var checkElement = $(this).next();
		if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
			return false;
		}

		if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
			$('.main_nav ul:visible').slideUp('normal');
			checkElement.slideDown('normal');
			return false;
		}
	});
}


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

	//$('ul.main_nav li ul').hide();
	// toggles the slickbox on clicking the noted link  
	
	/*$('ul.main_nav li').click(function() {
		
		$('ul.main_nav li ul').toggle(400);
		return false;
	
	});*/
	  
	  
	if( $('#sfstest-sidebar').length >0 ){
		$("#sfstest-sidebar").carouFredSel({
			items 		: 1,
			direction	: "up",
			auto : {
				pauseDuration: 10000 //=== '10 Sec'
			}
		});
	}
	
	if( $('.montagel_nav').length >0 ){
		$(".montagel_nav").carouFredSel({
			items 		: 1,
			direction	: "up",
			 width       : 240,     // automatically calculated
			 auto : {
				fx          : "fade",
				pauseDuration: 10000, //=== '10 Sec'
				
			}
		});
	}

});




