/*Get rid of floating image titles*/
$(document).ready(function() {
	$("img").removeAttr("title");
});

/*Homepage slideshow*/
$(document).ready(function() {
    $('.homepage .slideshow').cycle({
		fx: 'fade',
		speed:  1000, 
		timeout: 6000
	});
});

function onAfter(curr,next,opts) {
	var caption = (opts.currSlide + 1) + ' of ' + opts.slideCount;
	$('#info').html(caption);
}


/*Basic slideshow*/
jQuery(document).ready(function($) {
		$(document).ready(function() {
		
			$(function() {
				var index = 0, hash = window.location.hash;
				if (hash) {
				index = /\d+/.exec(hash)[0];
				index = (parseInt(index) || 1) - 1; // slides are zero-based
			}
		
		$('.page-template-project-slideshow-php .slideshow').cycle({
					fx: 'fade',
					speed: 800,
					timeout: 0,
					next: $('.next'),
					startingSlide: index,
					prev: $('.prev'),
					after:     onAfter
		});
 
	$('.pause').click(function() { 
		$('.portfolio-slideshow').cycle('toggle'); 
	});
	
	function onAfter(curr,next,opts) {
		window.location.hash = opts.currSlide + 1;
		var caption = (opts.currSlide + 1) + ' of ' + opts.slideCount;
		$('#info').html(caption);
	}	}); }); });
	
/*Slideshow with thumbs*/
jQuery(document).ready(function($) {
		$(document).ready(function() {
		
			$(function() {
				var index = 0, hash = window.location.hash;
				if (hash) {
				index = /\d+/.exec(hash)[0];
				index = (parseInt(index) || 1) - 1; // slides are zero-based
			}
		
		$('.page-template-project-slideshow-thumbs-php .slideshow').cycle({
					fx: 'fade',
					speed: 800,
					timeout: 0,
					next: $('.next'),
					startingSlide: index,
					prev: $('.prev'),
					after:     onAfter,
					pager:  '#slides',
					pagerAnchorBuilder: function(idx, slide) {
					// return sel string for existing anchor
					return '#slides li:eq(' + (idx) + ') a';
      }
	});
 
	$('.pause').click(function() { 
		$('.portfolio-slideshow').cycle('toggle'); 
	});
	
	function onAfter(curr,next,opts) {
		window.location.hash = opts.currSlide + 1;
		var caption = (opts.currSlide + 1) + ' of ' + opts.slideCount;
		$('#info').html(caption);
	}	}); }); });
	
/*Switcher*/

$('#switcher-dark').bind('click', function() { 
    $('body').addClass('pt_dark'); 
 }); 


$('#switcher-light').bind('click', function() { 
    $('body').removeClass('pt_dark'); 
 }); 
 
  
 