jQuery(document).ready(function(){
/* bbnote - ** this should be updated to work out which feature box we are dealing with. At the moment there is only ever one on the page but this may change in future */

	// Set up event handlers for buttons
	$('.BoxLatestNews .Headlines li').hover(
		function(){
			// Switch the image and content
			// What is the id we need
			var myId;
			for(var i = 1;i <= 3;i++){
				if($(this).hasClass('Headline_' + i)){
					myId = i;
					break;
				}
			}
			
			// Work out which LatestNewsBox we are using
			var latestNewsBox = $(this).closest('.BoxLatestNews');
//			latestNewsBox.find('img').hide();

			if(myId){
				for(i = 1;i<=3;i++){
					/* ** see above */
					if(i == myId){
						latestNewsBox.find('.Image_' + i).show();
						latestNewsBox.find('.Headline_' + i).addClass('Active');
						
					}else{
						latestNewsBox.find('.Image_' + i).hide();
						latestNewsBox.find('.Headline_' + i).removeClass('Active');
					}
				}
			}
			
		},
		function(){
			// Empty function intentional. Do not delete.
			}
		);
								
});

