$(document).ready(function(){
			
		window.onload = function() {
			opening_anim();
			
			var anim_timer;
			
			$('#logo_img').mouseenter(function() {
				  $('#logo_img').animate({
						top: '-30px',
					  }, 700, 'easeInOutCubic', function() {});});
			$('#logo_img').mouseleave(function() {
			  $('#logo_img').animate({
					top: '0px',
				  }, 700, 'easeInOutCubic', function() {});});
			
			$('#about_btn').mouseenter(function() {
				  $('#about_btn_img').animate({
						top: '0px',
					  }, 700, 'easeInOutCubic', function() {});});
			$('#about_btn').mouseleave(function() {
			  $('#about_btn_img').animate({
					top: '-49px',
				  }, 700, 'easeInOutCubic', function() {});});
			$('#directors_btn').mouseenter(function() {
				  $('#directors_btn_img').animate({
						top: '0px',
					  }, 700, 'easeInOutCubic', function() {});});
			$('#directors_btn').mouseleave(function() {
			  $('#directors_btn_img').animate({
					top: '-49px',
				  }, 700, 'easeInOutCubic', function() {});});
			$('#reps_btn').mouseenter(function() {
				  $('#reps_btn_img').animate({
						top: '0px',
					  }, 700, 'easeInOutCubic', function() {});});
			$('#reps_btn').mouseleave(function() {
			  $('#reps_btn_img').animate({
					top: '-49px',
				  }, 700, 'easeInOutCubic', function() {});});
			$('#news_btn').mouseenter(function() {
				  $('#news_btn_img').animate({
						top: '0px',
					  }, 700, 'easeInOutCubic', function() {});});
			$('#news_btn').mouseleave(function() {
			  $('#news_btn_img').animate({
					top: '-49px',
				  }, 700, 'easeInOutCubic', function() {});});
			$('#contact_btn').mouseenter(function() {
				  $('#contact_btn_img').animate({
						top: '0px',
					  }, 700, 'easeInOutCubic', function() {});});
			$('#contact_btn').mouseleave(function() {
			  $('#contact_btn_img').animate({
					top: '-49px',
				  }, 700, 'easeInOutCubic', function() {});});
			$('#facebook_btn').mouseenter(function() {
				  $('#facebook_btn_img').animate({
						top: '0px',
					  }, 700, 'easeInOutCubic', function() {});});
			$('#facebook_btn').mouseleave(function() {
			  $('#facebook_btn_img').animate({
					top: '-49px',
				  }, 700, 'easeInOutCubic', function() {});});
			$('#anim_nav1_btn').click(function() {
				if(active_anim != 0 ) {
					//anim_timer.clearTimeout();
					set_anim(0);
				}
			});
			$('#anim_nav1_btn').mouseenter(function() {
				if(active_anim != 0 ) {$(".anim_nav1_img").removeClass("anim_nav1_img").addClass("anim_nav1_img_active");}

			});
			$('#anim_nav1_btn').mouseleave(function() {
				if(active_anim != 0 ) {$(".anim_nav1_img_active").removeClass("anim_nav1_img_active").addClass("anim_nav1_img");}
			});
			
			$('#anim_nav2_btn').click(function() {
				if(active_anim != 1 ) {set_anim(1);}
			});
			$('#anim_nav2_btn').mouseenter(function() {
				if(active_anim != 1 ) {$(".anim_nav2_img").removeClass("anim_nav2_img").addClass("anim_nav2_img_active");}

			});
			$('#anim_nav2_btn').mouseleave(function() {
				if(active_anim != 1 ) {$(".anim_nav2_img_active").removeClass("anim_nav2_img_active").addClass("anim_nav2_img");}
			});
			$('#anim_nav3_btn').click(function() {
				if(active_anim != 2 ) {set_anim(2);}
			});
			$('#anim_nav3_btn').mouseenter(function() {
				if(active_anim != 2 ) {$(".anim_nav3_img").removeClass("anim_nav3_img").addClass("anim_nav3_img_active");}

			});
			$('#anim_nav3_btn').mouseleave(function() {
				if(active_anim != 2 ) {$(".anim_nav3_img_active").removeClass("anim_nav3_img_active").addClass("anim_nav3_img");}
			});
			
			$('#anim_nav4_btn').click(function() {
				if(active_anim != 3 ) {set_anim(3);}
			});
			$('#anim_nav4_btn').mouseenter(function() {
				if(active_anim != 3 ) {$(".anim_nav4_img").removeClass("anim_nav4_img").addClass("anim_nav4_img_active");}

			});
			$('#anim_nav4_btn').mouseleave(function() {
				if(active_anim != 3 ) {$(".anim_nav4_img_active").removeClass("anim_nav4_img_active").addClass("anim_nav4_img");}
			});
			
			$('#anim_nav5_btn').click(function() {
				if(active_anim != 4 ) {
					//anim_timer.clearTimeout();
					set_anim(4);	
				}
				
			});
			$('#anim_nav5_btn').mouseenter(function() {
				 
				 if(active_anim != 4 ) {$(".anim_nav5_img").removeClass("anim_nav5_img").addClass("anim_nav5_img_active");}

			});
			$('#anim_nav5_btn').mouseleave(function() {
			  	
				if(active_anim != 4 ) {$(".anim_nav5_img_active").removeClass("anim_nav5_img_active").addClass("anim_nav5_img");}
			})
			
		} 
		var active_anim;
		
       
		 
		 function opening_anim () {
			 
	
			$('#logo_img').delay(400).fadeIn('slow', function() {
        		// Animation complete
     		});
			$('#page_content').delay(600).fadeIn('slow', function() {
        		// Animation complete
     		});
			$('#about_btn_img').animate({
				top: '-49px',
				}, 700, 'easeInOutCubic', function() {
			});
			$('#directors_btn_img').animate({
				top: '-49px',
				}, 800, 'easeInOutCubic', function() {
			});
			$('#reps_btn_img').animate({
				top: '-49px',
				}, 900, 'easeInOutCubic', function() {
			});
			$('#news_btn_img').animate({
				top: '-49px',
				}, 1000, 'easeInOutCubic', function() {
			});
			$('#contact_btn_img').animate({
				top: '-49px',
				}, 1100, 'easeInOutCubic', function() {
			});
			$('#facebook_btn_img').animate({
				top: '-49px',
				}, 1200, 'easeInOutCubic', function() {});}
		 function set_anim(anim_num) {
			clearTimeout(anim_timer);
			move_anim(anim_num);	 
		 }
		 function move_anim(anim_num) {
			
			console.log(anim_num)
			
			 switch(active_anim) {
				case 0:
					$('#anim1').fadeOut('slow', function() {
        				// Animation complete    
						//$('.anim_nav1_img').toggleClass("anim_nav1_img_active");	
						 
     				 });
					 $(".anim_nav1_img_active").removeClass("anim_nav1_img_active").addClass("anim_nav1_img"); 
					break;
				case 1:
					$('#anim2').fadeOut('slow', function() {
						  	
        				// Animation complete
     				 });
					$(".anim_nav2_img_active").removeClass("anim_nav2_img_active").addClass("anim_nav2_img");
					break;
				case 2:
					$('#anim3').fadeOut('slow', function() {
						  	
        				// Animation complete
     				 });
					 $(".anim_nav3_img_active").removeClass("anim_nav3_img_active").addClass("anim_nav3_img");
					break;
				case 3:
					$('#anim4').fadeOut('slow', function() {
							
     				 });
					 $(".anim_nav4_img_active").removeClass("anim_nav4_img_active").addClass("anim_nav4_img");  
					break;
				case 4:
					$('#anim5').fadeOut('slow', function() {
							
        				// Animation complete
     				 });
					 $(".anim_nav5_img_active").removeClass("anim_nav5_img_active").addClass("anim_nav5_img");  
					break;      
				default:
			 }
			 switch(anim_num) {
				case 0:
					$('#anim1').fadeIn('slow', function() {
        				// Animation complete
						 
						active_anim = 0;
     				 });
					 $(".anim_nav1_img").removeClass("anim_nav1_img").addClass("anim_nav1_img_active"); 
					break;
				case 1:
					$('#anim2').fadeIn('slow', function() {
        				// Animation complete
						active_anim = 1;
     				 });
					  $(".anim_nav2_img").removeClass("anim_nav2_img").addClass("anim_nav2_img_active");
					break;
				case 2:
					$('#anim3').fadeIn('slow', function() {
        				// Animation complete
						 
						active_anim = 2;
     				 });
					 $(".anim_nav3_img").removeClass("anim_nav3_img").addClass("anim_nav3_img_active");
					break;
				case 3:
					$('#anim4').fadeIn('slow', function() {
        				// Animation complete
						 
						active_anim = 3;
     				 });
					 $(".anim_nav4_img").removeClass("anim_nav4_img").addClass("anim_nav4_img_active");	
					break; 
				case 4:
					$('#anim5').fadeIn('slow', function() {
        				// Animation complete
							
						active_anim = 4;
     				 });
					  $(".anim_nav5_img").removeClass("anim_nav5_img").addClass("anim_nav5_img_active");
					break; 
				default:
			 }
			active_anim = 1*anim_num;
			var next_anim = 1+ active_anim;
			if (next_anim > 4) {
				next_anim = 0;	
			}
			

			 
		 }
		 
		 
		 

     });

