	function miniForm() {
		$("#mini-form li").addClass("hide");
		$(".email_us").click(function(event) {
			
			$("#mini-form li").fadeIn("slow");
			if($("#mini-form li .close").length) {

			} else {
				$("#mini-form ul").append('<li><a href="#" class="close">Close</a></li>');
			}
			$(".close").click(function(event) {
				event.preventDefault();
				$("#mini-form li").fadeOut("medium");
				
			});
		});
	}

	function galleryImages() {
		$(function() {
			$('a.gallery').lightBox();
		});
		
	}
	function subscribe() {
		$(".show_signup").click(function() {
			
			$(".sign_up").fadeIn("show");
			$(this).toggleClass("active");
					
		});
	}
	function carousel(){
	
		if ($("#carousel div").length > 0) {
			
			var imagesJSON = eval(imagesJson);
			//console.log(imagesJSON);
			$("#carousel div").crossSlide({
				sleep: 2,
				fade: 1,
				shuffle: true
				}, 
				    imagesJSON
				
			);
		}
	}
/*
	function captchaError() {
		var errorJSON = eval(errorJson);
		console.log(errorJSON);
		if (errorJSON) {
			$('li .errors').append(errorJSON);
		} else {
			
		}
		
	}
*/
//
//     JQuery Text resize + Cookie recall
//     by Jonny Kamaly
//     based on script written by Faisal &amp; Homar
//
	 function textresize(){
		// show text resizing links
		$(".textsize").show();
		var $cookie_name = "sitename-textresize";
		var originalFontSize = $("html").css("font-size");
		// if exists load saved value, otherwise store it
		if($.cookie($cookie_name)) {
			var $getSize = $.cookie($cookie_name);
			$("html").css({fontSize : $getSize + ($getSize.indexOf("px")!=-1 ? "" : "px")}); // IE fix for double "pxpx" error
		} else {
			$.cookie($cookie_name, originalFontSize);
		}
		// reset link
		$(".resetFont").bind("click", function() {
			$("html").css("font-size", originalFontSize);
			$.cookie($cookie_name, originalFontSize);
		});
		// text "+" link
		$(".increaseFont").bind("click", function() {
			var currentFontSize = $("html").css("font-size");
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum*1.2;
			if (newFontSize > 11) {
				$("html").css("font-size", newFontSize);
				$.cookie($cookie_name, newFontSize);
			}
			return false;	
		});
		// text "-" link
		$(".decreaseFont").click(function(){
			var currentFontSize = $('html').css('font-size');
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum*0.8;
			if (newFontSize != 11) {
				$("html").css("font-size", newFontSize);
				$.cookie($cookie_name, newFontSize);
			}
			return false;
		});

	}
	
 
$(document).ready(function() {
	carousel();
	miniForm();
	subscribe();
	textresize();
	galleryImages();
	//captchaError();
	$("#bookingForm").validate();
	
});
