
//fade-ins
$(document).ready(function() {	
	
	//fade in headings
	//$('#content h1').hide().fadeIn(900);
	$('#content h1').hide().fadeIn(1900);
	//food-page images
	//$('body.food-page .content-inner').hide().fadeIn(900);

});


//gallery image/image swaps
$(document).ready(function() {
	$(".hoverswap").hover(
		function () {
			$(this).attr("src", $(this).attr("src").replace(/.jpg/, "-over.gif"));
		},
		function () {
			$(this).attr("src", $(this).attr("src").replace(/-over.gif/, ".jpg"));
		}
	);
});


//gallery image/text swaps
$(document).ready(function() {
	$('a.hoverswaptext .htext').hide(); /* could be done in css */
	$("a.hoverswaptext").hover(
	   function() {
		  $(this).children(".himg").hide();
		  $(this).children(".htext").show();
	   },
	   function() {
		  $(this).children(".himg").show();
		  $(this).children(".htext").hide();
	   }
	);
});


//with custom prev/next selectors
$(document).ready(function(){
		var slider = $('#slider1').bxSlider({
			controls: false
		});

		//test for how many li's - if less than 2 (4 for some reason?!) hide the nav
		//if no ul at all then 0 sill result - hence > 0
		var count = $("ul#slider1 li").length;
			//alert(count);
		if (count < 4 && count > 0) {
			$('div.slide-controls').hide();
		}
			
		$('#go-prev').click(function() {
			slider.goToPreviousSlide();
			return false;
		});
			
		$('#go-next').click(function() {
			slider.goToNextSlide();
			return false;
		});
						
});



// venue image swaps
$(document).ready(function() {
	//$('ul.venue-list div.venue-details').hide(); /* could be done in css */
	$('ul.venue-list div.venue-details').css("display","none"); /* could be done in css */
	//$('ul.venue-list div.venue-details img').hide(); /* could be done in css */
	//$('ul.venue-list div.venue-details span').hide(); /* could be done in css */
	$("ul.venue-list a.details-link").hover(
	   function() {
			//basic fade in
			//$(this).next(".venue-details").hide().fadeIn("700");
			//div and img on, span fade in (only works if div fade out as img not specified to come back)
			//$(this).next(".venue-details").css("display","block").children("span").stop().hide().fadeIn("9000");
			
			//div and img on, span fade in
			$(this).next(".venue-details").css("display","block");
			$(this).next(".venue-details").children("img").show();
			$(this).next(".venue-details").children("span").hide().fadeIn("3900"); // duration not working?

	   },
	   function() {
		  //$(this).next(".venue-details").children("img").fadeOut("900");
		  //$(this).next(".venue-details").children("span").fadeOut("100"); // duration not working?
		  $(this).next(".venue-details").fadeOut("900");
	   }
	);
});


/* contact (old asp form) *//*

var errortest;
var errortext;

function checkform() {//sammi thompson nov 2001

var errortest = false;
var errortext = 'Please enter the following details:\n\n';


	if (document.apform.Firstname.value == "") {
	errortext += '- First name\n';
	errortest = true;
	}

	if (document.apform.Surname.value == ""){
	errortext += '- Surname\n';
	errortest = true;
	}

	if (document.apform.Telephone.value == ""){
	errortext += '- Telephone number\n';
	errortest = true;
	}

	if (document.apform.numberofguests.value == ""){
	errortext += '- Number of guests\n';
	errortest = true;
	}

	if (document.apform.month.value == "none"){
	errortext += '- Month of event\n';
	errortest = true;
	}

	if (document.apform.day.value == "none"){
	errortext += '- Day of event\n';
	errortest = true;
	}

	if (document.apform.year.value == "none"){
	errortext += '- Year of event\n';
	errortest = true;
	}

	if (document.apform.menu_please.checked){
	errortext += '\n\nTo receive a menu pack, please include your full postal address\n\n';

	if (document.apform.address.value == "") {
		errortext += '- House number or name, and street\n';
		errortest = true;
		}

		if (document.apform.town.value == ""){
		errortext += '- Town or city\n';
		errortest = true;
		}

		if (document.apform.postcode.value == ""){
			errortext += '- Postcode\n';
			errortest = true;
		}

	}

	if (errortest == true) {
		alert(errortext += '\n\n')
	}else{ document.apform.submit();}

}
*/
