jQuery.expr[':'].darkbg = function(elem) {
	 return jQuery(elem).css('background-color') === 'rgb(48, 59, 72)' || jQuery(elem).css('background-color') === '#303b48';
};


jQuery(window).load(function() {
	jQuery('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});

/**
 * Let's create nice menu hover fade effects
 */

/*jQuery(function($){
	$('.nevi_box .menu li')
		.mouseenter(function(){
			clearTimeout(this.timer);
			var submenu = $(this).children('ul.sub-menu');
			if (submenu.is(':hidden')) {
				submenu.fadeIn(200);
			}
		})
		.mouseleave(function(){
			var submenu = $(this).children('ul.sub-menu');
			if (submenu.is(':visible')) {
				this.timer = setTimeout(function(item){
					$(item).children('ul.sub-menu').fadeOut(100);
				},500,this);
			}
		});
});*/

});

jQuery(function($){
	if ($(".fcube-container").length > 0){
		$('.fcube-container').find('.twitter').addClass('fcube-content-container');
		$('.fcube-container').find('.adv').addClass('fcube-content-container');

		// stop animate
		/*$('div.fcube-block').hover(function(){
			$(this).children('div.fcube-content-container').stop();
		}, function(){
			$(this).children('div.fcube-content-container').stop();
		});*/
		$('.fcube-container .fcube-block').each(function() {
			var contentContainer = $(this).find('.fcube-content-container');
			var content = $(this).find('.fcube-content');
			
			if ($(this).attr('style').indexOf('image') == -1){
				$(this).addClass('max');
				$(this).find('.fcube-block-title').prependTo(content);
			}

			$('.fcube-container .fcube-block:darkbg').addClass('dark');
			$(this).find('.meta-nav').parent('a').remove();
		});

		$('.fcube-container .adv').each(function() {
			var src = $(this).find('img').attr('src');
			
			$(this).find('a').css({background:'url("'+src+'") no-repeat 50% 50%'});
			$(this).find('img').css('display','none');
			
		});
		//$('.fcube-container .adv').parent().addClass('adv-max');
		//$(".fcube-container .adv:odd").parent().addClass('adv-max-2');



		$('.fcube-block').find('a').hover(function(){
			$(this).parent().addClass('hover');;
		}, function(){
			$(this).parent().removeClass('hover');
		});
	};
});
