$(document).ready(function() {
	$('#slideshow').anythingSlider({
		hashTags:false,		
		buildArrows:false,
		autoPlay:true,
		delay: 10000,
		animationTime: 800		
	});


	$('#slideshow li').mouseover(function(e) {
		var $this = $(this);
		var $link = $('input:hidden', $this);
		if($this.hasClass('sprite')) {
			$this.css('background-position', '0 -240px');
		}
		if($link.length > 0) {
			$this.css('cursor', 'pointer');
		}
	}).mouseout(function(e) {
		var $this = $(this);
		if($this.hasClass('sprite')) {
			$(this).css('background-position', '0 0');
		}
		$this.css('cursor', 'auto');
	}).click(function(e) {
		var $this = $(this);
		var $link = $('input:hidden', $this);
		if($link.length > 0) {
			window.location.href = $link.val();
		}
	});

	var $state = "closed";

	$('#togglequote').click( function() {
	
		if($state == 'closed') {	
	
			$state = 'open';
			$('#quote').animate( { 
				height: '400px'
			});
			$('fieldset#quoteform').show();

			$('div.contact-options a.quote').addClass("active");  
		}
		else {
			$state = 'closed';
			$('#quote').animate( { 
				height: '0px'
			});

			$('fieldset#quoteform').hide();
			$('div.contact-options a.quote').removeClass("active");  		
		}		
	
	});
	
	$('.DistribLogos li p').mouseenter(function() {
			var $this = $(this);
			$this.animate({opacity: 0.55}, 'fast');
		}).mouseleave(function() {
			var $this = $(this);
			$this.animate({opacity: 1}, 'fast');
	});

});
