
	$(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'
		});
		
		Cufon.replace('div#jumbotron p span.locationDetails', {
			fontFamily: 'Gotham Book',
			fontWeight: '100',
			letterSpacing: '-0.5px',
			color: '#FFFFFF',
			textShadow: '0 -1px 0 #223033'
		});
		
		Cufon.replace('p.locations', {
			fontFamily: 'Gotham Book',
			fontWeight: '100',
			letterSpacing: '-0.5px',
			color: '#374343',
			textShadow: '0 1px 0 #5d8d89'
		});
		
		Cufon.replace('p.locations span.locationDetails', {
			fontFamily: 'Gotham Book',
			fontWeight: '100',
			letterSpacing: '-0.5px',
			color: '#FFFFFF',
			textShadow: '0 -1px 0 #223033'
		});

		// Cufon.replace('.locationsBox h3', {
		// 	fontFamily: 'Gotham Medium',
		// 	fontWeight: '500',
		// 	letterSpacing: '-1px',
		// 	color: '-linear-gradient(#5d9a95,#7bada9)'
		// 	// 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;
		});
		
		/* --------------------------------------------------
		Locations
		-------------------------------------------------- */
		$('.locationDetails').hide();
		$('.locationLink').bind('mouseenter', function(e){$(this).find('.locationDetails').fadeIn(150);});
		$('.locationLink').bind('mouseleave', function(e){$(this).find('.locationDetails').fadeOut(150);});
		
		$('.globalNav .dd').hide().parent('li').mouseenter(function(){
			$(this).children('.dd').fadeIn(150);
		}).mouseleave(function(){
			$(this).children('.dd').fadeOut(150);
		})
		
		/* --------------------------------------------------
		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)'
		});
	
	});
