$(document).ready(function(){
	
	var current_banner = 1,
	banner_count = $('#banner_list li').size();
	var interval;
	
	
	function intfunc() {
		$('#banner_bullets li:eq('+current_banner+')').click();
	}
	
	$('#banner_bullets li').click(function() {
		clearTimeout(interval);
		
		$('#banner_bullets li').removeClass('current');
		$(this).addClass('current');
		
		bannerIndex = parseInt($(this).attr('rel').replace(/[^0-9]/g,'')) - 1;
		targetMargin = -1 * (bannerIndex * 960);
		
		
		$('#banner_list').animate({
			'marginLeft': targetMargin
		},500);
		
		interval = setTimeout(intfunc,5000)
		current_banner = (current_banner+1) % banner_count;
	});	
	
	interval = setTimeout(intfunc,5000)
	
	// Remove focus outline on all links when clicked
	$("a").focus(function(){
	  $(this).blur();
	});
	
	$("#cookiehinter").animate({ 
		bottom: 0 
	},450);

	$(".hidemsg").click(function(){
		$("#cookiehinter").animate({ 
			bottom: -55 
		},450)
	});
	
});