$(document).ready(function() {
						   
	if ($('body').hasClass('home')) {
		
			$('.home-slideshow')
			.after('<div class="home-image-dots">')
			.cycle({
				timeout:4000,
				speed:500,
				fx: 'scrollLeft',
				pager: '.home-image-dots',
				autostop:false 
			});
			$('.home-image-meta').cycle({
				timeout:4000,
				speed:500,
				fx: 'fade'
			});

	} else {
			var index = 0, hash = window.location.hash;
			if (hash) {
				index = /\d+/.exec(hash)[0];
				index = (parseInt(index) || 1) - 1; // slides are zero-based
			}
			$('.bio-slideshow').cycle({
				timeout:4000,
				speed:500,
				fx: 'scrollDown',
				autostop:false 
			});
			$('.gallery-images').cycle({
				timeout:0,
				speed:500,
				fx: 'scrollHorz',
				startingSlide: index,
				after: function(curr,next,opts) {
					window.location.hash = opts.currSlide + 1;
				}
			});
			$('.gallery-image-meta').cycle({
				timeout:0,
				speed:500,
				fx: 'fade',
				sync: false,
				startingSlide: index,
				after: function(curr,next,opts) {
					window.location.hash = opts.currSlide + 1;
					var pathname = window.location.pathname;
					$('#comments').val('Check out this amazing find from Colby June Jewelry: \nhttp://www.colbyjune.com'+pathname+window.location.hash);
					$('#facebook-like').attr('src', 'http://www.facebook.com/plugins/like.php?app_id=204587709578595&amp;href=http%3A%2F%2Fwww.colbyjune.com'+pathname+window.location.hash+'&amp;send=false&amp;layout=button_count&amp;width=300&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21'); 
				}
			});
			$('.gallery-thumbs').cycle({
				timeout:0,
				speed:500,
				fx: 'scrollHorz',
				startingSlide: 0
			});
	}

	$('#prev-arrow-gallery').click(function() { 
   		 $('.gallery-images').cycle('prev');
		 $('.gallery-image-meta').cycle('prev');
		 $('.gallery-thumbs li.active').removeClass('active');
		 return false;
	});
	$('#next-arrow-gallery').click(function() { 
   		 $('.gallery-images').cycle('next');
		 $('.gallery-image-meta').cycle('next');
		 $('.gallery-thumbs li.active').removeClass('active');
		 return false;
	});
	$('#prev-arrow-thumbs').click(function() { 
		 $('.gallery-thumbs').cycle('prev');
		 return false;
	});
	$('#next-arrow-thumbs').click(function() { 
		 $('.gallery-thumbs').cycle('next');
		 return false;
	});
	var $gallery = $('.gallery-images');
	var $gallerymeta = $('.gallery-image-meta');
	$.each($('.gallery-thumbs li.thumbs'), function(i, li){
		$(li).click(function(){
	 		$gallery.cycle(i);
			$gallerymeta.cycle(i);
		});			
	});
	$('.gallery-thumbs li').click(function(){
		$('.gallery-thumbs li.active').removeClass('active');
		$(this).addClass('active');
	}); 
	$('#social-btn').click(function() { 
		 $('#social-btn').fadeOut('fast');
		 $('#social-btn-close').fadeIn('fast');
		 $('#email-friend').fadeIn('fast');
		 return false;
	});
	$('#social-btn-close').click(function() { 
		 $('#social-btn-close').fadeOut('fast');
		 $('#social-btn').fadeIn('fast');
		 $('#email-friend').fadeOut('fast');
		 return false;
	});
	$('.gallery-images-container').mouseover(function() { 
		$('.gallery-images-container .arrows-nav').show();
	});
	$('.gallery-images-container').mouseout(function() { 
		$('.gallery-images-container .arrows-nav:visible').hide();
	});
	
	//do on page load
	$('.gallery-images-container .arrows-nav').fadeIn('fast');
	$('.gallery-images-container .arrows-nav').delay(2000).fadeOut('fast');

}); //CLOSE READY FUNCTION

