$(document).ready(function() {
	var src;
	$("#BookingPostcode").blur( function () {
		var pc = $('#BookingPostcode').val();
		setDirections(pc);
	});
	$('img.home').hover(function() {
		$(this).attr("src","/img/menu-home-on.png");
	}, function() {
		$(this).attr("src","/img/menu-home-off.png");
	});
	$('img.news').hover(function() {
		$(this).attr("src","/img/menu-news-on.png");
	}, function() {
		$(this).attr("src","/img/menu-news-off.png");
	});
	$('img.gallery').hover(function() {
		$(this).attr("src","/img/menu-gallery-on.png");
	}, function() {
		$(this).attr("src","/img/menu-gallery-off.png");
	});
	$('img.contact').hover(function() {
		$(this).attr("src","/img/menu-contact-on.png");
	}, function() {
		$(this).attr("src","/img/menu-contact-off.png");
	});
	
	var $ss = $('.slideshow');
	for (var i = 2; i < 9; i++) 
    $ss.append('<img src="/img/rotate/'+i+'.jpg" width="430" height="240" />');
	$('.slideshow').cycle({
		random:	1
	});
	$('.events-list-link').hover(function(){
	   $(this).addClass('events-list-hover');
	}, function() {
	   $(this).removeClass('events-list-hover');
	});

	$('a.booking-link img').mouseover(function() {
		src = $(this).attr("src");
		$(this).attr("src", '/img/book-on.png');
	}).mouseout(function() {
		$(this).attr("src", src);
	});
	if (typeof countDown != 'undefined') {
		$("#countdown").countdown({
			layout: '<strong>{dn}</strong> {dl} <strong>{hn}</strong> {hl} <strong>{mn}</strong> {ml} <strong>{sn}</strong> {sl} till the next event!',
			until: countDown
		});
	}
	$('.link').hover(function(){
		var link = $(this).attr("id");
		$('#link-image').attr('src', '/img/'+link+'.jpg');
	}, function() {
		$('#link-image').attr('src', '/img/links.jpg');
	});
});