/* Author: Will Haynes

*/


$(document).ready( function() {
/*
	$('.logo').click( function() {
		$('body').append("<div class='grid' style='display:none;background:url(img/grid.png);display:block;z-index:9999;position:absolute;top:0;left:0'></div>");
		$('.grid').width($(document).width()).height($(document).height()).show(1000);
		
		$('.grid').click( function() {
		
			$(this).remove();
		
		});
	
	return false;
	});
*/

});
$(document).ready( function() {

	// Navigation
	
	$('.navlist li').hover( function() {
		
		$(this).css('cursor','pointer');
		$(this).animate({
		       'padding-left': '5px'
		   }, 200);
		  
		$(this).find('span').animate({
		       'left': '70px'
		   }, 200);
		   
	}, function(){
	$(this).animate({
	       'padding-left': '0px'
	   }, 200);
	   
	   $(this).find('span').animate({
	          'left': '200px'
	      }, 200);
	
	
	});
	
	// Set up Work page Slider
	
	$('.portfolioSlider').each( function() {
	
		$(this).find('img').wrapAll('<div class="photoReel"/>').parent('.photoReel')
			.children('img').each( function(index) {
				$(this).css({
						'left':index*420,
						'display':'block'
						});
		
				});
		
	});
	
	// Work Page slider listener
	
	$('.navButtons a').click( function(event) {
	
	
		
		$(this).addClass('active').siblings().removeClass('active');
		var clickIndex = $(this).parent('.navButtons').find('a').index($(this)); // Index of Click
		$(this).parents('.portfolioDetails').siblings('.portfolioSlider').find('.photoReel').each( function(index) {

			$(this).stop().animate({'marginLeft':-(clickIndex*420)},400);

		});
		
		return false;

	});
	
	// Twitter Bird Change (Homepage)
	
	$('.homepageMoreTwitter a').hover( function() {
	
		$('.homepageMoreTwitter').css('background-position','right -98px');
	
	
		}, function() {
	
		$('.homepageMoreTwitter').css('background-position','right top');
	
	
	});

	$(window).resize( function() {

		$('#container').height($(document).height());
	
	}).resize();


});
























