$(function() {

	$('#footer img')
		.fadeTo(0, 0.5)
		.hover(function(){
			$(this).fadeTo(300, 1);
		}, function() {
			$(this).fadeTo(300, 0.5);			
	});
		
/* ----- TABS ----- */

	$('.tabs a').click(function(event){
		event.preventDefault();
	});
	
	// when a link is clicked  
	$(".tabs li").click(function(event) {
	 
		// switch all tabs off
		$(".tabs .act").removeClass("act");
		  
		// switch this tab on
		$(this).addClass("act");
		
		// get clicked tab number
		var tab_number = $(".tabs li").index(this);
		   
		// slide all elements with the class 'content' up
		$(".tab-content").hide();
		
		// open tab by number
		$(".tab-content:eq(" + tab_number + ")").show();
	
	});
	
/* ----- END TABS ----- */

	$(".carousel").jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		visible: 1,
		speed: 0
	});

	$(".tab-content").hide();

	$(".tab-content:last").show();

	
});


var openedSubmenuId = 0;
var forOpenSubmenuId = 0;
function showSubmenu(id) {
	forOpenSubmenuId = id;
	if (openedSubmenuId && openedSubmenuId != id) {
		$('#submenu-'+openedSubmenuId).slideUp('normal', function() {
			openedSubmenuId = 0;
			showSubmenu(forOpenSubmenuId);
		});
	}
	else {
		var el = $('#submenu-'+id);
		if (el.css('display') == 'block') {
			el.slideUp('normal');
			openedSubmenuId = 0;
		}
		else {
			el.slideDown('normal');
			openedSubmenuId = id;
		}
	}
	return false;
}
