$(document).ready(function(){
	$('#cycle').cycle({
		fx:        'fade',
		speed:   600,
		timeout: 6500,
		next:   '#cycle img',
		pager:      '#nav',
		pagerAnchorBuilder: function(idx, slide) {
			return '#nav li:eq(' + idx + ') a';
		},
		pause:   1
	});
	
	$("a[href*=#]")
		.click(function() {
		var duration=500;
		var easing="swing";
		var newHash=this.hash;
		var target=$(this.hash).offset().top;
		var oldLocation=window.location.href.replace(window.location.hash, '');
		var newLocation=this;
		if(oldLocation+newHash==newLocation){
			$('html:not(:animated),body:not(:animated)')
			.animate({ scrollTop: target }, duration, easing, function() {
				window.location.href=newLocation;
			})

			return false;

		}
	});

	$(".image a").fancybox({
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'titlePosition'	: 'inside',
		overlayOpacity: 0.5,
		overlayColor: '#707070'
	});

	$(".photo a").fancybox({
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'titlePosition'	: 'inside',
		overlayOpacity: 0.5,
		overlayColor: '#707070'
	});

});


