/* Circle Navigation
-----------------------------------------------------------------------------------*/ 

$(document).ready(function() {
	$('.fadeThis').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(500, 1);
	  }, function () {
	    $span.stop().fadeTo(500, 0);
	  });
	});
	
});


/* Toggle
------------------------------------------------------------------------------------*/

$(document).ready(function(){
	//Switch the Open and Close state per click then slide up/down (depending on open/close state)
	$("h2.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("medium");
		return false;});

});


/* Image hover
------------------------------------------------------------------------------------*/

jQuery('.post-thumb a img, .tab-thumb a img').hover( function () {
	jQuery(this).stop().animate({opacity : 0.7}, 300);
	}, function () {
	jQuery(this).stop().animate({opacity : 1}, 300);
}); 


/*
Back to Top
-------------------------------------------------------------------*/

	var topLink = jQuery('#back-to-top');

	function tz_backToTop(topLink) {
		
		if(jQuery(window).scrollTop() > 200) {
			topLink.fadeIn(300);
		} else {
			topLink.fadeOut(300);
		}
	}
	
	jQuery(window).scroll( function() {
		tz_backToTop(topLink);
	});
	
	topLink.find('a').click( function() {
		jQuery('html, body').stop().animate({scrollTop:0}, 500);
		return false;
	});



/* Nivo Slider
------------------------------------------------------------------------------------*/
    $(window).load(function() {
        $('#slider').nivoSlider({
        pauseTime: 12000        
       });
    });
    
    

/* Pretty Photo
------------------------------------------------------------------------------------*/

jQuery(document).ready(function(){
			$("#gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'light_square'});
		});
		


