WebFontConfig = {
   custom: { families: ['CartoGothic Pro Light'],
   urls: [ 'http://f.fontdeck.com/s/css/9p31PiwfzlOQW0Tg8iNWs2eCu9Q/piledrivers.co.uk/4647.css' ] }
};
 
(function() {
   var wf = document.createElement('script');
   wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
   wf.type = 'text/javascript';
   wf.async = 'true';
   var s = document.getElementsByTagName('script')[0];
   s.parentNode.insertBefore(wf, s);
})();


$("#navigation-fadein").ready(function() {
      $(".navigation-container").hide();
      $(".navigation-container").delay(1500).fadeIn(400);
      $("#thumbs").hide();
      $("#thumbs").delay(2000).fadeIn(200);
});


$("#animation").ready(function() {
	$("#dog").hide();
	$("#dog").delay(4000).fadeIn(800);
	$("#arrow").hide();
	$("#arrow").delay(6000).fadeIn(800);
	
});


$(document).ready(function(){
	$('.fadein').cycle();
	$('.large-image').cycle();
	$("a[rel^='prettyPhoto']").prettyPhoto();
	$('#contact_form').validate();

	$("#carousel-images").nivoSlider({
		effect:'sliceUpDownLeft',
		slices:15,
		animSpeed:500, //Slide transition speed
		pauseTime:5000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:false, //Only show on hover
        controlNav:true, //1,2,3...
        controlNavThumbs:true, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:true, //Use image rel for thumbs
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:true, //Force manual transitions
        captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){
			$(".nivo-controlNav a.active img").fadeTo("slow",0.5);
		},
		afterChange: function(){
			$(".nivo-controlNav a.active img").fadeTo("slow",1);
		},
		slideshowEnd: function(){}, //Triggers after all slides have been shown
		lastSlide: function(){}, //Triggers when last slide is shown
		afterLoad: function(){ //Triggers when slider has loaded
			$(".nivo-controlNav img:not(a.active img)").fadeTo("fast",0.5);
		} 
	});

});


$(document).ready(function(){

	//###############   PRETTYPHOTO, Zoom functionality throughout content   ###############
	$("a[rel^='prettyPhoto']")
		.each(function() {
			$(this).hover(function() {$(this).children('.zoom').fadeIn(250);}, function() {$(this).children('.zoom').fadeOut(250);});
		})
		.append('<img src="/themes/site_themes/piledrivers/images/zoom.png" alt="zoom" class="zoom" />')
		.prettyPhoto({
			showTitle: true,
			counter_separator_label: " of "
		});

});


