$(document).ready(function () {

  $('.dropdown a').hover(function () {
  $(this).stop(true).animate({paddingLeft: '15px'}, {speed: 100, easing: 'easeOutBack'});
  }, function () {
  $(this).stop(true).animate({paddingLeft: '5px' }, {speed: 100, easing: 'easeOutBounce'});
  });
  
  $('#companyLink').hover(function () {
    $('#companyLink span a').stop(true).css({color: '#b1d035' });
	$('#companyLink .sneakyBox').stop(true).animate({top: '-66px'}, 200);
  }, function () {
    $('#companyLink span a').stop(true).css({color: '#929496' })
	$('#companyLink .sneakyBox').stop(true).animate({top: '-204px'}, 150);
  });
  
  $('#portfolioLink').hover(function () {
    $('#portfolioLink span a').stop(true).css({color: '#f47321' });
	$('#portfolioLink .sneakyBox').stop(true).animate({top: '-66px'}, 200);
  }, function () {
    $('#portfolioLink span a').stop(true).css({color: '#929496' });
	$('#portfolioLink .sneakyBox').stop(true).animate({top: '-204px'}, 150);
  });
  
  $('#processLink').hover(function () {
    $('#processLink span a').stop(true).css({color: '#019dce' });
	$('#processLink .sneakyBox').stop(true).animate({top: '-66px'}, 200);
  }, function () {
    $('#processLink span a').stop(true).css({color: '#929496' });
	$('#processLink .sneakyBox').stop(true).animate({top: '-204px'}, 150);
  });
  
  $('#contactLink').hover(function () {
    $('#contactLink span a').stop(true).css({color: '#ed1c24' });
	$('#contactLink .sneakyBox').stop(true).animate({top: '-66px'}, 200);
  }, function () {
    $('#contactLink span a').stop(true).css({color: '#929496' });
	$('#contactLink .sneakyBox').stop(true).animate({top: '-204px'}, 150);
  });
  
  $('#footer').hover(function () {
    $('#footerCover').stop(true).animate({opacity: 0}, 200);
	setTimeout(function() {$('#footerCover').stop(true).css({display: 'none'})}, 200);
  }, function () {
    $('#footerCover').stop(true).css({display: 'block' });
	setTimeout(function() {$('#footerCover').stop(true).animate({opacity: .6}, 200)}, 10);
  });
  
  
  $('#slideHolder').cycle({
    fx: 'fade',
    timeout: 5500,
    speed: 1800,
  });
  
    $('#randomWork ul').cycle({
    fx: 'fade',
	timeout: 5500,
    speed: 500,
	pause: 1
  });
  
 	$('.portfolioListItem').hover(function () {
		$('h4 a', this).stop(true).css({color: '#fff' });
		}, function () {
		$('h4 a', this).stop(true).css({color: '#787a7e' });
    });
	
	//Fade in bottom portfolio navigation
	setTimeout(function() {$('#bottomLinks').fadeIn(800)}, 1500);
	setTimeout(function() {$('#playArea').css({opacity: 0})}, 0);
	setTimeout(function() {$('#playArea').animate({opacity: 1}, 800)}, 800);

	//Fade in unordered lists sequentially
    for(i=1;i<=$("#mainHead ul li").length; i++){
      setTimeout("fadeUp($('#mainHead ul li:nth-child("+i+")'))", 50*i);
   }
/*// infinitescroll() is called on the element that surrounds 
// the items you will be loading more of
  $('#portfolioList').infinitescroll({
 
    navSelector  : "#pageNav li",            
                   // selector for the paged navigation (it will be hidden)
    nextSelector : "#pageNav li a:first",    
                   // selector for the NEXT link (to page 2)
    itemSelector : "#portfolioList .portfolioListItem",          
                   // selector for all items you'll retrieve
	loadingImg :  null,
	loadingText : null,
	bufferPx : 140
  });*/

});
function fadeUp(e){
   //note that this function could perform whatever you want on element e
   $(e).fadeIn(800);
}

