// Hover Fadings
$(function() {
	
	$("#navigation a span").css("opacity","0");
	$("#navigation a span").hover(function () {
		$(this).stop().animate({
			opacity: 1
		}, 300);
	},
	function () {
		$(this).stop().animate({
			opacity: 0
		}, 500);
	});
	
	$(".button a span").css("opacity","0");
	$(".button a span").hover(function () {
		$(this).stop().animate({
			opacity: 1
		}, 300);
	},
	function () {
		$(this).stop().animate({
			opacity: 0
		}, 500);
	});
	
	$("button span").css("opacity","0");
	$("button span").hover(function () {
		$(this).stop().animate({
			opacity: 1
		}, 300);
	},
	function () {
		$(this).stop().animate({
			opacity: 0
		}, 500);
	});
	
	$(".bottom-button a span").css("opacity","0");
	$(".bottom-button a span").hover(function () {
		$(this).stop().animate({
			opacity: 1
		}, 300);
	},
	function () {
		$(this).stop().animate({
			opacity: 0
		}, 500);
	});
	
	$("#pageheading a span").css("opacity","0");
	$("#pageheading a span").hover(function () {
		$(this).stop().animate({
			opacity: 1
		}, 300);
	},
	function () {
		$(this).stop().animate({
			opacity: 0
		}, 500);
	});
	
	$("#controls a span").css("opacity","0");
	$("#controls a span").hover(function () {
		$(this).stop().animate({
			opacity: 1
		}, 300);
	},
	function () {
		$(this).stop().animate({
			opacity: 0
		}, 300);
	});
	
	$("#showcase #controls").css("opacity","0");
	$("#showcase").hover(function () {
		$("#showcase #controls").stop().animate({
			opacity: 1
		}, 300);
	},
	function () {
		$("#showcase #controls").stop().animate({
			opacity: 0
		}, 500);
	});
	
	$(".socials a span").css("opacity","0");
	$(".socials a span").hover(function () {
		$(this).stop().animate({
			opacity: 1
		}, 300);
	},
	function () {
		$(this).stop().animate({
			opacity: 0
		}, 500);
	});
	
	$(".sorter a span").css("opacity","0");
	$(".sorter a span").hover(function () {
		$(this).stop().animate({
			opacity: 1
		}, 200);
	},
	function () {
		$(this).stop().animate({
			opacity: 0
		}, 200);
	});
	
});

// PrettyPhoto Lightbox
$(document).ready(function(){
	$("#services:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',slideshow:3000});
	$("#showcase:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',slideshow:3000});
	$("#single:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',slideshow:3000});
});

// Guidepost Effect
$(document).ready(function(){
	$("#guidepost .box").css({backgroundColor: '#f3f3fd'});
	$("#guidepost .box").hover(function () {
		$(this).animate({backgroundColor: '#ffffff'}, 300);
	},
	function () {
		$(this).animate({backgroundColor: '#f3f3fd'}, 300);
	});
});

// Product Slideshow
$('#showcase .slidecontainer').cycle({
	fx:     'scrollHorz',
	speed:  500,
	timeout: 8000,
	prev:   '#prev',
	next:   '#next'
});
$('#controls').not('.stopped').find('a').click(function(){
$('#showcase .slidecontainer').cycle('pause');
$('#controls').addClass('stopped');
return false;
});

// Contact Form
$().ready(function() {                    
	var container = $('div.validationerror');
	var validator = $("#contact-form").validate({
		errorContainer: container,
		errorLabelContainer: $("ul", container),
		wrapper: 'li',
		meta: "validate"
	});
});
$(document).ready(function() {
	$('#contact-form').ajaxForm(function() { 
		$('div.validationsuccess').removeClass('nodisplay');
	});
});

