$(document).ready(function(){
  $("#slider-portfolio").height($(document).height());
  //Set opacity on each span to 0%
  $(".rollover").css({'opacity':'0'});

	$('.img_list a').hover(
		function() {
			$(this).find('.rollover').stop().fadeTo(500, 1);
		},
		function() {
			$(this).find('.rollover').stop().fadeTo(500, 0);
	});
	
	$('.nivoSlider a').hover(
		function() {
			$(this).find('.rollover').stop().fadeTo(500, 1);
		},
		function() {
			$(this).find('.rollover').stop().fadeTo(500, 0);
	});
  $('#slider').nivoSlider({
      effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
      slices:15,
      animSpeed:600, //Slide transition speed
      pauseTime:4500,
      startSlide:0, //Set starting Slide (0 index)
      directionNav:false, //Next & Prev
      directionNavHide:true, //Only show on hover
      controlNav:false, //1,2,3...
      controlNavThumbs:false, //Use thumbnails for Control Nav
      controlNavThumbsFromRel:false, //Use image rel for thumbs
      controlNavThumbsSearch: '', //Replace this with...
      controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
      keyboardNav:true, //Use left & right arrows
      pauseOnHover:false, //Stop animation while hovering
      manualAdvance:false, //Force manual transitions
      captionOpacity:0.8, //Universal caption opacity
      beforeChange: function(){},
      afterChange: function(){},
      slideshowEnd: function(){}, //Triggers after all slides have been shown
      lastSlide: function(){}, //Triggers when last slide is shown
      afterLoad: function(){} //Triggers when slider has loaded
  });
  $('#slider-portfolio').nivoSlider({
      effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
      slices:10,
      animSpeed:400, //Slide transition speed
      pauseTime:4500,
      startSlide:0, //Set starting Slide (0 index)
      directionNav:false, //Next & Prev
      directionNavHide:true, //Only show on hover
      controlNav:true, //1,2,3...
      controlNavThumbs:false, //Use thumbnails for Control Nav
      controlNavThumbsFromRel:false, //Use image rel for thumbs
      controlNavThumbsSearch: 'img/arrows.jpg', //Replace this with...
      controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
      keyboardNav:true, //Use left & right arrows
      pauseOnHover:true, //Stop animation while hovering
      manualAdvance:false, //Force manual transitions
      captionOpacity:0.8, //Universal caption opacity
      beforeChange: function(){},
      afterChange: function(){},
      slideshowEnd: function(){}, //Triggers after all slides have been shown
      lastSlide: function(){}, //Triggers when last slide is shown
      afterLoad: function(){} //Triggers when slider has loaded
  });
    $('#slider-portfolio-fabricly, #slider-portfolio-mnz, #slider-portfolio-pt-project, #slider-portfolio-elena-rubin, #slider-portfolio-ten-over-six, #slider-portfolio-o-and-j').nivoSlider({
      effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
      slices:10,
      animSpeed:400, //Slide transition speed
      pauseTime:4500,
      startSlide:0, //Set starting Slide (0 index)
      directionNav:false, //Next & Prev
      directionNavHide:true, //Only show on hover
      controlNav:true, //1,2,3...
      controlNavThumbs:false, //Use thumbnails for Control Nav
      controlNavThumbsFromRel:false, //Use image rel for thumbs
      controlNavThumbsSearch: 'img/arrows.jpg', //Replace this with...
      controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
      keyboardNav:true, //Use left & right arrows
      pauseOnHover:true, //Stop animation while hovering
      manualAdvance:false, //Force manual transitions
      captionOpacity:0.8, //Universal caption opacity
      beforeChange: function(){},
      afterChange: function(){},
      slideshowEnd: function(){}, //Triggers after all slides have been shown
      lastSlide: function(){}, //Triggers when last slide is shown
      afterLoad: function(){} //Triggers when slider has loaded
  });
	$('#index-left-column, #slider, #left-column-portfolio, #left-column-capabilities, #left-column-clients').hide();
	$('#index-left-column, #slider, #left-column-portfolio, #left-column-capabilities, #left-column-clients').delay(500);
	$('#index-left-column, #slider, #left-column-portfolio, #left-column-capabilities, #left-column-clients').removeClass('noShow')
	$('#index-left-column, #slider, #left-column-portfolio, #left-column-capabilities, #left-column-clients').fadeIn(500);
	$('ul.drop-down-info').hide();
	$('ul.drop-down-info').delay(800);
	$('ul.drop-down-info').removeClass('noShow')
	$('ul.drop-down-info').fadeIn(800);
	$('#slider-portfolio-video').hide();
	$('#slider-portfolio-video').delay(800);
	$('#slider-portfolio-video').removeClass('noShow')
	$('#slider-portfolio-video').fadeIn(800);
	$('#slider-portfolio, #slider-portfolio-fabricly, #slider-portfolio-mnz, #slider-portfolio-pt-project, #slider-portfolio-elena-rubin, #slider-portfolio-ten-over-six, #slider-portfolio-o-and-j').hide();
	$('#slider-portfolio, #slider-portfolio-fabricly, #slider-portfolio-mnz, #slider-portfolio-pt-project, #slider-portfolio-elena-rubin, #slider-portfolio-ten-over-six, #slider-portfolio-o-and-j').delay(800);
	$('#slider-portfolio, #slider-portfolio-fabricly, #slider-portfolio-mnz, #slider-portfolio-pt-project, #slider-portfolio-elena-rubin, #slider-portfolio-ten-over-six, #slider-portfolio-o-and-j').removeClass('noShow')
	$('#slider-portfolio, #slider-portfolio-fabricly, #slider-portfolio-mnz, #slider-portfolio-pt-project, #slider-portfolio-elena-rubin, #slider-portfolio-ten-over-six, #slider-portfolio-o-and-j').fadeIn(800);
	$('#footer').hide();
	$('#footer').delay(500);
	$('#footer').removeClass('noShow')
	$('#footer').fadeIn(500);
	
	//Ship Animation
	if ($('#bodyContainer-index').is(':visible')) {
		bounceHim();
		shipScroll();
	} else {
		$("img.water, #ship-animation").remove();
	}
});
var num = 1;
// Ship Functions
function shipScroll(){
	$("#full-ship").animate({left:"100%"}, {easing: "linear",duration:200000});
}	
function bounceHim(){
	$("#ship").animate({bottom:"-=6px"},3000).animate({bottom:"+=6px"},3000);
	setTimeout("bounceHim()",300);
}

$(function(){
	$(".photo-list2 a").hover(function(){
		$(this).children("span").fadeOut();
	}, function(){
		$(this).children("span").fadeIn();
	})		
});

$(function(){
	$(".footer-icons a").hover(function(){
		$(this).children("span").fadeOut();
	}, function(){
		$(this).children("span").fadeIn();
	})		
});

// Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24212061-1']);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
