var LeftScrollIncrements = 960;
var LeftScrollDurationIncrements = 300;
var NavHome = 0;
var NavLogos = 1;
var NavBusinessCards = 2;
var NavFlyers = 3;
var NavCovers = 4;
var NavMisc = 5;

$(function(){
	$('.NavToHome')
		.click(function(){
			var scrollLeftLocation = NavHome * LeftScrollIncrements;
			var scrollLeftDuration = LeftScrollDurationIncrements;
			if($("#MainWindow").scrollLeft() > scrollLeftLocation) {
				scrollLeftDuration = (($("#MainWindow").scrollLeft() - scrollLeftLocation)/LeftScrollIncrements) * LeftScrollDurationIncrements;
			} else {
				scrollLeftDuration = ((scrollLeftLocation - $("#MainWindow").scrollLeft())/LeftScrollIncrements) * LeftScrollDurationIncrements;
			}
			$("#MainWindow").stop().animate({"scrollLeft": scrollLeftLocation}, {duration: scrollLeftDuration, easing: 'easeOutSine', queue: true});
		});

	$('.NavToLogos')
		.click(function(){
			var scrollLeftLocation = NavLogos * LeftScrollIncrements;
			var scrollLeftDuration = LeftScrollDurationIncrements;
			if($("#MainWindow").scrollLeft() > scrollLeftLocation) {
				scrollLeftDuration = (($("#MainWindow").scrollLeft() - scrollLeftLocation)/LeftScrollIncrements) * LeftScrollDurationIncrements;
			} else {
				scrollLeftDuration = ((scrollLeftLocation - $("#MainWindow").scrollLeft())/LeftScrollIncrements) * LeftScrollDurationIncrements;
			}
			$("#MainWindow").stop().animate({"scrollLeft": scrollLeftLocation}, {duration: scrollLeftDuration, easing: 'easeOutSine', queue: true});
		});

	$('.NavToBusinessCards')
		.click(function(){
			var scrollLeftLocation = NavBusinessCards * LeftScrollIncrements;
			var scrollLeftDuration = LeftScrollDurationIncrements;
			if($("#MainWindow").scrollLeft() > scrollLeftLocation) {
				scrollLeftDuration = (($("#MainWindow").scrollLeft() - scrollLeftLocation)/LeftScrollIncrements) * LeftScrollDurationIncrements;
			} else {
				scrollLeftDuration = ((scrollLeftLocation - $("#MainWindow").scrollLeft())/LeftScrollIncrements) * LeftScrollDurationIncrements;
			}
			$("#MainWindow").stop().animate({"scrollLeft": scrollLeftLocation}, {duration: scrollLeftDuration, easing: 'easeOutSine', queue: true});
		});

	$('.NavToFlyers')
		.click(function(){
			var scrollLeftLocation = NavFlyers * LeftScrollIncrements;
			var scrollLeftDuration = LeftScrollDurationIncrements;
			if($("#MainWindow").scrollLeft() > scrollLeftLocation) {
				scrollLeftDuration = (($("#MainWindow").scrollLeft() - scrollLeftLocation)/LeftScrollIncrements) * LeftScrollDurationIncrements;
			} else {
				scrollLeftDuration = ((scrollLeftLocation - $("#MainWindow").scrollLeft())/LeftScrollIncrements) * LeftScrollDurationIncrements;
			}
			$("#MainWindow").stop().animate({"scrollLeft": scrollLeftLocation}, {duration: scrollLeftDuration, easing: 'easeOutSine', queue: true});
		});

	$('.NavToCovers')
		.click(function(){
			var scrollLeftLocation = NavCovers * LeftScrollIncrements;
			var scrollLeftDuration = LeftScrollDurationIncrements;
			if($("#MainWindow").scrollLeft() > scrollLeftLocation) {
				scrollLeftDuration = (($("#MainWindow").scrollLeft() - scrollLeftLocation)/LeftScrollIncrements) * LeftScrollDurationIncrements;
			} else {
				scrollLeftDuration = ((scrollLeftLocation - $("#MainWindow").scrollLeft())/LeftScrollIncrements) * LeftScrollDurationIncrements;
			}
			$("#MainWindow").stop().animate({"scrollLeft": scrollLeftLocation}, {duration: scrollLeftDuration, easing: 'easeOutSine', queue: true});
		});

	$('.NavToMisc')
		.click(function(){
			var scrollLeftLocation = NavMisc * LeftScrollIncrements;
			var scrollLeftDuration = LeftScrollDurationIncrements;
			if($("#MainWindow").scrollLeft() > scrollLeftLocation) {
				scrollLeftDuration = (($("#MainWindow").scrollLeft() - scrollLeftLocation)/LeftScrollIncrements) * LeftScrollDurationIncrements;
			} else {
				scrollLeftDuration = ((scrollLeftLocation - $("#MainWindow").scrollLeft())/LeftScrollIncrements) * LeftScrollDurationIncrements;
			}
			$("#MainWindow").stop().animate({"scrollLeft": scrollLeftLocation}, {duration: scrollLeftDuration, easing: 'easeOutSine', queue: true});
		});
});
