
	var total_projects=2;
	var current_project=1;
	

	
	function animateUp(){
	  
	  lookforproject=false;
	  starting=false;
	  
	  //document.location='';
	  
	  var projectHeight=$(".project").outerHeight();
	  var projectSmallHeight=$(".project-small").outerHeight();
	  	
	  $('#linkup').unbind('click');
	  current_project--;
	
	 
	 
	 // var newaddress='#/home/'+currentslug;
	  //window.location = newaddress;
	  
	  
	 //$.address.value(newaddress);
	  
	  
	  if(current_project==0){
	  	$('#projects').prepend($('.project:last'));
	  	$('#projects').css({top: -projectHeight});
	  	
	  	$('#projects-small').prepend($('.project-small:last'));
	  	$('#projects-small').css({top: -projectSmallHeight});
	  	  	
	  	current_project=1;	  	
	  }
	  
	  

	    currentslug=$('.project:nth-child('+(current_project)+')').attr('slug');
	 
	 $("#linkup").attr("href","#/home/"+currentslug);
	
	  
	  //animates the small project
	  $('#projects-small').animate({
	    top: '+='+projectSmallHeight
	  }, 400, function() { });
	  
	  
	  
	  //animates the big project
	  $('#projects').animate({
	    top: '+='+projectHeight
	  }, 400, function() {
	  	 //delete vimeos
	  	 deleteVideos();
	     $('#linkup').bind('click', animateUp);
	  });
	  
	  
	  
	};
	
	
	function animateDown(){
	  var projectHeight=$(".project").outerHeight();
	  
	  var projectSmallHeight=$(".project-small").outerHeight();

		  lookforproject=false;  
	 	  starting=false;
	  
	  $('#linkdown').unbind('click');
	  current_project++;

	  if(current_project>total_projects){	  	

	  	$('#projects').append($('.project:first'));	  	
	  	$('#projects').css({top: -0});
	  		
	  	$('#projects-small').append($('.project-small:first'));
	  	$('#projects-small').css({top: -0});

	  	current_project=total_projects;
	  	
	  }
	  
	  
	  
	 currentslug=$('.project:nth-child('+(current_project)+')').attr('slug');
	 
	 $("#linkdown").attr("href","#/home/"+currentslug);


	  
	  
	  //animates the small project
	  $('#projects-small').animate({
	    top: '-='+projectSmallHeight
	  }, 400, function() { });

	  
	  //animates the big project
	  $('#projects').animate({
	    top: '-='+projectHeight
	  }, 400, function() {  
	    deleteVideos();
	   	$('#linkdown').bind('click', animateDown);
	   
	  });
	  
	 };


//---------------------------------------------------------
var animation_playlist_status = true;
//var total_projects_playlist=3;
	var current_project_playlist=1;
	

	function animateUpPlaylist(){
	  if(animation_playlist_status){
		  
	  current_project_playlist--;
	  
	  animation_playlist_status = false;
	    var projectHeight=$(".project").outerHeight();
	  var projectSmallHeight=$(".project-small").outerHeight();
	  
	  
	  if(current_project_playlist==0){
	  	$('#projects').prepend($('.project:last'));
	  	$('#projects').css({top: -projectHeight});
	  	
	  	$('#projects-small').prepend($('.project-small:last'));
	  	$('#projects-small').css({top: -projectSmallHeight});
	  	  	
	  	current_project_playlist=1;	  	
	  }
	  
	  
	  //animates the small project
	  $('#projects-small').animate({
	    top: '+='+projectSmallHeight
	  }, 400, function() { });
	  
	  
	  
	  //animates the big project
	  $('#projects').animate({
	    top: '+='+projectHeight
	  }, 400, function() {	     
	  	 deleteVideos();
	     animation_playlist_status = true;
	  });
	  }
	  
	  
	};
	
	
	function animateDownPlaylist(){
	  current_project_playlist++;
	  
	  if(animation_playlist_status){
		  animation_playlist_status = false;
	  var projectHeight=$(".project").outerHeight();
	  var projectSmallHeight=$(".project-small").outerHeight();
	  
	  if(current_project_playlist>total_projects_playlist){	  		  	
	  	$('#projects').append($('.project:first'));	  	
	  	$('#projects').css({top: -0});
	  	
	  	$('#projects-small').append($('.project-small:first'));
	  	$('#projects-small').css({top: -0});
	  	
	  	current_project_playlist=total_projects_playlist;
	  	
	  }
	  
	  //animates the small project
	  $('#projects-small').animate({
	    top: '-='+projectSmallHeight
	  }, 400, function() { });

	  
	  //animates the big project
	  $('#projects').animate({
	    top: '-='+projectHeight
	  }, 400, function() {  
	    deleteVideos();
	   	animation_playlist_status = true; 	
	   
	  });
	  
	  }
	  
	  
	};


