
	$(function() {
		//png fix
		$(document).pngFix(); 
		
		//LOGO
		//hide logo elements
		$(".zulu").hide();
		$(".text").hide();
		$(".small-text").hide();
		$(".zulu").css("margin-top","30px");
		
		//show logo elements
		$(".zulu").fadeIn(1000);
		$(".zulu").animate({marginTop:"0px"}, {queue:false, duration:1000});
		$(".text").fadeIn(3000);
		$(".small-text").fadeIn(4000);
		
		//animate buttons with fromleft class
		$(".fromleft .button-inner").css("opacity","0");
		$(".fromleft .button-inner").css("margin-left","-80px");
		$(".fromleft .button-inner").delay(1000).animate({opacity: 1, marginLeft:"0px" }, 1000);

		//animate buttons with fromright class
		$(".fromright .button-inner").css("opacity","0");
		$(".fromright .button-inner").css("margin-left","110px");
		$(".fromright .button-inner").delay(1000).animate({opacity: 1, marginLeft:"0px" }, 1000);	
		
		//contact form buttons
		$('.contact-form-link').click(function() {
			var showformname = $(this).attr('id');
			$('.contact-form-btn').css('backgroundPosition', '0px 0px');
			$(this).parents('.contact-form-btn').css('backgroundPosition', '0px -112px');
			$('.contact-forms').fadeOut(150);
			$('#' + showformname + '-form').delay(200).fadeIn(150);
		});
		
		//sub nav
		$(".subnav-outer").hide(); 
		
		 $("li.subnav").hover(function() { 
		 	$(this).find(".subnav-outer").show(); 
		 } , function() { 
		 	$(this).find(".subnav-outer").hide(); 
		 });
		
		// banner rotation
		
		if($('#banner>a').length > 1) {
			(function rotateBanners() {
				setTimeout(function() {
					var currentBanner = $('#banner>a:visible');
					var nextBanner = currentBanner.next();
					if(nextBanner.length == 0) {
						nextBanner = $('#banner>a:first');
					}
			
					nextBanner
						.css('zIndex', 10)
						.fadeIn(1000, function() {
							currentBanner.hide();
							$(this).css('zIndex', 0);
							rotateBanners();
						});
				}, 6000);
			})();
		}
		
		//image fade
		
		var count = 0;
		var hidecount = 0;
		
		$('#image',this).children('img').addClass('absolute');
		
		$('#image img').each(function(){
			hidecount++;
			if (hidecount!=1) 
			{
				$(this).addClass('hide');
			}
		});
		
		$('#image img').each(function(){
			count++;
			$(this).attr("id",'image-'+count);
		});
		
		$(document).ready(function() {
				var maxCount= $('#image > *').length;
				var count=2;
				var previous=1;
				window.setInterval(function(){imageRotation();},3500); //animation speed this is set to 3.5 seconds at the moment
				
		function imageRotation() {
				$('#image-'+previous).fadeOut(500); //fade out speed this is set to 0.5 seconds at the moment
				$('#image-'+count).fadeIn(500); //fade in speed this is set to 0.5 seconds at the moment
				previous = count;
				count ++;
				if(count==maxCount+1) {
					count=1;
				}
			};
		
		});

			//Accordian bookings page
	$('.accordian-item').hide();
	
	$('.accordian-title').click(function() {
		
		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
	 	$('.accordian-item').slideUp('normal');

		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
		if($(this).next().is(':hidden') == true) {

			//ADD THE ON CLASS TO THE BUTTON
			$(this).addClass('on');

			//OPEN THE SLIDE
			$(this).next().slideDown('normal');
		 }
	});


	});
	
		function clickclear(thisfield, defaulttext) {
		if (thisfield.value == defaulttext) {
			thisfield.value = "";
		}
	}
	function clickrecall(thisfield, defaulttext) {
		if (thisfield.value == "") {
			thisfield.value = defaulttext;
		}
	}

