var headernews, counter = 1;
$(document).ready(function() {
	headernews = $(".newsItem").length;
	if (headernews > 0) {
		$("#newsItem_" + counter).fadeIn(1000);
		if (headernews > 1) window.setInterval("newsreader()", 5000);
	}
	$(".impression_small_pic").hover(
		function () {
			$(this).css({ opacity: "1.0" });
			pic_id = $(this).attr("id");
			$.get(	"sites/all/themes/standard/ajax.php",
					{ action:	"get_impression_large",
								pic_id: pic_id },
					function(data) {
						$("#impression_large").html("<img src=\"" + data + "\" />");
						$("#impression_large").show();
					}
			);
		}, 
		function () {
			$(this).css({ opacity: "0.5" });
			$("#impression_large").hide();
			$("#impression_large").html("");
		}
	);
});
function newsreader() {
	$("#newsItem_" + counter).fadeOut(1000);
	$("#newsItem_" + counter).css({ display: "none" });
	if ((counter + 1) > headernews) counter = 1;
	else counter++;
	$("#newsItem_" + counter).fadeIn(1000);
}
