$(document).ready(function() { 

	$('#header-nav').localScroll({
		easing:'easeInOutQuad',
		offset: {top:-100},
		duration: 1500,
		hash:true
	});
	$.localScroll.hash();

(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)

	jQuery.preLoadImages(
		 "2011/images/lp_pitch_530.jpg",
		 "2011/images/lp_pitch_armada.jpg",
		 "2011/images/lp_pitch_cortez.jpg",
		 "2011/images/lp_pitch_cydwoq.jpg",
		 "2011/images/lp_pitch_globe.jpg",
		 "2011/images/lp_pitch_idroyal.jpg",
		 "2011/images/lp_pitch_kotr.jpg",
		 "2011/images/lp_pitch_acg.jpg",
		 "2011/images/lp_pitch_lrg.jpg",
		 "2011/images/lp_pitch_mahfia.jpg",
		 "2011/images/lp_pitch_makesomething.jpg",
		 "2011/images/lp_pitch_mississippi.jpg",
		 "2011/images/lp_pitch_mosley.jpg",
		 "2011/images/lp_pitch_publiclabel.jpg",
		 "2011/images/lp_pitch_rivi.jpg",
		 "2011/images/lp_pitch_virtualdecorator.jpg"
	);


	var $window		= $(window);
	var $header		= $('#header');
	var $whoBG		= $('#who-we-are');
	var $contactBG		= $('#contact');
	
	var $work1BG	= $('#work1');
	   var work1Img 	= $('#work1 .work-image');
	   var work1Player  = $('#work1 #work-player');
	var $work2BG 	= $('#work2');
       var work2Img 	= $('#work2 .work-image');
	   var work2Player  = $('#work2 #work-player');
	var $work3BG	= $('#work3');
	   var work3Img 	= $('#work3 .work-image');
	   var work3Player  = $('#work3 #work-player');
	var $work4BG	= $('#work4');
	   var work4Img 	= $('#work4 .work-image');
	   var work4Player  = $('#work4 #work-player');
	var $work5BG	= $('#work5');
	   var work5Img 	= $('#work5 .work-image');
	   var work5Player  = $('#work5 #work-player');
	var $work6BG	= $('#work6');
	   var work6Img 	= $('#work6 .work-image');
	   var work6Player  = $('#work6 #work-player');
	var $work7BG	= $('#work7');
	   var work7Img 	= $('#work7 .work-image');
	   var work7Player  = $('#work7 #work-player');
	var $work8BG	= $('#work8');
	   var work8Img 	= $('#work8 .work-image');
	   var work8Player  = $('#work8 #work-player');
	var $work9BG 	= $('#work9');
       var work9Img 	= $('#work9 .work-image');
	   var work9Player  = $('#work9 #work-player');
	var $work10BG	= $('#work10');
	   var work10Img 	= $('#work10 .work-image');
	   var work10Player  = $('#work10 #work-player');
	var $work11BG	= $('#work11');
	   var work11Img 	= $('#work11 .work-image');
	   var work11Player  = $('#work11 #work-player');
	var $work12BG	= $('#work12');
	   var work12Img 	= $('#work12 .work-image');
	   var work12Player  = $('#work12 #work-player');
	var $work13BG	= $('#work13');
	   var work13Img 	= $('#work13 .work-image');
	   var work13Player  = $('#work13 #work-player');
	var $work14BG	= $('#work14');
	   var work14Img 	= $('#work14 .work-image');
	   var work14Player  = $('#work14 #work-player');
	var $work15BG	= $('#work15');
	   var work15Img 	= $('#work15 .work-image');
	   var work15Player  = $('#work15 #work-player');

	var windowHeight = $window.height(); 
	
	
	//apply the class "inview" to a section that is in the viewport
	$('#who-we-are, #contact, #work1, #work2, #work3, #work4, #work5, #work6, #work7, #work8, #work9, #work10, #work11, #work12, #work13, #work14, #work15').bind('inview', function (event, visible) {
		if (visible == true) {
			$(this).addClass("inview");
		} else {
			$(this).removeClass("inview");
		}
	});
	
	
	//function that is called for every pixel the user scrolls. Determines the position of the background
	/*arguments: 
		x = horizontal position of background
		windowHeight = height of the viewport
		pos = position of the scrollbar
		adjuster = adjust the position of the background
		inertia = how fast the background moves in relation to scrolling
	*/
	function newPos(x, windowHeight, pos, adjuster, inertia){
		return x + "% " + (-((windowHeight + pos) - adjuster) * inertia)  + "px";
	}
	function imagePos(windowHeight, pos, adjuster, inertia){
		return (-((windowHeight + pos) - adjuster) * inertia)  + "px";
	}
	
	//function to be called whenever the window is scrolled or resized
	function Move(){ 
		var pos = $window.scrollTop(); //position of the scrollbar
		//$('#header-text2').html(windowHeight);
		//numbers for testing
		//$('#header-text2').html(pos);
		
		//if the first section is in view...
		/*if($whyBG.hasClass("inview")){
			//call the newPos function and change the background position
			$whyBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 600, 0.3)});
		}*/
		
		if($whoBG.hasClass("inview")){
			$whoBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 600, 0.3)});
		}
		
		if($contactBG.hasClass("inview")){
			$contactBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 950, 0.3)});
		}
		
		if($work1BG.hasClass("inview")){
			$work1BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 1295, 0.3)});
			
			//Activate slide down animation for work image
			var work1OS= $work1BG.offset();
			if (pos < (work1OS.top - 100)){
				work1Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work1OS.top - 100) && pos < 880){
				work1Img.stop(true).animate({'margin-top': imagePos(716, pos, 1295, -1)}); 
			} else if (pos > 880) {
				work1Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work2BG.hasClass("inview")){
			$work2BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 2295, 0.3)});
			
			//Activate slide down animation for work image
			var work2OS= $work2BG.offset();
			if (pos < (work2OS.top - 100)){
				work2Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work2OS.top - 100) && pos < 1480){
				work2Img.stop(true).animate({'margin-top': imagePos(716, pos, 1890, -1)}); 
			} else if (pos > 1480) {
				work2Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work3BG.hasClass("inview")){
			$work3BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 2895, 0.3)});
			
			//Activate slide down animation for work image
			var work3OS= $work3BG.offset();
			if (pos < (work3OS.top - 100)){
				work3Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work3OS.top - 100) && pos < 2080){
				work3Img.stop(true).animate({'margin-top': imagePos(716, pos, 2485, -1)}); 
			} else if (pos > 2080) {
				work3Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work4BG.hasClass("inview")){
			$work4BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 3495, 0.3)});
			
			//Activate slide down animation for work image
			var work4OS= $work4BG.offset();
			if (pos < (work4OS.top - 100)){
				work4Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work4OS.top - 100) && pos < 2680){
				work4Img.stop(true).animate({'margin-top': imagePos(716, pos, 3080, -1)}); 
			} else if (pos > 2680) {
				work4Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work5BG.hasClass("inview")){
			$work5BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 4165, 0.3)});
			
			//Activate slide down animation for work image
			var work5OS= $work5BG.offset();
			if (pos < (work5OS.top - 100)){
				work5Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work5OS.top - 100) && pos < 3280){
				work5Img.stop(true).animate({'margin-top': imagePos(716, pos, 3675, -1)}); 
			} else if (pos > 3280) {
				work5Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work6BG.hasClass("inview")){
			$work6BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 4785, 0.3)});
			
			//Activate slide down animation for work image
			var work6OS= $work6BG.offset();
			if (pos < (work6OS.top - 100)){
				work6Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work6OS.top - 100) && pos < 3880){
				work6Img.stop(true).animate({'margin-top': imagePos(716, pos, 4270, -1)}); 
			} else if (pos > 3880) {
				work6Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work7BG.hasClass("inview")){
			$work7BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 5385, 0.3)});
			
			//Activate slide down animation for work image
			var work7OS= $work7BG.offset();
			if (pos < (work7OS.top - 100)){
				work7Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work7OS.top - 100) && pos < 4480){
				work7Img.stop(true).animate({'margin-top': imagePos(716, pos, 4865, -1)}); 
			} else if (pos > 4480) {
				work7Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work8BG.hasClass("inview")){
			$work8BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 5985, 0.3)});
			
			//Activate slide down animation for work image
			var work8OS= $work8BG.offset();
			if (pos < (work8OS.top - 100)){
				work8Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work8OS.top - 100) && pos < 5080){
				work8Img.stop(true).animate({'margin-top': imagePos(716, pos, 5460, -1)}); 
			} else if (pos > 5080) {
				work8Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work9BG.hasClass("inview")){
			$work9BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 6585, 0.3)});
			
			//Activate slide down animation for work image
			var work9OS= $work9BG.offset();
			if (pos < (work9OS.top - 100)){
				work9Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work9OS.top - 100) && pos < 5680){
				work9Img.stop(true).animate({'margin-top': imagePos(716, pos, 6055, -1)}); 
			} else if (pos > 5680) {
				work9Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work10BG.hasClass("inview")){
			$work10BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 7185, 0.3)});
			
			//Activate slide down animation for work image
			var work10OS= $work10BG.offset();
			if (pos < (work10OS.top - 100)){
				work10Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work10OS.top - 100) && pos < 6280){
				work10Img.stop(true).animate({'margin-top': imagePos(716, pos, 6650, -1)}); 
			} else if (pos > 6280) {
				work10Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work11BG.hasClass("inview")){
			$work11BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 7765, 0.3)});
			
			//Activate slide down animation for work image
			var work11OS= $work11BG.offset();
			if (pos < (work11OS.top - 100)){
				work11Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work11OS.top - 100) && pos < 6880){
				work11Img.stop(true).animate({'margin-top': imagePos(716, pos, 7245, -1)}); 
			} else if (pos > 6880) {
				work11Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work12BG.hasClass("inview")){
			$work12BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 8365, 0.3)});
			
			//Activate slide down animation for work image
			var work12OS= $work12BG.offset();
			if (pos < (work12OS.top - 100)){
				work12Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work12OS.top - 100) && pos < 7480){
				work12Img.stop(true).animate({'margin-top': imagePos(716, pos, 7840, -1)}); 
			} else if (pos > 7480) {
				work12Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work13BG.hasClass("inview")){
			$work13BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 8965, 0.3)});
			
			//Activate slide down animation for work image
			var work13OS= $work13BG.offset();
			if (pos < (work13OS.top - 100)){
				work13Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work13OS.top - 100) && pos < 8080){
				work13Img.stop(true).animate({'margin-top': imagePos(716, pos, 8435, -1)}); 
			} else if (pos > 8080) {
				work13Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work14BG.hasClass("inview")){
			$work14BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 9575, 0.3)});
			
			//Activate slide down animation for work image
			var work14OS= $work14BG.offset();
			if (pos < (work14OS.top - 100)){
				work14Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work14OS.top - 100) && pos < 8680){
				work14Img.stop(true).animate({'margin-top': imagePos(716, pos, 9030, -1)}); 
			} else if (pos > 8680) {
				work14Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
		
		if($work15BG.hasClass("inview")){
			$work15BG.css({'backgroundPosition': newPos(50, windowHeight, pos, 9785, 0.3)});
			
			//Activate slide down animation for work image
			var work15OS= $work15BG.offset();
			if (pos < (work15OS.top - 100)){
				work15Img.stop(true).animate({'margin-top': '44px'}); 
			} else if (pos > (work15OS.top - 100) && pos < 9280){
				work15Img.stop(true).animate({'margin-top': imagePos(716, pos, 9625, -1)}); 
			} else if (pos > 9280) {
				work15Img.stop(true).animate({'margin-top': '266px'}); 
			}
		}
	}
	
	$window.resize(function(){ //if the user resizes the window...
		Move(); //move the background images in relation to the movement of the scrollbar
		//windowHeight = $window.height(); 
		//$('#header-text2').html(windowHeight);

	});		
	
	$window.bind('scroll', function(){ //when the user is scrolling...
		Move(); //move the background images in relation to the movement of the scrollbar
	});
	
	
	//Work Player 1
	$('#work1 .work-image a').click(function(){
			$.scrollTo('620','slow', { onAfter:function(){ 
				work1Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work1 #work-player span').fadeIn();
				}); 
			} 
		});	
	});
	work1Player.click(function(){
		$('#work1 #work-player span').fadeOut(function(){
			work1Player.slideUp('slow', 'easeInOutQuart');;
		});
	});
	
	//Work Player 2
	$('#work2 .work-image a').click(function(){
			$.scrollTo('1220','slow', { onAfter:function(){ 
				work2Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work2 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work2Player.click(function(){
		$('#work2 #work-player span').fadeOut(function(){
			work2Player.slideUp('slow', 'easeInOutQuart');;
		});
	});
	
	//Work Player 3
	$('#work3 .work-image a').click(function(){
			$.scrollTo('1820','slow', { onAfter:function(){ 
				work3Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work3 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work3Player.click(function(){
		$('#work3 #work-player span').fadeOut(function(){
			work3Player.slideUp('slow', 'easeInOutQuart');;
		});
	});
	
	//Work Player 4
	$('#work4 .work-image a').click(function(){
			$.scrollTo('2420','slow', { onAfter:function(){ 
				work4Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work4 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work4Player.click(function(){
		$('#work4 #work-player span').fadeOut(function(){
			work4Player.slideUp('slow', 'easeInOutQuart');;
		});
	});
	
		//Work Player 5
	$('#work5 .work-image a').click(function(){
			$.scrollTo('3020','slow', { onAfter:function(){ 
				work5Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work5 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work5Player.click(function(){
		$('#work5 #work-player span').fadeOut(function(){
			work5Player.slideUp('slow', 'easeInOutQuart');;
		});
	});
	
		//Work Player 6
	$('#work6 .work-image a').click(function(){
			$.scrollTo('3620','slow', { onAfter:function(){ 
				work6Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work6 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work6Player.click(function(){
		$('#work6 #work-player span').fadeOut(function(){
			work6Player.slideUp('slow', 'easeInOutQuart');;
		});
	});
	
		//Work Player 7
	$('#work7 .work-image a').click(function(){
			$.scrollTo('4220','slow', { onAfter:function(){ 
				work7Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work7 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work7Player.click(function(){
		$('#work7 #work-player span').fadeOut(function(){
			work7Player.slideUp('slow', 'easeInOutQuart');;
		});
	});	
	
		//Work Player 8
	$('#work8 .work-image a').click(function(){
			$.scrollTo('4820','slow', { onAfter:function(){ 
				work8Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work8 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work8Player.click(function(){
		$('#work8 #work-player span').fadeOut(function(){
			work8Player.slideUp('slow', 'easeInOutQuart');;
		});
	});	
	
		//Work Player 9
	$('#work9 .work-image a').click(function(){
			$.scrollTo('5420','slow', { onAfter:function(){ 
				work9Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work9 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work9Player.click(function(){
		$('#work9 #work-player span').fadeOut(function(){
			work9Player.slideUp('slow', 'easeInOutQuart');;
		});
	});	
	
		//Work Player 10
	$('#work10 .work-image a').click(function(){
			$.scrollTo('6020','slow', { onAfter:function(){ 
				work10Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work10 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work10Player.click(function(){
		$('#work10 #work-player span').fadeOut(function(){
			work10Player.slideUp('slow', 'easeInOutQuart');;
		});
	});	
	
		//Work Player 11
	$('#work11 .work-image a').click(function(){
			$.scrollTo('6620','slow', { onAfter:function(){ 
				work11Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work11 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work11Player.click(function(){
		$('#work11 #work-player span').fadeOut(function(){
			work11Player.slideUp('slow', 'easeInOutQuart');;
		});
	});	
	
		//Work Player 12
	$('#work12 .work-image a').click(function(){
			$.scrollTo('7220','slow', { onAfter:function(){ 
				work12Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work12 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work12Player.click(function(){
		$('#work12 #work-player span').fadeOut(function(){
			work12Player.slideUp('slow', 'easeInOutQuart');;
		});
	});	
	
		//Work Player 13
	$('#work13 .work-image a').click(function(){
			$.scrollTo('7820','slow', { onAfter:function(){ 
				work13Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work13 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work13Player.click(function(){
		$('#work13 #work-player span').fadeOut(function(){
			work13Player.slideUp('slow', 'easeInOutQuart');;
		});
	});	
	
		//Work Player 14
	$('#work14 .work-image a').click(function(){
			$.scrollTo('8420','slow', { onAfter:function(){ 
				work14Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work14 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work14Player.click(function(){
		$('#work14 #work-player span').fadeOut(function(){
			work14Player.slideUp('slow', 'easeInOutQuart');;
		});
	});	
	
		//Work Player 15
	$('#work15 .work-image a').click(function(){
			$.scrollTo('9020','slow', { onAfter:function(){ 
				work15Player.slideDown('slow', 'easeInOutQuart', function(){
					$('#work15 #work-player span').fadeIn();
				}); 
			} 
		});	
	});	
	work15Player.click(function(){
		$('#work15 #work-player span').fadeOut(function(){
			work15Player.slideUp('slow', 'easeInOutQuart');;
		});
	});	
		
	/* Pagination Arrows*/
	
		$('#arrow-top a').click(function() {
		var pos = $window.scrollTop(); //position of the scrollbar
		if( parseInt(pos) >= 0 && parseInt(pos) <= 620 ){
			$.scrollTo(0, 800, {axis:'y'});
		} else if(parseInt(pos) > 620 && parseInt(pos) <= 1220 ){
			$.scrollTo(620, 800, {axis:'y'});
		} else if(parseInt(pos) > 1220 && parseInt(pos) <= 1820 ){
			$.scrollTo(1220, 800, {axis:'y'});
		} else if(parseInt(pos) > 1820 && parseInt(pos) <= 2420 ){
			$.scrollTo(1820, 800, {axis:'y'});
		} else if(parseInt(pos) > 2420 && parseInt(pos) <= 3020 ){
			$.scrollTo(2420, 800, {axis:'y'});
		} else if(parseInt(pos) > 3020 && parseInt(pos) <= 3620 ){
			$.scrollTo(3020, 800, {axis:'y'});
		} else if(parseInt(pos) > 3620 && parseInt(pos) <= 4220 ){
			$.scrollTo(3620, 800, {axis:'y'});
		} else if(parseInt(pos) > 4220 && parseInt(pos) <= 4820 ){
			$.scrollTo(4220, 800, {axis:'y'});
		} else if(parseInt(pos) > 4820 && parseInt(pos) <= 5420 ){
			$.scrollTo(4820, 800, {axis:'y'});
		} else if(parseInt(pos) > 5420 && parseInt(pos) <= 6020 ){
			$.scrollTo(5420, 800, {axis:'y'});
		} else if(parseInt(pos) > 6020 && parseInt(pos) <= 6620 ){
			$.scrollTo(6020, 800, {axis:'y'});
		} else if(parseInt(pos) > 6620 && parseInt(pos) <= 7220 ){
			$.scrollTo(6620, 800, {axis:'y'});
		} else if(parseInt(pos) > 7220 && parseInt(pos) <= 7820 ){
			$.scrollTo(7220, 800, {axis:'y'});
		} else if(parseInt(pos) > 7820 && parseInt(pos) <= 8420 ){
			$.scrollTo(7820, 800, {axis:'y'});
		} else if(parseInt(pos) > 8420 && parseInt(pos) <= 9020 ){
			$.scrollTo(8420, 800, {axis:'y'});
		} else if(parseInt(pos) > 9020 && parseInt(pos) <= 9620 ){
			$.scrollTo(9020, 800, {axis:'y'});
		} else if(parseInt(pos) > 9620 && parseInt(pos) <= 10220 ){
			$.scrollTo(9620, 800, {axis:'y'});
		}
		
		return false;
			
		});	
	
	$('#arrow-bottom a').click(function() {
		var pos = $window.scrollTop(); //position of the scrollbar
		if( parseInt(pos) >= 0 && parseInt(pos) < 620 ){
			$.scrollTo(620, 800, {axis:'y'});
		} else if(parseInt(pos) >= 620 && parseInt(pos) < 1220 ){
			$.scrollTo(1220, 800, {axis:'y'});
		} else if(parseInt(pos) >= 1220 && parseInt(pos) < 1820 ){
			$.scrollTo(1820, 800, {axis:'y'});
		} else if(parseInt(pos) >= 1820 && parseInt(pos) < 2420 ){
			$.scrollTo(2420, 800, {axis:'y'});
		} else if(parseInt(pos) >= 2420 && parseInt(pos) < 3020 ){
			$.scrollTo(3020, 800, {axis:'y'});
		} else if(parseInt(pos) >= 3020 && parseInt(pos) < 3620 ){
			$.scrollTo(3620, 800, {axis:'y'});
		} else if(parseInt(pos) >= 3620 && parseInt(pos) < 4220 ){
			$.scrollTo(4220, 800, {axis:'y'});
		} else if(parseInt(pos) >= 4220 && parseInt(pos) < 4820 ){
			$.scrollTo(4820, 800, {axis:'y'});
		} else if(parseInt(pos) >= 4820 && parseInt(pos) < 5420 ){
			$.scrollTo(5420, 800, {axis:'y'});
		} else if(parseInt(pos) >= 5420 && parseInt(pos) < 6020 ){
			$.scrollTo(6020, 800, {axis:'y'});
		} else if(parseInt(pos) >= 6020 && parseInt(pos) < 6620 ){
			$.scrollTo(6620, 800, {axis:'y'});
		} else if(parseInt(pos) >= 6620 && parseInt(pos) < 7220 ){
			$.scrollTo(7220, 800, {axis:'y'});
		} else if(parseInt(pos) >= 7220 && parseInt(pos) < 7820 ){
			$.scrollTo(7820, 800, {axis:'y'});
		} else if(parseInt(pos) >= 7820 && parseInt(pos) < 8420 ){
			$.scrollTo(8420, 800, {axis:'y'});
		} else if(parseInt(pos) >= 8420 && parseInt(pos) < 9020 ){
			$.scrollTo(9020, 800, {axis:'y'});
		} else if(parseInt(pos) >= 9020 && parseInt(pos) < 9620 ){
			$.scrollTo(9620, 800, {axis:'y'});
		}
		
		
		return false;
			
		});
		
});
