
//SWITCH CAROUSSEL CONTENT
function switchCarouselContent(d) {
	$$('div.carouselContent').each(function(x){
	Element.hide(x);});
	Element.show(d);
}

function loadGallery(pictureName, imageFile) {
	$(pictureName).src = imageFile;
	//$(description).innerHTML = caption;
	$('lightboxPic').href = imageFile;
}

/*
**************************
****** INDEX PAGE  *******
**************************
*/

Event.observe(window, 'load', function() {
	$$('div#switchDay ul li').each(function(x){
	
	Event.observe(x, 'mouseover', function(){
	Element.addClassName(x, 'hover');
	});
	
	Event.observe(x, 'mouseout', function(){
	Element.removeClassName(x, 'hover');
	});
	
	// ONCLICK  - Add and Remove class on click on the CAROUSSEL NAVIGATION
	Event.observe(x, 'click', function(){
	$$('div#switchDay ul li.on').each(function(x){
	Element.removeClassName(x, 'on');
	});
	Element.addClassName(x, 'on');
	});
	
	});//end each li div#switchDay ul li
	

	//WINDOW.OPEN on RIGHT BOXES - using javascript to redirect the right boxes divs
	Event.observe($('aboutlloydsBox'), 'click', function(){
	window.open('about_lloyds.html', '_self');	
	});
	
	Event.observe($('abouttrevorBox'), 'click', function(){
	window.open('about_trevor.html', '_self');	
	});
	
	Event.observe($('timewithTrevorBox'), 'click', function(){
	window.open('timewith_trevor.html', '_self');	
	});
	
	Event.observe($('kidscornerBox'), 'click', function(){
	window.open('kidscorner.html', '_self');	
	});
	
/*
****************************
****** ARTICLES PAGE ******
****************************
*/
	$$('div.latestEntries ul li').each(function(x){
	Event.observe(x, 'mouseover', function(){
	Element.addClassName(x, 'hover');
	});
	
	Event.observe(x, 'mouseout', function(){
	Element.removeClassName(x, 'hover');
	});
	
	// MOUSEOVER - Add and Remove class on click on the ARTICLES NAVIGATION 
	Event.observe(x, 'click', function(){
	$$('div.latestEntries ul li').each(function(d){
	Element.removeClassName(d, 'on');
	}); 
	Element.addClassName(x, 'on');
	});
	
	});//end each li div.latestEntries ul li
	
	
});//end general Event.observe



