var menu_animation_state = 0;
var menu_animation_elements = ["#navigation a[href*=chukka-line]", "#navigation a[href*=category/news]"];

var menu_animation_states = { 
	"#navigation a[href*=chukka-line]" : ["BOOK NOW!", "Chukka line"],
	"#navigation a[href*=category/news]" : ["LATEST NEWS", "News desk"]
};

function animate_menu() {
	setTimeout("change_menu_animation_state()", 4000);
}

function change_menu_animation_state() {
	for(var i = 0; i < menu_animation_elements.length; i++) {
		var menu_animation_element = menu_animation_elements[i];
		$(menu_animation_element).text(menu_animation_states[menu_animation_element][menu_animation_state]);
	}
	menu_animation_state = (menu_animation_state == 0 ? 1 : 0);
	animate_menu();		
}

$.fn.lightbox.defaults.fileLoadingImage = "/wp-content/themes/tidworth/lightbox/images/loading.gif";
$.fn.lightbox.defaults.fileBottomNavCloseImage = "/wp-content/themes/tidworth/lightbox/images/closelabel.gif";
$.fn.lightbox.defaults.strings.help = 'left arrow / P - previous image&nbsp;&nbsp;&nbsp;right arrow / N - next image&nbsp;&nbsp;&nbsp;ESC / X - close';

$(function() {
	
	$(document).ready(function(){
		var lb_images = $("a").filter(function() {
			return this.rel.toLowerCase().match('lightbox');
		});
		lb_images.lightbox();
		
		$("#content a img").filter(function() {
			return this.parentNode.rel.toLowerCase().match('lightbox');
		}).ToolTip('Click image to see a larger version');
  });

  
	
 	if($("#latest_news_articles").length != 0) {
		var options = {
		  	newsList: "#latest_news_articles",
				placeHolder1: '-',
				placeHolder2: '_',
				controls: false,
			startDelay: 10
		}
		$().newsTicker(options);
	}
		
});

