try {

document.addEventListener("DOMContentLoaded", function() {
	var element = document.getElementById("box");

	var swipeHandler = function(touches, direction) {
		var whichdir = direction;

		if ( whichdir == "left") { moveRight(); }
		if ( whichdir == "right") { moveLeft(); }
	};
	jester(element, { swipeDistance: 10, preventDefault: false })
		.swipe(swipeHandler)
}, false);

} catch (e) {}


$(document).keydown(function(e){
    if (e.keyCode == 39) { 
       moveRight();
       setTimeout("changeControls();", 1600);
       $('#box span').hide().css({"left":"-10000px"});
    }
});

$(document).keydown(function(e){
    if (e.keyCode == 37) { 
       moveLeft();
       setTimeout("changeControls();", 1600);
    }
});

function fixOffset() {
	var offset = $('#verticalBorder').offset();
	var offsetfix = offset.left + 270;
	
	$('#box, #controls').css('left', function(index) {
	  return offsetfix;
	});
}

$(document).ready(function() {
	window.onresize = function(event) {
		fixOffset();
	}

	setTimeout("fixOffset();", 1);


	$('.cntrlLeft').click(function() {
		moveLeft();
       setTimeout("changeControls();", 1600);
	  });
	$('.cntrlRight').click(function() {
		moveRight();
       	setTimeout("changeControls();", 1600);
	  });
	
	$("#box").bind("mousewheel", function(event, delta) {
		if (delta > 0) {
			moveLeft();
       	setTimeout("changeControls();", 1600);
		} else {
			moveRight();
       	setTimeout("changeControls();", 1600);
			$('#box span').hide().css({"left":"-10000px"});
		}
		return false;
	 });

// bottom controls

    $('.cntrlDots img').hover(function () {   
		this.src = this.src.replace("_off","_over_off"); 

    }, function () {
		this.src = this.src.replace("_over_on","_on");      
		this.src = this.src.replace("_over_off","_off"); 
    });

	$('.cntrlLeft').hover(function () {
		if (current != "intro" && inMotion == false ) {
			var imageOn = $("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
		
			$(imageOn).attr("src", "img/cntrl_arrow_left_over.gif");
			$('.leftOn').css("display","block");
		}
	}, function () {
		if (current != "intro" && inMotion == false ) {
			var imageOn = $("#leftArrow").attr("src", "img/cntrl_arrow_left_over.gif");
		
			$(imageOn).attr("src", "img/cntrl_arrow_left_on.gif");
			$('.leftOn').hide();
		}
	});
	
	$('.cntrlRight').hover(function () {
		if (current != "6" && inMotion == false ) {
			var imageOn = $("#rightArrow").attr("src", "img/cntrl_arrow_right_on.gif");
		
			$(imageOn).attr("src", "img/cntrl_arrow_right_over.gif");
			$('.rightOn').css("display","block");
		}
	}, function () {
		if (current != "6" && inMotion == false ) {
			var imageOn = $("#rightArrow").attr("src", "img/cntrl_arrow_right_over.gif");
		
			$(imageOn).attr("src", "img/cntrl_arrow_right_on.gif");
			$('.rightOn').hide();
		}
	});

// bottle pop-ups

    $('.l8bottle').hover(function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle1').show().css({"left":"84px"});
		}
    }, function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle1').hide().css({"left":"-10000px"});
		}
    });
    $('.l7bottle').hover(function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle234').show().css({"left":"130px"});
		}
    }, function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle234').hide().css({"left":"-10000px"});
		}
    });
    $('.l6bottle').hover(function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle234').show().css({"left":"185px"});
		}
    }, function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle234').hide().css({"left":"-10000px"});
		}
    });
    $('.l5bottle').hover(function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle234').show().css({"left":"245px"});
		}
    }, function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle234').hide().css({"left":"-10000px"});
		}
    });
    $('.l4bottle').hover(function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle5').show().css({"left":"315px"});
		}
    }, function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle5').hide().css({"left":"-10000px"});
		}
    });
    $('.l3bottle').hover(function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle6').show().css({"left":"404px"});
		}
    }, function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle6').hide().css({"left":"-10000px"});
		}
    });
    $('.f2bottle').hover(function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle7').show().css({"left":"500px"});
		}
    }, function () {
		if (current == "intro" && inMotion == false) {
			$('#bottle7').hide().css({"left":"-10000px"});
		}
    });
});


$(document).ready(function() {
	$('.f0IntroText').show();
	inMotion = false;
	current = "load";

	var introValue = jaaulde.utils.cookies.get('introValue');
	var currentTime = jaaulde.utils.cookies.get('currentTime');
	var currTime = new Date().getTime();
	var newTime = currTime +1800000;

	if ( introValue == undefined ) {
		current = "load";
		jaaulde.utils.cookies.set('introValue', current, { hoursToLive: .5});
		jaaulde.utils.cookies.set('currentTime', newTime);
	}
	if ( introValue != undefined ) {
		var introValue = jaaulde.utils.cookies.get('introValue');
		var currentTime = jaaulde.utils.cookies.get('currentTime');

		if ( currTime > currentTime ) {
			jaaulde.utils.cookies.set('introValue', 'load', { hoursToLive: .5});
			jaaulde.utils.cookies.set('currentTime', newTime);
		}
	}
	runIntro();
});

function refreshIntro() {
	$(window).unload(function() {
		jaaulde.utils.cookies.del('introValue');
		jaaulde.utils.cookies.del('currentTime');
	});
}

$(window).unload(function() {
	var introValue = jaaulde.utils.cookies.set('introValue', current, { hoursToLive: .0});
});

