anchorPositions = [];
		
$(document).ready(function() {

	// // Remove everything before the anchor of the links in the nav menu
		// // This is so the smoothAnchors plugin will work
		// $(".navigationWrapper a").each(function() {
		// if (0 < $(this).attr('href').indexOf('#')) {
		//
		// bits = $(this).attr('href').split('#');
		// $(this).attr('href','#'+bits[1]);
		// }
		//		
		// });

		$(".navigationWrapper a").each(function() {
			if (0 < $(this).attr('href').indexOf('#')) {

				bits = $(this).attr('href').split('#');
				anchorPositions[bits[1]] = $('a[name='+bits[1]+']').offset().left;
				
				$(this).click(function() {

					bits = $(this).attr('href').split('#');
					anchorPositions[bits[1]] = $('a[name='+bits[1]+']').offset().left;

					left = $('a[name='+bits[1]+']').offset().left;
					$.scrollTo({top:'0px', left: left+'px'}, 1000, {margin: true

					})
				});

			}
			;

		});

		if (0 < window.location.href.indexOf('#')) {
			bits = window.location.href.split('#');
			anchorPositions[bits[1]] = $('a[name='+bits[1]+']').offset().left;

			left = $('a[name='+bits[1]+']').offset().left;
			$.scrollTo({top:'0px', left: left+'px'}, 1000, {margin: true
		})
		}
		
		
	});
