$(function () {
	$('#canvas-overlay').show().click(function(){
		$(this).fadeOut(200);
	});
	
	if ($('.multiplebgs').size() > 0) {
		$topPixel = $(window).scrollTop();
		$('body').css('background-position', 'right ' + $topPixel*0.7 + 'px, right ' + $topPixel*-0.1 + 'px, center ' + $topPixel*-0.3 + 'px');
		$(window).scroll(function(){
			$topPixel = $(window).scrollTop();
			$('body').css('background-position', 'right ' + $topPixel*0.7 + 'px, right ' + $topPixel*-0.1 + 'px, center ' + $topPixel*-0.3 + 'px');
		});	
	} else {
		$topPixel = $(window).scrollTop();
		$('body').css('background-position', 'center ' + $topPixel*-0.3 + 'px');
		$(window).scroll(function(){
			$topPixel = $(window).scrollTop();
			$('body').css('background-position', 'center ' + $topPixel*-0.3 + 'px');
		});	
	}
	
	$('.gallery').each(function(){
		$(this).find('a').lightBox();
	});

	$('#header').loopedSlider({
		container: '#carousel',
		slides: '#carousel-items',
		containerClick: true, // Click container for next slide
		autoStart: 10000, // Set to positive number for auto start and interval time
		restart: 0, // Set to positive number for restart and restart time
		slidespeed: 4000, // Speed of slide animation
		fadespeed: 300, // Speed of fade animation
		autoHeight: 300 // Set to positive number for auto height and animation speed
	});
	
	$.localScroll.hash();
	$.localScroll({
		hash: true,
		stop: true
	});
});
