$(document).ready(function() {
	carousel.init();
});
var carousel = {
	init : function() {
		var carouselBox = $("#carousel-box div.c-latest-news-carousel-show"), showBox = carouselBox
				.find("img"), timestamp = carouselBox.find("span#timestamp"), description = carouselBox
				.find("span.promonarrative"), title = carouselBox
				.find("span.description"), link = carouselBox.find("a");
		readOrWatchLinkText = carouselBox
				.find("span.c-bullet-link-black-background a");
		delete carouselBox;
		var carouselItems = $("#carousel-box ul.c-latest-news-carousel-list li");
		carouselItems.mouseover(function() {
			try {
				var metadata = eval("(" + $(this).find("span.hide").html()
						+ ")");
				showBox.attr( {
					src : metadata.largeImagePath,
					alt : metadata.title
				});
				timestamp.html(metadata.timestamp);
				title.html(metadata.title);
				description.html(metadata.description);
				link.attr( {
					href : metadata.href,
					title : metadata.title
				});
				readOrWatchLinkText.html(metadata.readOrWatchLinkText);
				$(this).parent().find("img").css("visibility", "visible");
				$(this).find("img").css("visibility", "hidden");
				$(this).css("background-color", "black");
				if ($.browser.msie && (parseInt($.browser.version, 10) == 7)) {
					timestamp.css("margin-top", "-8px");
				}
			} catch (e) {
			}
		});
		$("#carousel-box ul.c-latest-news-carousel-list li").click(function() {
			window.location.href = $(this).find("a").attr("href");
		}).filter(":first").mouseover();
	}
};
