$(document).ready(function() {

	 $('.slideshow').cycle({
		fx: 'fade',
		speed: 2000
	});
		
		$('.content a').hover(function() {
			$(this).stop().animate({ color: '#EF4731' }, 300);
		}, function() {
			$(this).stop().animate({ color: '#393333' }, 300);
		});
		$('.subpages ul li a').hover(function() {
			$(this).stop().animate({ textIndent: '5px', backgroundPosition: '210px 15px', color: '#EF4731' }, 300);
		}, function() {
			$(this).stop().animate({ textIndent: '0', backgroundPosition: '200px 15px', color: '#393333' }, 300);
		});
		$('.sidebar a.fancy').hover(function() {
			$(this).stop().animate({ textIndent: '5px', backgroundPosition: '190px 14px', color: '#EF4731'}, 300);
		}, function() {
			$(this).stop().animate({ textIndent: '0', backgroundPosition: '180px 14px', color: '#393333'}, 300);
		});
		$('.fancy li a').hover(function() {
			$(this).stop().animate({ textIndent: '5px', color: '#EF4731'}, 300);
		}, function() {
			$(this).stop().animate({ textIndent: '0px', color: '#393333'}, 300);
		});
		$('.sidebar .fancy li').hover(function() {
			$(this).stop().animate({ backgroundPosition: '190px 14px' }, 300);
		}, function() {
			$(this).stop().animate({ backgroundPosition: '180px 14px' }, 300);
		});
		$('.page .button').hover(function() {
			$(this).stop().animate({ textIndent: '5px' }, 300);
		}, function() {
			$(this).stop().animate({ textIndent: '0px' }, 300);
		});
		$('.page .fancy .download a').hover(function() {
			$(this).stop().animate({ backgroundPosition: '419px 0px', backgroundColor: '#F7F3ED', textIndent: "5px" }, 300);
		}, function() {
			$(this).stop().animate({ backgroundPosition: '419px -42px', backgroundColor: '#FFFFFF', textIndent: "0px" }, 300);
		});
		
		$("#form7").validate();
		$("#form8").validate();
		
		var x = $(".subpages").offset().top;

		$(window).scroll(function() {
            var y = $(this).scrollTop();
			
			if(y >= x) {
				$(".subpages").addClass("subpage-fixed");
				}
			else {
				$(".subpages").removeClass("subpage-fixed");
				}
			});
			
			
		$('#quote-group2').slideUp();
		$('#quote-group3').slideUp();
		
		$('#Field21').change(function() {
			if($('#Field21').val() == "1") {
				$('#quote-group2').slideUp();
				$('#quote-group3').slideUp();
				}
			if($('#Field21').val() == "2") {
				$('#quote-group2').slideDown();
				}
			if($('#Field21').val() == "3") {
				$('#quote-group2').slideDown();
				$('#quote-group3').slideDown();
				}
		});

	});
