// JavaScript Document
	$(document).ready(function(){
		
		window.onload = function() {	
			
			$("#nick_puga").animate({
					top: '70px',
				}, 300, 'easeOutQuad', function() {
					// Animation complete.
			});

			var nav_delay = 300; 		 
					 
			$("#main_nav").children().each(function() {
				var btn = $(this);
				if (btn.is(".nav_btn")) {
					btn.delay(nav_delay).animate({
						top: '0px',
					 }, 200, 'easeOutQuad', function() {
						// Animation complete.
					 });
				}
				nav_delay = nav_delay + 100;
			});
			
			$("#share_nav").children().each(function() {
				var btn = $(this);
				if (btn.is(".share_btn")) {
					btn.delay(nav_delay).animate({
						top: '0px',
					 }, 200, 'easeOutQuad', function() {
						// Animation complete.
					 });
				}
				nav_delay = nav_delay + 100;
			});
			
			pathArray = window.location.pathname.split( '/' );
			
			var section_img_X;
			var section_img_Y;
			var section_content_X;
			var section_content_Y;
			var section_content_W;
			var section_content_H;
			var top_nav_height = 185;
			var site_content_H;
			
			switch(pathArray[1])
			{
				case "home":
					  
						section_img_X = 600;
					  	section_img_Y = 120;	
					  	section_content_X = 80;
					  	section_content_Y =  200;	
						section_content_W = 600;
						site_content_H = section_content_Y + $("#section_content").height();
					
					
				  	break; 
				case "":
					  
						section_img_X = 600;
					  	section_img_Y = 120;	
					  	section_content_X = 80;
					  	section_content_Y =  200;	
						section_content_W = 600;
						site_content_H = section_content_Y + $("#section_content").height();
					
					
				  	break; 
				case "about":
				  	  
						section_img_X = 40;
					  	section_img_Y = 160;	
					  	section_content_X = 480;
					  	section_content_Y =  220;	
						section_content_W = 600;
						site_content_H = section_content_Y + $("#section_content").height();
					
					
				  	break;
				case "resume":
					  
						section_img_X = 0;
					  	section_img_Y = 0;	
					  	section_content_X = 180;
					  	section_content_Y =  190;	
						section_content_W = 800;
						site_content_H = section_content_Y + $("#section_content").height();
					
					
				  	break;
				case "headshots":
					section_img_X = 0;
				  	section_img_Y = 0;
				  	section_content_X = 60;
				  	section_content_Y = 210;	
					section_content_W = 1000;
					site_content_H = top_nav_height + $("#section_content").height();
				  	break;
				case "gallery":
					section_img_X = 0;
				  	section_img_Y = 0;
				  	section_content_X = 60;
				  	section_content_Y = 210;	
					section_content_W = 1000;
					site_content_H = top_nav_height + $("#section_content").height()+40;
				  	break;
				case "videos":
					VideoJS.setup();
					section_img_X = 70;
				  	section_img_Y = 150;
				  	section_content_X = 70;
				  	section_content_Y = 220;	
					section_content_W = 1000;
					site_content_H = top_nav_height + $("#section_content").height()+40;
				  	break;
				case "auditions":
					VideoJS.setup();
					section_img_X = 70;
				  	section_img_Y = 150;
				  	section_content_X = 230;
				  	section_content_Y = 190;	
					section_content_W = 1000;
					site_content_H = top_nav_height + $("#section_content").height()+30;
				  	break;
				case "projects":
					VideoJS.setup();
					section_img_X = 70;
				  	section_img_Y = 150;
				  	section_content_X = 70;
				  	section_content_Y = 190;	
					section_content_W = 980;
					site_content_H = top_nav_height + $("#section_content").height()+30;
				  	break;
				case "news":
					if(pathArray[2] == "article") {
						VideoJS.setup();
						section_img_X = 0;
					  	section_img_Y = 0;
					  	section_content_X = 60;
					  	section_content_Y = 180;	
						section_content_W = 1000;
						site_content_H = section_content_Y + $("#article").height();
					} else {
						  
							section_img_X = 660;
						  	section_img_Y = 150;	
						  	section_content_X = 70;
						  	section_content_Y =  220;	
							section_content_W = 980;
							site_content_H = section_content_Y + $("#section_content").height();
						
						
					}
				  	break;
				case "contact":
					  
						section_img_X = 0;
					  	section_img_Y = 180;	
					  	section_content_X = 500;
					  	section_content_Y =  240;	
						section_content_W = 620;
						site_content_H = section_content_Y + $("#section_content").height();
					
					
				  	break;
				case "tech_notes":
					section_img_X = 70;
				  	section_img_Y = 150;
				  	section_content_X = 0;
				  	section_content_Y = 210;	
					section_content_W = 1300;
					site_content_H = top_nav_height + $("#section_content").height()+30;
				  	break;
				default:
				  
			}
			
			
			//$("#section_img").offset({ left: section_img_X});
			$("#site_content").css("height",650);
			if(site_content_H < 650) {
				site_content_H = 650;
			}
			$("#site_content").css("height",site_content_H);
			
			$("#section_img").css("left",section_img_X);
			$("#section_img").css("top",site_content_H+80);
			
			$("#section_content").css("top",site_content_H+80);
			$("#section_content").css("left",section_content_X);
			$("#section_content").css("width",section_content_W);
						
			
			
			$("#section_img").delay(500).animate({
					top: section_img_Y,
				}, 300, 'easeOutQuad', function() {
					// Animation complete.
			});		
				
			
			
			//$("#section_content").css("height",section_content_H);
			
			$("#section_content").delay(700).animate({
					top: section_content_Y,
				}, 300, 'easeOutQuad', function() {
					// Animation complete.
			});
			
			$("#video_nav").css("top",site_content_H+80);
			$("#video_nav").css("left",section_content_X);
			
			$("#video_nav").delay(700).animate({
					top: section_content_Y-35,
				}, 300, 'easeOutQuad', function() {
					// Animation complete.
			});
			
			$("#section_title").delay(500).animate({
					top: '122px',
				}, 300, 'easeOutQuad', function() {
					// Animation complete.
			});
	
			$('.nav_btn').mouseenter(function (event) {
				$(this).children('.nav_btn_roll').animate({
					left: '0px',
				 }, 300, function() {
					// Animation complete.
				 });
			});
			
			$('.nav_btn').mouseleave(function (event) {
				$(this).children('.nav_btn_roll').animate({
					left: '-100px',
				 }, 200, function() {
					// Animation complete.
				 });
			});
			
				$('#arrow_right').mouseenter(function (event) {
					$('#arrow_right_btn').animate({
						left: '20px',
					 }, 300, function() {
						// Animation complete.
					 });
				});

				$('#arrow_right').mouseleave(function (event) {
					$('#arrow_right_btn').animate({
						left: '0px',
					 }, 200, function() {
						// Animation complete.
					 });
				});

				$('#arrow_left').mouseenter(function (event) {
					$('#arrow_left_btn').animate({
						left: '-20px',
					 }, 300, function() {
						// Animation complete.
					 });
				});

				$('#arrow_left').mouseleave(function (event) {
					$('#arrow_left_btn').animate({
						left: '0px',
					 }, 200, function() {
						// Animation complete.
					 });
				});
		}

});
