$(document).ready(function() {
	$(".menu ul li").hover(function() {
		$(this).find('> ul.sub').stop(true, true).slideDown('fast');
	}, function() {
		$(this).find('> ul.sub').stop(true, true).slideUp('fast');
	});

	$("#events .slider").each(function() {

		var width = 0;
		var img = 0;
		$("#events .slider a").each(function() {
			width += $(this).outerWidth(true);
			if (img < $(this).find("img").outerWidth(true)) {
				img = $(this).find("img").outerWidth(true);
			}
		});

		width += img + 50;

		$("#events .slider").css('width', width + "px");

		$("#events").mCustomScrollbar('horizontal', 200, 'easeOutCirc', 1.00, 'auto', 'yes', 'no', 1);
	});

	$("#events .slider a").hover(function() {
		var img = $(this).find("img");
		var width = $(img).width();
		var height = $(img).height();

		$(img).css({
			'display': 'block',
			'width': '1px',
			'height': height + "px"
		});

		$(img).animate({
			'width': width + "px"
		}, 200);
	},
	function() {
		var img = $(this).find("img");
		$(img).css({
			'display': 'none'
		});
	});

	$("a.fancybox").fancybox({
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic'
	});

	

	$(".hint").tipsy({
		'gravity': 's',
		'delayIn': 500,
		'delayOut': 250,
		'fade': true
	});

});

