$(document).ready(function(){
	//Setup jFlow
	$("#controller").jFlow({
		slides: "#slides",
		controller: ".jFlowControl", // must be class, use . sign
		slideWrapper : "#jFlowSlide", // must be id, use # sign
		selectedWrapper: "jFlowSelected",  // just pure text, no sign
		auto: false,		//auto change slide, default true
		width: "590px",
		height: "400px",
		duration: 500,
		prev: ".jFlowPrev", // must be class, use . sign
		next: ".jFlowNext" // must be class, use . sign
	});
	if($.browser.msie) {
		//Setup jqFancyTransitions if IE
		$('#showcaseHolder').jqFancyTransitions({
			width: 868,
			height: 320,
			position: 'top',
			direction: 'random',
			strips: 20,
			navigation : true,
			titleSpeed: 2000,
			titleOpacity: 0
		});

	}else {
		//Setup jqFancyTransitions
		$('#showcaseHolder').jqFancyTransitions({
			width: 868,
			height: 320,
			position: 'top',
			direction: 'random',
			strips: 30,
			navigation : true,
			titleOpacity: 0
		});
	}

	//add hover event to Nav
	$('#nav li').hover(
	        function () {
	            //show its submenu
	            $('ul', this).stop(true, true).delay(350).slideDown(200);

	        },
	        function () {
	            //hide its submenu
	            $('ul', this).stop(true, true).slideUp(200);
	        }
	);
	//Add active class
	$("#nav ul").each(function(i){
	      $(this).hover(function(){
	        $(this).parent().find("a").slice(0,1).addClass("active");
	      },function(){
	        $(this).parent().find("a").slice(0,1).removeClass("active");
	      });
	});
	//add fancybox to .fancy
	if ($('a.fancy').length) {
		$("a.fancy").fancybox({
			'hideOnContentClick': true
		});
	}
	//hide .more
	$('.more').hide();
	//show .more on click
	$('a.showMore').click(function(){
		var num = $(this).attr('rel');
		var target = "#more" + num;
		$(target).slideToggle("slow");
	});
	/*//contact form
	var responseText = "<h3>Email Sent</h3><p>Thank you, your email was sent. we will get back to you</p>"
	$('#contact').ajaxForm({
		beforeSubmit: validate,
		resetForm: true,
		success: function(){
            $.fancybox({
                'content' : responseText
            });
        }
 	});
	function validate() {
		var areAllValid = LiveValidation.massValidate( [ fname, lname, email, address, city, state, zip, comments, answer ] );
		return areAllValid;
	}*/
	//Disable button if none selected | Hotels Form
	$('#submit').attr('disabled','disabled');
	$("#hotelsSelect").change(function() {
			$('#submit').attr('disabled','disabled');
            if ($(this).val() && $(this).val() != "no") {
                $('#submit').attr('disabled','');
            }
        });

	//accordion
	/*$('.accord h2').each(function(){
		$(this).css('cursor','pointer')
		$(this).click(function() {
				$(this).next().toggle('slow');
				return false;
			}).next().hide();
	})*/
	$('.accord').accordion({
		header: 'h2',
		autoHeight: false,
		collapsible: true,
		active: false
		});

	//add class odd to recent blog post on homepage
	$('.recentDate:even').addClass('even');
	$('.recentPost:even').addClass('even');


});
