$(function() {
	$("a.newWin").attr("target", "_blank");
	
	var pb = $("#photoBar");
	var header = $("h2", pb);
	var text = $("p", pb);
	var imgs = $("#photoBar ul");
	var headers = ["Featured on", "Some text"];
	var texts = ["Giada's 'A' list of Bermuda's Best Goodies", "Some more text"];
	var imageIndex = 0;
	var textIndex = 1;
	function rotateImage() {
		imgs.animate({top: "-=237px"}, 500, function() {
			$($("li", this).get(imageIndex)).clone().appendTo(this);
			imageIndex++;
			header.text(headers[textIndex]);
			text.text(texts[textIndex]);
			textIndex++;
			if (textIndex >= headers.length) {
				textIndex = 0;
			}
		});
	}
	setInterval(rotateImage, 5000);
	
	// To avoid cluttering the mark-up, inject some additional styling elements here for the double border around the content
	var content = $("#content");
	content.wrapInner("<div id='innerContent'></div>");
	content.css("border", "solid 1px #7b605e");
	content.css("padding", "2px");
});

