jQuery(function(){
	jQuery('.landing-cara-img')
		.mouseover(function(){
			var t = jQuery(this);
			var tInd = t.index();
			if(t.hasClass('centre')){
				jQuery('#bumper').hide(0);
				jQuery('.glass-panel', '#footer-blackout .landing-info-box:eq('+tInd+')').animate({opacity: 1}, 400);
			}else{
				jQuery('#bumper').show(0);
				jQuery('.landing-cara-img').removeClass('centre').removeClass('left').removeClass('right');
				t.addClass('centre');
				jQuery('.landing-cara-img:eq('+tInd+')').prevAll().addClass('left',200);
				jQuery('.landing-cara-img:eq('+tInd+')').nextAll().addClass('right',200);
				jQuery('#selector-lights .indicator').removeClass('on');
				jQuery('#selector-lights .indicator:eq('+tInd+')').addClass('on');
			};
		})
		.mouseout(function(){
			jQuery('.glass-panel').animate({opacity: 0}, 0);
		})
		.click(function(){
			var pub = jQuery(this).attr('id').replace("-cara-image","");
			window.location.href = '/index.php/'+ pub +'.html';
		});
	
	jQuery('#selector-lights .indicator')
		.mouseover(function(){
			if(jQuery(this).hasClass('on')){
			}else{
				jQuery(this).animate({ backgroundPosition : '0px -14px' },0);	
			}
		})
		.mouseout(function(){
			if(jQuery(this).hasClass('on')){
			}else{
				jQuery(this).animate({backgroundPosition : '0px 0px'},0);
			}
		})
		.click(function(){
			var indInd = jQuery(this).index();
			jQuery('.landing-cara-img:eq('+ indInd +')').trigger('mouseover');
		});
	
	jQuery('#footer-blackout .landing-info-box')
		.mouseover(function(){
			jQuery('.glass-panel').animate({opacity: 0}, 0);
			jQuery('.glass-panel', this).animate({opacity: 1}, 400);
			var pInd = jQuery(this).index();
			jQuery('.landing-cara-img:eq('+ pInd +')').trigger('mouseover');
		})
		.mouseout(function(){
			jQuery('.glass-panel', this).animate({opacity: 0}, 200);
		})
		.click(function(){
			var pInd = jQuery(this).index();
			jQuery('.landing-cara-img:eq('+ pInd +')').trigger('click');
		});	
});