function runIntro() {
	var introValue = jaaulde.utils.cookies.get('introValue');

	if ( introValue === 'load' ) {
		$(window).load(function () {
			setTimeout("$('.loadingGif').hide();", 2200);
		
			$('.l8bottle, .l7bottle, .l6bottle, .l5bottle, .l4bottle, .l3bottle, .f2bottle').hide();
		
		
			$('.l8bottle').delay(100).fadeIn(1500).animate({ left: '-=1490' }, 1500);
			$('.l7bottle').delay(100).fadeIn(1500).animate({ left: '-=1360' }, 1500);
			$('.l6bottle').delay(100).fadeIn(1500).animate({ left: '-=1262' }, 1500);
			$('.l5bottle').delay(100).fadeIn(1500).animate({ left: '-=1168' }, 1500);
			$('.l4bottle').delay(100).fadeIn(1500).animate({ left: '-=1096' }, 1500);
			$('.l3bottle').delay(100).fadeIn(1500).animate({ left: '-=1094' }, 1500);
			$('.f2bottle').delay(100).fadeIn(1500).animate({ left: '-=800' }, 1500, function(){
		
				$('.l7Blurb').fadeIn(1000);
				setTimeout("$('#controls').fadeIn('slow');$('#layer1 img, #layer2 img, #layer3 img, #layer4 img,#layer5 img, #layer6 img, #layer7 img, #layer8 img').show();current = 'intro';inMotion = false;", 500);
				$('#cattlepen').html('<img src="img/print_home.png" width="1" height="1" class="printHome" /><img src="img/f6Link3_link_on.png" width="1" height="1" /><img src="img/f6Link2_link_on.png" width="1" height="1" /><img src="img/f6Link1_link_on.png" width="1" height="1" /><img src="img/f5Link_link_on.png" width="1" height="1" /><img src="img/f3Link_link_on.png" width="1" height="1" /><img src="img/f4Blurb_link_on.png" width="1" height="1" />');
			});
			jaaulde.utils.cookies.set('introValue', current, { hoursToLive: .5});
		});
	 }
	if ( introValue === 'intro' ) {
		$(window).load(function () {
			setTimeout("$('.loadingGif').hide();", 2200);
		
			$('.l8bottle, .l7bottle, .l6bottle, .l5bottle, .l4bottle, .l3bottle, .f2bottle').hide();
		
		
			$('.l8bottle').delay(100).fadeIn(1500).animate({ left: '-=1490' }, 1500);
			$('.l7bottle').delay(100).fadeIn(1500).animate({ left: '-=1360' }, 1500);
			$('.l6bottle').delay(100).fadeIn(1500).animate({ left: '-=1262' }, 1500);
			$('.l5bottle').delay(100).fadeIn(1500).animate({ left: '-=1168' }, 1500);
			$('.l4bottle').delay(100).fadeIn(1500).animate({ left: '-=1096' }, 1500);
			$('.l3bottle').delay(100).fadeIn(1500).animate({ left: '-=1094' }, 1500);
			$('.f2bottle').delay(100).fadeIn(1500).animate({ left: '-=800' }, 1500, function(){
		
				$('.l7Blurb').fadeIn(1000);
				setTimeout("$('#controls').fadeIn('slow');$('#layer1 img, #layer2 img, #layer3 img, #layer4 img,#layer5 img, #layer6 img, #layer7 img, #layer8 img').show();current = 'intro';inMotion = false;", 500);
				$('#cattlepen').html('<img src="img/print_home.png" width="1" height="1" class="printHome" /><img src="img/f6Link3_link_on.png" width="1" height="1" /><img src="img/f6Link2_link_on.png" width="1" height="1" /><img src="img/f6Link1_link_on.png" width="1" height="1" /><img src="img/f5Link_link_on.png" width="1" height="1" /><img src="img/f3Link_link_on.png" width="1" height="1" /><img src="img/f4Blurb_link_on.png" width="1" height="1" />');
			});
			jaaulde.utils.cookies.set('introValue', current, { hoursToLive: .5});
		});
	 }
	if ( introValue === 2 ) {
		$(window).load(function () {
			$('.loadingGif').hide();
			inMotion = false;
	
			$('#layer1').animate({ left: '-=690' }, 0);
			$('#layer2').animate({ left: '-=560' }, 0);
			$('#layer3').animate({ left: '-=462' }, 0);
			$('#layer4').animate({ left: '-=368' }, 0);
			$('#layer5').animate({ left: '-=296' }, 0);
			$('#layer6').animate({ left: '-=239' }, 0);
			$('#layer7').animate({ left: '-=180' }, 0);
			$('#layer8').animate({ left: '-=128' }, 0);
			$('.f2bottle').show().animate({ left: '-=800' }, 1, function(){
		
					$('.l7Blurb').show();
					$('#controls, #layer1 img, #layer2 img, #layer3 img, #layer4 img,#layer5 img, #layer6 img, #layer7 img, #layer8 img').show();current = '2';
					$('#cattlepen').html('<img src="img/print_home.png" width="1" height="1" class="printHome" /><img src="img/f6Link3_link_on.png" width="1" height="1" /><img src="img/f6Link2_link_on.png" width="1" height="1" /><img src="img/f6Link1_link_on.png" width="1" height="1" /><img src="img/f5Link_link_on.png" width="1" height="1" /><img src="img/f3Link_link_on.png" width="1" height="1" /><img src="img/f4Blurb_link_on.png" width="1" height="1" />');
	
			$("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
			$("#leftSpan").addClass("leftOn");
			$("#rightArrow").attr("src", "img/cntrl_arrow_right_on.gif");
			$("#rightSpan").addClass("rightOn");
	
			$('#click1').attr("src", "img/cntrl_dot_off.gif" );
			$('#click2').attr("src", "img/cntrl_dot_on.gif" );
			$('#click3').attr("src", "img/cntrl_dot_off.gif" );
			$('#click4').attr("src", "img/cntrl_dot_off.gif" );
			$('#click5').attr("src", "img/cntrl_dot_off.gif" );
			$('#click6').attr("src", "img/cntrl_dot_off.gif" );
	
			$('.l8bottle').show().animate({ left: '-=1490' }, 1);
			$('.l7bottle').show().animate({ left: '-=1360' }, 1);
			$('.l6bottle').show().animate({ left: '-=1262' }, 1);
			$('.l5bottle').show().animate({ left: '-=1168' }, 1);
			$('.l4bottle').show().animate({ left: '-=1096' }, 1);
			$('.l3bottle').show().animate({ left: '-=1094' }, 1);
	
		});
			jaaulde.utils.cookies.set('introValue', current, { hoursToLive: .5});		
	});
	}
	if ( introValue === 3 ) {
		$(window).load(function () {
			$('.loadingGif').hide();
			inMotion = false;
	
			$('#layer1').animate({ left: '-=2070' }, 0);
			$('#layer2').animate({ left: '-=1680' }, 0);
			$('#layer3').animate({ left: '-=1386' }, 0);
			$('#layer4').animate({ left: '-=1104' }, 0);
			$('#layer5').animate({ left: '-=888' }, 0);
			$('#layer6').animate({ left: '-=717' }, 0);
			$('#layer7').animate({ left: '-=540' }, 0);
			$('#layer8').animate({ left: '-=384' }, 0);
			$('.f2bottle').show().animate({ left: '-=800' }, 1, function(){
		
					$('.l7Blurb').show();
					$('#controls, #layer1 img, #layer2 img, #layer3 img, #layer4 img,#layer5 img, #layer6 img, #layer7 img, #layer8 img').show();current = '3';
					$('#cattlepen').html('<img src="img/print_home.png" width="1" height="1" class="printHome" /><img src="img/f6Link3_link_on.png" width="1" height="1" /><img src="img/f6Link2_link_on.png" width="1" height="1" /><img src="img/f6Link1_link_on.png" width="1" height="1" /><img src="img/f5Link_link_on.png" width="1" height="1" /><img src="img/f3Link_link_on.png" width="1" height="1" /><img src="img/f4Blurb_link_on.png" width="1" height="1" />');
	
			$("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
			$("#leftSpan").addClass("leftOn");
			$("#rightArrow").attr("src", "img/cntrl_arrow_right_on.gif");
			$("#rightSpan").addClass("rightOn");
	
			$('#click1').attr("src", "img/cntrl_dot_off.gif" );
			$('#click2').attr("src", "img/cntrl_dot_off.gif" );
			$('#click3').attr("src", "img/cntrl_dot_on.gif" );
			$('#click4').attr("src", "img/cntrl_dot_off.gif" );
			$('#click5').attr("src", "img/cntrl_dot_off.gif" );
			$('#click6').attr("src", "img/cntrl_dot_off.gif" );
	
			$('.l8bottle').show().animate({ left: '-=1490' }, 1);
			$('.l7bottle').show().animate({ left: '-=1360' }, 1);
			$('.l6bottle').show().animate({ left: '-=1262' }, 1);
			$('.l5bottle').show().animate({ left: '-=1168' }, 1);
			$('.l4bottle').show().animate({ left: '-=1096' }, 1);
			$('.l3bottle').show().animate({ left: '-=1094' }, 1);
	
		});
			jaaulde.utils.cookies.set('introValue', current, { hoursToLive: .5});		
	});
	}
	if ( introValue === 4 ) {
		$(window).load(function () {
			$('.loadingGif').hide();
			inMotion = false;
	
			$('#layer1').animate({ left: '-=3450' }, 0);
			$('#layer2').animate({ left: '-=2800' }, 0);
			$('#layer3').animate({ left: '-=2310' }, 0);
			$('#layer4').animate({ left: '-=1840' }, 0);
			$('#layer5').animate({ left: '-=1480' }, 0);
			$('#layer6').animate({ left: '-=1195' }, 0);
			$('#layer7').animate({ left: '-=900' }, 0);
			$('#layer8').animate({ left: '-=640' }, 0);
			$('.f2bottle').show().animate({ left: '-=800' }, 1, function(){
		
					$('.l7Blurb').show();
					$('#controls, #layer1 img, #layer2 img, #layer3 img, #layer4 img,#layer5 img, #layer6 img, #layer7 img, #layer8 img').show();current = '4';
					$('#cattlepen').html('<img src="img/print_home.png" width="1" height="1" class="printHome" /><img src="img/f6Link3_link_on.png" width="1" height="1" /><img src="img/f6Link2_link_on.png" width="1" height="1" /><img src="img/f6Link1_link_on.png" width="1" height="1" /><img src="img/f5Link_link_on.png" width="1" height="1" /><img src="img/f3Link_link_on.png" width="1" height="1" /><img src="img/f4Blurb_link_on.png" width="1" height="1" />');
	$('.f6Bg').hide();
	
			$("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
			$("#leftSpan").addClass("leftOn");
			$("#rightArrow").attr("src", "img/cntrl_arrow_right_on.gif");
			$("#rightSpan").addClass("rightOn");
	
			$('#click1').attr("src", "img/cntrl_dot_off.gif" );
			$('#click2').attr("src", "img/cntrl_dot_off.gif" );
			$('#click3').attr("src", "img/cntrl_dot_off.gif" );
			$('#click4').attr("src", "img/cntrl_dot_on.gif" );
			$('#click5').attr("src", "img/cntrl_dot_off.gif" );
			$('#click6').attr("src", "img/cntrl_dot_off.gif" );
	
			$('.l8bottle').show().animate({ left: '-=1490' }, 1);
			$('.l7bottle').show().animate({ left: '-=1360' }, 1);
			$('.l6bottle').show().animate({ left: '-=1262' }, 1);
			$('.l5bottle').show().animate({ left: '-=1168' }, 1);
			$('.l4bottle').show().animate({ left: '-=1096' }, 1);
			$('.l3bottle').show().animate({ left: '-=1094' }, 1);
	
		});
			jaaulde.utils.cookies.set('introValue', current, { hoursToLive: .5});		
	});
	}
	if ( introValue === 5 ) {
		$(window).load(function () {
			$('.loadingGif').hide();
			inMotion = false;
	
			$('#layer1').animate({ left: '-=4830' }, 0);
			$('#layer2').animate({ left: '-=3920' }, 0);
			$('#layer3').animate({ left: '-=3234' }, 0);
			$('#layer4').animate({ left: '-=2576' }, 0);
			$('#layer5').animate({ left: '-=2072' }, 0);
			$('#layer6').animate({ left: '-=1673' }, 0);
			$('#layer7').animate({ left: '-=1260' }, 0);
			$('#layer8').animate({ left: '-=896' }, 0);
			$('.f2bottle').show().animate({ left: '-=800' }, 1, function(){
		
					$('.l7Blurb').show();
					$('#controls, #layer1 img, #layer2 img, #layer3 img, #layer4 img,#layer5 img, #layer6 img, #layer7 img, #layer8 img').show();current = '5';
					$('#cattlepen').html('<img src="img/print_home.png" width="1" height="1" class="printHome" /><img src="img/f6Link3_link_on.png" width="1" height="1" /><img src="img/f6Link2_link_on.png" width="1" height="1" /><img src="img/f6Link1_link_on.png" width="1" height="1" /><img src="img/f5Link_link_on.png" width="1" height="1" /><img src="img/f3Link_link_on.png" width="1" height="1" /><img src="img/f4Blurb_link_on.png" width="1" height="1" />');
	
			$("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
			$("#leftSpan").addClass("leftOn");
			$("#rightArrow").attr("src", "img/cntrl_arrow_right_on.gif");
			$("#rightSpan").addClass("rightOn");
	
			$('#click1').attr("src", "img/cntrl_dot_off.gif" );
			$('#click2').attr("src", "img/cntrl_dot_off.gif" );
			$('#click3').attr("src", "img/cntrl_dot_off.gif" );
			$('#click4').attr("src", "img/cntrl_dot_off.gif" );
			$('#click5').attr("src", "img/cntrl_dot_on.gif" );
			$('#click6').attr("src", "img/cntrl_dot_off.gif" );
	
			$('.l8bottle').show().animate({ left: '-=1490' }, 1);
			$('.l7bottle').show().animate({ left: '-=1360' }, 1);
			$('.l6bottle').show().animate({ left: '-=1262' }, 1);
			$('.l5bottle').show().animate({ left: '-=1168' }, 1);
			$('.l4bottle').show().animate({ left: '-=1096' }, 1);
			$('.l3bottle').show().animate({ left: '-=1094' }, 1);
	
		});
			jaaulde.utils.cookies.set('introValue', current, { hoursToLive: .5});		
	});
	}
	if ( introValue === 6 ) {
		$(window).load(function () {
			$('.loadingGif').hide();
			inMotion = false;
	
			$('#layer1').animate({ left: '-=6210' }, 0);
			$('#layer2').animate({ left: '-=5040' }, 0);
			$('#layer3').animate({ left: '-=4158' }, 0);
			$('#layer4').animate({ left: '-=3312' }, 0);
			$('#layer5').animate({ left: '-=2664' }, 0);
			$('#layer6').animate({ left: '-=2151' }, 0);
			$('#layer7').animate({ left: '-=1620' }, 0);
			$('#layer8').animate({ left: '-=1152' }, 0);
			$('.f2bottle').show().animate({ left: '-=800' }, 0, function(){
		
					$('.l7Blurb').show();
					$('#controls, #layer1 img, #layer2 img, #layer3 img, #layer4 img,#layer5 img, #layer6 img, #layer7 img, #layer8 img').show();current = '6';
					$('#cattlepen').html('<img src="img/print_home.png" width="1" height="1" class="printHome" /><img src="img/f6Link3_link_on.png" width="1" height="1" /><img src="img/f6Link2_link_on.png" width="1" height="1" /><img src="img/f6Link1_link_on.png" width="1" height="1" /><img src="img/f5Link_link_on.png" width="1" height="1" /><img src="img/f3Link_link_on.png" width="1" height="1" /><img src="img/f4Blurb_link_on.png" width="1" height="1" />');
	
			$("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
			$("#leftSpan").addClass("leftOn");
			$("#rightArrow").attr("src", "img/cntrl_arrow_right_off.gif");
			$("#rightSpan").removeClass("rightOn").hide();
	
			$('#click1').attr("src", "img/cntrl_dot_off.gif" );
			$('#click2').attr("src", "img/cntrl_dot_off.gif" );
			$('#click3').attr("src", "img/cntrl_dot_off.gif" );
			$('#click4').attr("src", "img/cntrl_dot_off.gif" );
			$('#click5').attr("src", "img/cntrl_dot_off.gif" );
			$('#click6').attr("src", "img/cntrl_dot_on.gif" );
	
			$('.l8bottle').show().animate({ left: '-=1490' }, 1);
			$('.l7bottle').show().animate({ left: '-=1360' }, 1);
			$('.l6bottle').show().animate({ left: '-=1262' }, 1);
			$('.l5bottle').show().animate({ left: '-=1168' }, 1);
			$('.l4bottle').show().animate({ left: '-=1096' }, 1);
			$('.l3bottle').show().animate({ left: '-=1094' }, 1);
	
		});
			jaaulde.utils.cookies.set('introValue', current, { hoursToLive: .5});		
	});
	}
}


$(document).ready(function() {
	$(".link").hover(
	  function () {
		this.src = this.src.replace("_link.png","_link_on.png");
	  }, 
	  function () {
		this.src = this.src.replace("_link_on.png","_link.png");
	  }
	);
});

function moveRight() {
	setTimeout("changeControls();", 1600);

	if ( current == "intro" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=690' }, 1500);
		$('#layer2').animate({ left: '-=560' }, 1500);
		$('#layer3').animate({ left: '-=462' }, 1500);
		$('#layer4').animate({ left: '-=368' }, 1500);
		$('#layer5').animate({ left: '-=296' }, 1500);
		$('#layer6').animate({ left: '-=239' }, 1500);
		$('#layer7').animate({ left: '-=180' }, 1500);
		$('#layer8').animate({ left: '-=128' }, 1500, function(){

			current = "2";
			inMotion = false;			
		});		
	}
	if ( current == "2" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=1380' }, 1500);
		$('#layer2').animate({ left: '-=1120' }, 1500);
		$('#layer3').animate({ left: '-=924' }, 1500);
		$('#layer4').animate({ left: '-=736' }, 1500);
		$('#layer5').animate({ left: '-=592' }, 1500);
		$('#layer6').animate({ left: '-=478' }, 1500);
		$('#layer7').animate({ left: '-=360' }, 1500);
		$('#layer8').animate({ left: '-=256' }, 1500, function(){

			current = "3";
			inMotion = false;
		});		
	}
	if ( current == "3" && inMotion == false ) {	
		inMotion = true;
		$('.f6Bg').hide();

		$('#layer1').animate({ left: '-=1380' }, 1500);
		$('#layer2').animate({ left: '-=1120' }, 1500);
		$('#layer3').animate({ left: '-=924' }, 1500);
		$('#layer4').animate({ left: '-=736' }, 1500);
		$('#layer5').animate({ left: '-=592' }, 1500);
		$('#layer6').animate({ left: '-=478' }, 1500);
		$('#layer7').animate({ left: '-=360' }, 1500);
		$('#layer8').animate({ left: '-=256' }, 1500, function(){

			current = "4";
			inMotion = false;
		});		
	}
	if ( current == "4" && inMotion == false ) {	
		inMotion = true;


		$('#layer1').animate({ left: '-=1380' }, 1500);
		$('#layer2').animate({ left: '-=1120' }, 1500);
		$('#layer3').animate({ left: '-=924' }, 1500);
		$('#layer4').animate({ left: '-=736' }, 1500);
		$('#layer5').animate({ left: '-=592' }, 1500);
		$('#layer6').animate({ left: '-=478' }, 1500);
		$('#layer7').animate({ left: '-=360' }, 1500);
		$('#layer8').animate({ left: '-=256' }, 1500, function(){

			current = "5";
			inMotion = false;
			$('.f6Bg').show();
		});		
	}
	if ( current == "5" && inMotion == false ) {	
		inMotion = true;

		$('.f6Bg').show();
		$('#layer1').animate({ left: '-=1380' }, 1500);
		$('#layer2').animate({ left: '-=1120' }, 1500);
		$('#layer3').animate({ left: '-=924' }, 1500);
		$('#layer4').animate({ left: '-=736' }, 1500);
		$('#layer5').animate({ left: '-=592' }, 1500);
		$('#layer6').animate({ left: '-=478' }, 1500);
		$('#layer7').animate({ left: '-=360' }, 1500);
		$('#layer8').animate({ left: '-=256' }, 1500, function(){

			current = "6";
			inMotion = false;
		});
		
	}
}



function moveLeft() {
	setTimeout("changeControls();", 1600);

	if ( current == "6" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=1380' }, 1500);
		$('#layer2').animate({ left: '+=1120' }, 1500);
		$('#layer3').animate({ left: '+=924' }, 1500);
		$('#layer4').animate({ left: '+=736' }, 1500);
		$('#layer5').animate({ left: '+=592' }, 1500);
		$('#layer6').animate({ left: '+=478' }, 1500);
		$('#layer7').animate({ left: '+=360' }, 1500);
		$('#layer8').animate({ left: '+=256' }, 1500, function(){

			current = "5";
			inMotion = false;
		});
	}
	if ( current == "5" && inMotion == false ) {	
		inMotion = true;
		$('.f6Bg').hide();

		$('#layer1').animate({ left: '+=1380' }, 1500);
		$('#layer2').animate({ left: '+=1120' }, 1500);
		$('#layer3').animate({ left: '+=924' }, 1500);
		$('#layer4').animate({ left: '+=736' }, 1500);
		$('#layer5').animate({ left: '+=592' }, 1500);
		$('#layer6').animate({ left: '+=478' }, 1500);
		$('#layer7').animate({ left: '+=360' }, 1500);
		$('#layer8').animate({ left: '+=256' }, 1500, function(){

			current = "4";
			inMotion = false;
		});
	}
	if ( current == "4" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=1380' }, 1500);
		$('#layer2').animate({ left: '+=1120' }, 1500);
		$('#layer3').animate({ left: '+=924' }, 1500);
		$('#layer4').animate({ left: '+=736' }, 1500);
		$('#layer5').animate({ left: '+=592' }, 1500);
		$('#layer6').animate({ left: '+=478' }, 1500);
		$('#layer7').animate({ left: '+=360' }, 1500);
		$('#layer8').animate({ left: '+=256' }, 1500, function(){

			current = "3";
			inMotion = false;
		});
	}
	if ( current == "3" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=1380' }, 1500);
		$('#layer2').animate({ left: '+=1120' }, 1500);
		$('#layer3').animate({ left: '+=924' }, 1500);
		$('#layer4').animate({ left: '+=736' }, 1500);
		$('#layer5').animate({ left: '+=592' }, 1500);
		$('#layer6').animate({ left: '+=478' }, 1500);
		$('#layer7').animate({ left: '+=360' }, 1500);
		$('#layer8').animate({ left: '+=256' }, 1500, function(){

			current = "2";
			inMotion = false;
		});
	}
	if ( current == "2" && inMotion == false ) {
		inMotion = true;
	
		$('#layer1').animate({ left: '+=690' }, 1500);
		$('#layer2').animate({ left: '+=560' }, 1500);
		$('#layer3').animate({ left: '+=462' }, 1500);
		$('#layer4').animate({ left: '+=368' }, 1500);
		$('#layer5').animate({ left: '+=296' }, 1500);
		$('#layer6').animate({ left: '+=239' }, 1500);
		$('#layer7').animate({ left: '+=180' }, 1500);
		$('#layer8').animate({ left: '+=128' }, 1500, function(){

			current = "intro";
			inMotion = false;
		});		
	}
}


$(document).ready(function() {

$('#click1').click(function() {
	setTimeout("$('.f6Bg').show();", 900);
	
	if ( current == "2" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=690' }, 1500);
		$('#layer2').animate({ left: '+=560' }, 1500);
		$('#layer3').animate({ left: '+=462' }, 1500);
		$('#layer4').animate({ left: '+=368' }, 1500);
		$('#layer5').animate({ left: '+=296' }, 1500);
		$('#layer6').animate({ left: '+=239' }, 1500);
		$('#layer7').animate({ left: '+=180' }, 1500);
		$('#layer8').animate({ left: '+=128' }, 1500, function(){

			current = "intro";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "3" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=2070' }, 1500);
		$('#layer2').animate({ left: '+=1680' }, 1500);
		$('#layer3').animate({ left: '+=1386' }, 1500);
		$('#layer4').animate({ left: '+=1104' }, 1500);
		$('#layer5').animate({ left: '+=888' }, 1500);
		$('#layer6').animate({ left: '+=717' }, 1500);
		$('#layer7').animate({ left: '+=540' }, 1500);
		$('#layer8').animate({ left: '+=384' }, 1500, function(){

			current = "intro";
			inMotion = false;
			changeControls();
		});		
	}
	if ( current == "4" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=3450' }, 1500);
		$('#layer2').animate({ left: '+=2800' }, 1500);
		$('#layer3').animate({ left: '+=2310' }, 1500);
		$('#layer4').animate({ left: '+=1840' }, 1500);
		$('#layer5').animate({ left: '+=1480' }, 1500);
		$('#layer6').animate({ left: '+=1195' }, 1500);
		$('#layer7').animate({ left: '+=900' }, 1500);
		$('#layer8').animate({ left: '+=640' }, 1500, function(){

			current = "intro";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "5" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=4830' }, 1500);
		$('#layer2').animate({ left: '+=3920' }, 1500);
		$('#layer3').animate({ left: '+=3234' }, 1500);
		$('#layer4').animate({ left: '+=2576' }, 1500);
		$('#layer5').animate({ left: '+=2072' }, 1500);
		$('#layer6').animate({ left: '+=1673' }, 1500);
		$('#layer7').animate({ left: '+=1260' }, 1500);
		$('#layer8').animate({ left: '+=896' }, 1500, function(){

			current = "intro";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "6" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=6210' }, 1500);
		$('#layer2').animate({ left: '+=5040' }, 1500);
		$('#layer3').animate({ left: '+=4158' }, 1500);
		$('#layer4').animate({ left: '+=3312' }, 1500);
		$('#layer5').animate({ left: '+=2664' }, 1500);
		$('#layer6').animate({ left: '+=2151' }, 1500);
		$('#layer7').animate({ left: '+=1620' }, 1500);
		$('#layer8').animate({ left: '+=1152' }, 1500, function(){

			current = "intro";
			inMotion = false;
			changeControls();
		});
	}
});

$('#click2').click(function() {
	setTimeout("$('.f6Bg').show();", 900);
	
	if ( current == "intro" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=690' }, 1500);
		$('#layer2').animate({ left: '-=560' }, 1500);
		$('#layer3').animate({ left: '-=462' }, 1500);
		$('#layer4').animate({ left: '-=368' }, 1500);
		$('#layer5').animate({ left: '-=296' }, 1500);
		$('#layer6').animate({ left: '-=239' }, 1500);
		$('#layer7').animate({ left: '-=180' }, 1500);
		$('#layer8').animate({ left: '-=128' }, 1500, function(){

			current = "2";
			inMotion = false;
			changeControls();
		});		
	}
	if ( current == "3" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=1380' }, 1500);
		$('#layer2').animate({ left: '+=1120' }, 1500);
		$('#layer3').animate({ left: '+=924' }, 1500);
		$('#layer4').animate({ left: '+=736' }, 1500);
		$('#layer5').animate({ left: '+=592' }, 1500);
		$('#layer6').animate({ left: '+=478' }, 1500);
		$('#layer7').animate({ left: '+=360' }, 1500);
		$('#layer8').animate({ left: '+=256' }, 1500, function(){

			current = "2";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "4" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=2760' }, 1500);
		$('#layer2').animate({ left: '+=2240' }, 1500);
		$('#layer3').animate({ left: '+=1848' }, 1500);
		$('#layer4').animate({ left: '+=1472' }, 1500);
		$('#layer5').animate({ left: '+=1184' }, 1500);
		$('#layer6').animate({ left: '+=956' }, 1500);
		$('#layer7').animate({ left: '+=720' }, 1500);
		$('#layer8').animate({ left: '+=512' }, 1500, function(){

			current = "2";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "5" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=4140' }, 1500);
		$('#layer2').animate({ left: '+=3360' }, 1500);
		$('#layer3').animate({ left: '+=2772' }, 1500);
		$('#layer4').animate({ left: '+=2208' }, 1500);
		$('#layer5').animate({ left: '+=1776' }, 1500);
		$('#layer6').animate({ left: '+=1434' }, 1500);
		$('#layer7').animate({ left: '+=1080' }, 1500);
		$('#layer8').animate({ left: '+=768' }, 1500, function(){

			current = "2";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "6" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=5520' }, 1500);
		$('#layer2').animate({ left: '+=4480' }, 1500);
		$('#layer3').animate({ left: '+=3696' }, 1500);
		$('#layer4').animate({ left: '+=2944' }, 1500);
		$('#layer5').animate({ left: '+=2368' }, 1500);
		$('#layer6').animate({ left: '+=1912' }, 1500);
		$('#layer7').animate({ left: '+=1440' }, 1500);
		$('#layer8').animate({ left: '+=1024' }, 1500, function(){

			current = "2";
			inMotion = false;
			changeControls();
		});
	}
});

$('#click3').click(function() {
	setTimeout("$('.f6Bg').show();", 900);	

	if ( current == "intro" && inMotion == false ) {
		inMotion = true;
	
		$('#layer1').animate({ left: '-=2070' }, 1500);
		$('#layer2').animate({ left: '-=1680' }, 1500);
		$('#layer3').animate({ left: '-=1386' }, 1500);
		$('#layer4').animate({ left: '-=1104' }, 1500);
		$('#layer5').animate({ left: '-=888' }, 1500);
		$('#layer6').animate({ left: '-=717' }, 1500);
		$('#layer7').animate({ left: '-=540' }, 1500);
		$('#layer8').animate({ left: '-=384' }, 1500, function(){
	
			current = "3";
			inMotion = false;
			changeControls();
		});			
	}
	if ( current == "2" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=1380' }, 1500);
		$('#layer2').animate({ left: '-=1120' }, 1500);
		$('#layer3').animate({ left: '-=924' }, 1500);
		$('#layer4').animate({ left: '-=736' }, 1500);
		$('#layer5').animate({ left: '-=592' }, 1500);
		$('#layer6').animate({ left: '-=478' }, 1500);
		$('#layer7').animate({ left: '-=360' }, 1500);
		$('#layer8').animate({ left: '-=256' }, 1500, function(){

			current = "3";
			inMotion = false;
			changeControls();
		});		
	}
	if ( current == "4" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=1380' }, 1500);
		$('#layer2').animate({ left: '+=1120' }, 1500);
		$('#layer3').animate({ left: '+=924' }, 1500);
		$('#layer4').animate({ left: '+=736' }, 1500);
		$('#layer5').animate({ left: '+=592' }, 1500);
		$('#layer6').animate({ left: '+=478' }, 1500);
		$('#layer7').animate({ left: '+=360' }, 1500);
		$('#layer8').animate({ left: '+=256' }, 1500, function(){

			current = "3";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "5" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=2760' }, 1500);
		$('#layer2').animate({ left: '+=2240' }, 1500);
		$('#layer3').animate({ left: '+=1848' }, 1500);
		$('#layer4').animate({ left: '+=1472' }, 1500);
		$('#layer5').animate({ left: '+=1184' }, 1500);
		$('#layer6').animate({ left: '+=956' }, 1500);
		$('#layer7').animate({ left: '+=720' }, 1500);
		$('#layer8').animate({ left: '+=512' }, 1500, function(){

			current = "3";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "6" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=4140' }, 1500);
		$('#layer2').animate({ left: '+=3360' }, 1500);
		$('#layer3').animate({ left: '+=2772' }, 1500);
		$('#layer4').animate({ left: '+=2208' }, 1500);
		$('#layer5').animate({ left: '+=1776' }, 1500);
		$('#layer6').animate({ left: '+=1434' }, 1500);
		$('#layer7').animate({ left: '+=1080' }, 1500);
		$('#layer8').animate({ left: '+=768' }, 1500, function(){

			current = "3";
			inMotion = false;
			changeControls();
		});
	}
});

$('#click4').click(function() {
	setTimeout("$('.f6Bg').hide();", 500);
	
	if ( current == "intro" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=3450' }, 1500);
		$('#layer2').animate({ left: '-=2800' }, 1500);
		$('#layer3').animate({ left: '-=2310' }, 1500);
		$('#layer4').animate({ left: '-=1840' }, 1500);
		$('#layer5').animate({ left: '-=1480' }, 1500);
		$('#layer6').animate({ left: '-=1195' }, 1500);
		$('#layer7').animate({ left: '-=900' }, 1500);
		$('#layer8').animate({ left: '-=640' }, 1500, function(){

			current = "4";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "2" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=2760' }, 1500);
		$('#layer2').animate({ left: '-=2240' }, 1500);
		$('#layer3').animate({ left: '-=1848' }, 1500);
		$('#layer4').animate({ left: '-=1472' }, 1500);
		$('#layer5').animate({ left: '-=1184' }, 1500);
		$('#layer6').animate({ left: '-=956' }, 1500);
		$('#layer7').animate({ left: '-=720' }, 1500);
		$('#layer8').animate({ left: '-=512' }, 1500, function(){

			current = "4";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "3" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=1380' }, 1500);
		$('#layer2').animate({ left: '-=1120' }, 1500);
		$('#layer3').animate({ left: '-=924' }, 1500);
		$('#layer4').animate({ left: '-=736' }, 1500);
		$('#layer5').animate({ left: '-=592' }, 1500);
		$('#layer6').animate({ left: '-=478' }, 1500);
		$('#layer7').animate({ left: '-=360' }, 1500);
		$('#layer8').animate({ left: '-=256' }, 1500, function(){

			current = "4";
			inMotion = false;
			changeControls();
		});		
	}
	if ( current == "5" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=1380' }, 1500);
		$('#layer2').animate({ left: '+=1120' }, 1500);
		$('#layer3').animate({ left: '+=924' }, 1500);
		$('#layer4').animate({ left: '+=736' }, 1500);
		$('#layer5').animate({ left: '+=592' }, 1500);
		$('#layer6').animate({ left: '+=478' }, 1500);
		$('#layer7').animate({ left: '+=360' }, 1500);
		$('#layer8').animate({ left: '+=256' }, 1500, function(){

			current = "4";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "6" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=2760' }, 1500);
		$('#layer2').animate({ left: '+=2240' }, 1500);
		$('#layer3').animate({ left: '+=1848' }, 1500);
		$('#layer4').animate({ left: '+=1472' }, 1500);
		$('#layer5').animate({ left: '+=1184' }, 1500);
		$('#layer6').animate({ left: '+=956' }, 1500);
		$('#layer7').animate({ left: '+=720' }, 1500);
		$('#layer8').animate({ left: '+=512' }, 1500, function(){

			current = "4";
			inMotion = false;
			changeControls();
		});
	}
});

$('#click5').click(function() {
	setTimeout("$('.f6Bg').show();", 900);
	
	if ( current == "intro" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=4830' }, 1500);
		$('#layer2').animate({ left: '-=3920' }, 1500);
		$('#layer3').animate({ left: '-=3234' }, 1500);
		$('#layer4').animate({ left: '-=2576' }, 1500);
		$('#layer5').animate({ left: '-=2072' }, 1500);
		$('#layer6').animate({ left: '-=1673' }, 1500);
		$('#layer7').animate({ left: '-=1260' }, 1500);
		$('#layer8').animate({ left: '-=896' }, 1500, function(){

			current = "5";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "2" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=4140' }, 1500);
		$('#layer2').animate({ left: '-=3360' }, 1500);
		$('#layer3').animate({ left: '-=2772' }, 1500);
		$('#layer4').animate({ left: '-=2208' }, 1500);
		$('#layer5').animate({ left: '-=1776' }, 1500);
		$('#layer6').animate({ left: '-=1434' }, 1500);
		$('#layer7').animate({ left: '-=1080' }, 1500);
		$('#layer8').animate({ left: '-=768' }, 1500, function(){

			current = "5";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "3" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=2760' }, 1500);
		$('#layer2').animate({ left: '-=2240' }, 1500);
		$('#layer3').animate({ left: '-=1848' }, 1500);
		$('#layer4').animate({ left: '-=1472' }, 1500);
		$('#layer5').animate({ left: '-=1184' }, 1500);
		$('#layer6').animate({ left: '-=956' }, 1500);
		$('#layer7').animate({ left: '-=720' }, 1500);
		$('#layer8').animate({ left: '-=512' }, 1500, function(){

			current = "5";
			inMotion = false;
			changeControls();
		});		
	}
	if ( current == "4" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=1380' }, 1500);
		$('#layer2').animate({ left: '-=1120' }, 1500);
		$('#layer3').animate({ left: '-=924' }, 1500);
		$('#layer4').animate({ left: '-=736' }, 1500);
		$('#layer5').animate({ left: '-=592' }, 1500);
		$('#layer6').animate({ left: '-=478' }, 1500);
		$('#layer7').animate({ left: '-=360' }, 1500);
		$('#layer8').animate({ left: '-=256' }, 1500, function(){

			current = "5";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "6" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '+=1380' }, 1500);
		$('#layer2').animate({ left: '+=1120' }, 1500);
		$('#layer3').animate({ left: '+=924' }, 1500);
		$('#layer4').animate({ left: '+=736' }, 1500);
		$('#layer5').animate({ left: '+=592' }, 1500);
		$('#layer6').animate({ left: '+=478' }, 1500);
		$('#layer7').animate({ left: '+=360' }, 1500);
		$('#layer8').animate({ left: '+=256' }, 1500, function(){

			current = "5";
			inMotion = false;
			changeControls();
		});
	}
});

$('#click6').click(function() {
	setTimeout("$('.f6Bg').show();", 900);
	
	if ( current == "intro" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=6210' }, 1500);
		$('#layer2').animate({ left: '-=5040' }, 1500);
		$('#layer3').animate({ left: '-=4158' }, 1500);
		$('#layer4').animate({ left: '-=3312' }, 1500);
		$('#layer5').animate({ left: '-=2664' }, 1500);
		$('#layer6').animate({ left: '-=2151' }, 1500);
		$('#layer7').animate({ left: '-=1620' }, 1500);
		$('#layer8').animate({ left: '-=1152' }, 1500, function(){

			current = "6";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "2" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=5520' }, 1500);
		$('#layer2').animate({ left: '-=4480' }, 1500);
		$('#layer3').animate({ left: '-=3696' }, 1500);
		$('#layer4').animate({ left: '-=2944' }, 1500);
		$('#layer5').animate({ left: '-=2368' }, 1500);
		$('#layer6').animate({ left: '-=1912' }, 1500);
		$('#layer7').animate({ left: '-=1440' }, 1500);
		$('#layer8').animate({ left: '-=1024' }, 1500, function(){

			current = "6";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "3" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=4140' }, 1500);
		$('#layer2').animate({ left: '-=3360' }, 1500);
		$('#layer3').animate({ left: '-=2772' }, 1500);
		$('#layer4').animate({ left: '-=2208' }, 1500);
		$('#layer5').animate({ left: '-=1776' }, 1500);
		$('#layer6').animate({ left: '-=1434' }, 1500);
		$('#layer7').animate({ left: '-=1080' }, 1500);
		$('#layer8').animate({ left: '-=768' }, 1500, function(){

			current = "6";
			inMotion = false;
			changeControls();
		});		
	}
	if ( current == "4" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=2760' }, 1500);
		$('#layer2').animate({ left: '-=2240' }, 1500);
		$('#layer3').animate({ left: '-=1848' }, 1500);
		$('#layer4').animate({ left: '-=1472' }, 1500);
		$('#layer5').animate({ left: '-=1184' }, 1500);
		$('#layer6').animate({ left: '-=956' }, 1500);
		$('#layer7').animate({ left: '-=720' }, 1500);
		$('#layer8').animate({ left: '-=512' }, 1500, function(){

			current = "6";
			inMotion = false;
			changeControls();
		});
	}
	if ( current == "5" && inMotion == false ) {	
		inMotion = true;

		$('#layer1').animate({ left: '-=1380' }, 1500);
		$('#layer2').animate({ left: '-=1120' }, 1500);
		$('#layer3').animate({ left: '-=924' }, 1500);
		$('#layer4').animate({ left: '-=736' }, 1500);
		$('#layer5').animate({ left: '-=592' }, 1500);
		$('#layer6').animate({ left: '-=478' }, 1500);
		$('#layer7').animate({ left: '-=360' }, 1500);
		$('#layer8').animate({ left: '-=256' }, 1500, function(){

			current = "6";
			inMotion = false;
			changeControls();
		});
	}
});

});

function changeControls() {
	if (current == "intro" && inMotion == false ) {
		$("#leftArrow").attr("src", "img/cntrl_arrow_left_off.gif");
		$("#leftSpan").removeClass("leftOn").hide();
		$("#rightArrow").attr("src", "img/cntrl_arrow_right_on.gif");
		$("#rightSpan").addClass("rightOn");

		$('#click1').attr("src", "img/cntrl_dot_on.gif" );
		$('#click2').attr("src", "img/cntrl_dot_off.gif" );
		$('#click3').attr("src", "img/cntrl_dot_off.gif" );
		$('#click4').attr("src", "img/cntrl_dot_off.gif" );
		$('#click5').attr("src", "img/cntrl_dot_off.gif" );
		$('#click6').attr("src", "img/cntrl_dot_off.gif" );
	}
	if (current == "2" && inMotion == false ) {
		$("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
		$("#leftSpan").addClass("leftOn");
		$("#rightArrow").attr("src", "img/cntrl_arrow_right_on.gif");
		$("#rightSpan").addClass("rightOn");

		$('#click1').attr("src", "img/cntrl_dot_off.gif" );
		$('#click2').attr("src", "img/cntrl_dot_on.gif" );
		$('#click3').attr("src", "img/cntrl_dot_off.gif" );
		$('#click4').attr("src", "img/cntrl_dot_off.gif" );
		$('#click5').attr("src", "img/cntrl_dot_off.gif" );
		$('#click6').attr("src", "img/cntrl_dot_off.gif" );
	}
	if (current == "3" && inMotion == false ) {
		$("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
		$("#leftSpan").addClass("leftOn");
		$("#rightArrow").attr("src", "img/cntrl_arrow_right_on.gif");
		$("#rightSpan").addClass("rightOn");

		$('#click1').attr("src", "img/cntrl_dot_off.gif" );
		$('#click2').attr("src", "img/cntrl_dot_off.gif" );
		$('#click3').attr("src", "img/cntrl_dot_on.gif" );
		$('#click4').attr("src", "img/cntrl_dot_off.gif" );
		$('#click5').attr("src", "img/cntrl_dot_off.gif" );
		$('#click6').attr("src", "img/cntrl_dot_off.gif" );
	}
	if (current == "4" && inMotion == false ) {
		$("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
		$("#leftSpan").addClass("leftOn");
		$("#rightArrow").attr("src", "img/cntrl_arrow_right_on.gif");
		$("#rightSpan").addClass("rightOn");

		$('#click1').attr("src", "img/cntrl_dot_off.gif" );
		$('#click2').attr("src", "img/cntrl_dot_off.gif" );
		$('#click3').attr("src", "img/cntrl_dot_off.gif" );
		$('#click4').attr("src", "img/cntrl_dot_on.gif" );
		$('#click5').attr("src", "img/cntrl_dot_off.gif" );
		$('#click6').attr("src", "img/cntrl_dot_off.gif" );
	}
	if (current == "5" && inMotion == false ) {
		$("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
		$("#leftSpan").addClass("leftOn");
		$("#rightArrow").attr("src", "img/cntrl_arrow_right_on.gif");
		$("#rightSpan").addClass("rightOn");

		$('#click1').attr("src", "img/cntrl_dot_off.gif" );
		$('#click2').attr("src", "img/cntrl_dot_off.gif" );
		$('#click3').attr("src", "img/cntrl_dot_off.gif" );
		$('#click4').attr("src", "img/cntrl_dot_off.gif" );
		$('#click5').attr("src", "img/cntrl_dot_on.gif" );
		$('#click6').attr("src", "img/cntrl_dot_off.gif" );
	}
	if (current == "6" && inMotion == false ) {
		$("#leftArrow").attr("src", "img/cntrl_arrow_left_on.gif");
		$("#leftSpan").addClass("leftOn");
		$("#rightArrow").attr("src", "img/cntrl_arrow_right_off.gif");
		$("#rightSpan").removeClass("rightOn").hide();

		$('#click1').attr("src", "img/cntrl_dot_off.gif" );
		$('#click2').attr("src", "img/cntrl_dot_off.gif" );
		$('#click3').attr("src", "img/cntrl_dot_off.gif" );
		$('#click4').attr("src", "img/cntrl_dot_off.gif" );
		$('#click5').attr("src", "img/cntrl_dot_off.gif" );
		$('#click6').attr("src", "img/cntrl_dot_on.gif" );
	}
}

// authored by Winnthrop Maass @ Methodologie
