
	$(document).ready(function(){

		/* --------------------------------------------------
		Home Page
		-------------------------------------------------- */
		// Replace the address in the jumbotron with Gotham
		Cufon.replace('div#jumbotron p', {
			fontFamily: 'Gotham Book',
			fontWeight: '100',
			letterSpacing: '-0.5px',
			color: '#73a19d',
			textShadow: '0 -1px 0 #223033'
		});
		
		// Hook up the photo gallery inside the jumbotron
		var animating = false;
		var activePhoto = 1;
		var jumbotron = $('div#jumbotron');
		var photoList = $('div#jumbotron ul');
		var photos = $('div#jumbotron ul li');
		var photoWidth = 480;
		var prevButton = $('div#jumbotron div#leftPhotoShade a');
		var nextButton = $('div#jumbotron div#rightPhotoShade a');
		var checkPagination = function(){
			if (activePhoto == 0) {
				prevButton.addClass('disabled');
				nextButton.removeClass('disabled');
			} else if (activePhoto >= photos.length - 1) {
				nextButton.addClass('disabled');
				prevButton.removeClass('disabled');
			} else {
				prevButton.removeClass('disabled');
				nextButton.removeClass('disabled');
			}
		};
		var centerPhotos = function(){
			photoList.animate({ left: ((230 + (activePhoto * photoWidth) - (jumbotron.outerWidth() / 2)) * -1) }, {
				duration: 500,
				queue: false
			});
		};
		centerPhotos();
		$(window).resize(centerPhotos);
		$('div#jumbotron ul, div#jumbotron p').delay(850).fadeIn(1500);
		
		nextButton.click(function(){
			if (activePhoto < photos.length - 1 && !animating) {
				animating = true;
				activePhoto += 1;
				checkPagination();
				photoList.animate({ left: ('-=' + photoWidth) }, {
					duration: 750,
					queue: false,
					complete: function(){
						animating = false;
					}
				});
			}
			return false;
		});
		
		prevButton.click(function(){
			if (activePhoto >= 1 && !animating) {
				animating = true;
				activePhoto -= 1;
				checkPagination();
				photoList.animate({ left: ('+=' + photoWidth) }, {
					duration: 750,
					queue: false,
					complete: function(){
						animating = false;
					}
				});
			}
			return false;
		});
		
		/* --------------------------------------------------
		Single.php
		-------------------------------------------------- */
		Cufon.replace('form#addComment.logged-in label, div#postComments h4', {
			fontFamily: 'Gotham Medium',
			fontWeight: '500',
			letterSpacing: '-1px',
			color: '-linear-gradient(#9e9e9e, #8a8a8a)'
		});
		
		Cufon.replace('div#postComments h4 span', {
			fontFamily: 'Gotham Medium',
			fontWeight: '500',
			letterSpacing: '-1px',
			color: '-linear-gradient(#666, #444)'
		});
	
	});