$(document).ready(function(){
	function elemmkbig(element) {
		//if(element.height() == '170') return false;
		element.css('height','170px');
		element.find('.imagecache-Thumbimage').css('height','170px');
	}
	function elemmksmall(element) {
		element.css('height','80px');
		element.find('.imagecache-Thumbimage').css('height','80px');
	}
	$('#sidebar-right .block .view-upcoming-kinofilme .views-row-odd, #sidebar-right .block .view-upcoming-kinofilme .views-row-even, #sidebar-right .block .view-aktuelle-kinofilme .views-row-odd, #sidebar-right .block .view-aktuelle-kinofilme .views-row-even').each(function() {
		var img_src = $(this).find('img:first').attr('src');
		 //$(this).prepend('<span class="filmimage" style="float:left;background-image:url( \''+img_src+'\');background-position:bottom;width:120px;height:60px;">&nbsp;</span>');
		 $(this).find('img').hide();
		 $(this).find('img').parent().attr('style','background-image:url( \''+img_src+'\');background-position:bottom;width:120px;height:80px;display:block;float:left;');
		 if($(this).hasClass('views-row-1')) elemmkbig($(this));
		 $(this).hover(
			function() {
				$(this).addClass('view-row-hover');
				if($(this).height() > 90) return false;
				elemmksmall($('#sidebar-right .block .view-upcoming-kinofilme .views-row-odd, #sidebar-right .block .view-upcoming-kinofilme .views-row-even, #sidebar-right .block .view-aktuelle-kinofilme .views-row-odd, #sidebar-right .block .view-aktuelle-kinofilme .views-row-even'));
				elemmkbig($(this));
			},
			function() {
			 //elemmksmall($(this));
			 $(this).removeClass('view-row-hover');
			}
		 );
	});
	//$('#meerkat').html($('#meerkat2'));
	//meerkat();// werbung-einblendung
	$('span.empty').after('<div class="emptynotice" style="display:none;position:absolute;border:1px solid #C7090B;background-color:#000;padding:10px;z-index:100;width:300px;"><strong>Hier fehlen uns noch Daten! </strong>Wenn du weist was hier stehen sollte dann verfasse bitte einen Kommentar oder schreibe an mail@kinos3d.de<br />Danke.</div>');
	$('span.empty').hover(function() {
		$(this).next().fadeIn();
	}, function() {
		$('div.emptynotice').fadeOut();
	});
	
	$('div.forum-post .fivestar-widget-static .star-1').each(function() {
		if($(this).find('span').hasClass('off')) $(this).parent().hide();
	});
	
	var bg_url = $('#block-views-aktuelle_kinofilme-block_1 img:first').attr('src');
	$('#block-views-aktuelle_kinofilme-block_1 img:first').remove();
	$('#contentheader').css('background-image','url('+bg_url+')');

	
});
