jQuery(function($){
	
	//	This is where all the fonts are changed to Anivers
	Cufon.replace('ul#navigation-list li,ul.pagination li,h3,h2,h1,h4,h5,h6,blockquote, .wpcf7-form p', {hover: true}); 

}); 	


 $(document).ready(function() {
	
	
	// 	hides empty pagination li i.e. "next entries" and "previous entries" 
	$("ul.pagination li").each(
	  function() {
		var elem = $(this);
		if (elem.children().length == 0) {
		  elem.remove();
		}
	});

	
	// 	hides the dropdown
    $('ul#navigation-list li ul').hide();
	 	
	
	// Shows and hides the Dropdown Menu 
	$('#navigation-list li').hoverIntent(  	
	     
           function () {  
		   
               //show its submenu  
               $('ul', this).fadeIn(500);  },  
			   
           function () {  
               //hide its submenu  
              $('ul', this).fadeOut(500);   
			  
    }); 
	 
	
	//	Animation for the Widget lists on Sidebar	
	$('#sidebar ul li ul li').hover(
			
			function(){
				
				$(this).stop().animate({marginLeft: '35'}, 200);},
				
			function(){
			
				$(this).stop().animate({marginLeft: '25'}, 200);			
				
	});

	
	//	Animation for the Widget lists on Homepage
	$('.homepage-box ul li').hover(
			
			function(){
				
				$(this).stop().animate({marginLeft: '10'}, 200);},
				
			function(){
			
				$(this).stop().animate({marginLeft: '0'}, 200);			
				
	});	
	
	
	// On Page Load, sets opacity of elements to zero
	$(window).load(function(){
		$('.portfolio-box p, .portfolio-box div, .portfolio-box h3').animate({opacity: 0}, 300);	
			
			});

	
	// This is the hover effect on the portfolio boxes	
	$('.portfolio-box').hover(
	    		
			function(){
				
				$(this).children('h3').animate({opacity: .8, top: '50px', left: '30px'}, 200);
				$(this).children('p').animate({opacity: .8, bottom: '40px', right: '18px'}, 200);
				$(this).children('div').animate({opacity: .8, bottom: '40px', left: '30px'}, 200);	 
				},
				
				
			function(){
				
				
				$(this).children('h3').animate({opacity: 0, top: '0px', left: '0px'}, 200);
				$(this).children('p').animate({opacity: 0, bottom: '0px', right: '0px'}, 200);
				$(this).children('div').animate({opacity: 0, bottom: '0px', left: '0px'}, 200);

	});

	
	// this controls the filtering of the 'show all' button on the top of the portfolio page. The filtering of the other buttons is on the template-portfolio.php file 
	$(".show-all").click(	
		
			function(){	
			
				$('div.toggler').addClass('inactive');
				$('div.show-all').removeClass('inactive');
				$('div.inactive').animate({opacity: 0.3},200);
				$('div.show-all').animate({opacity: 1}, 200);
				$('div.toggler').removeClass('inactive');
				$('div.toggler').animate({opacity: 1}, 1000);						
				$('div.portfolio-bg').fadeIn(300);
				$('div.portfolio-bg').removeClass('remove');
						
	});	
	
	
	// On page load, hides the 'READ MORE' From the Blog Page	
	$('.blog-animation h3').animate({opacity: 0}, 200);
	
	
	// This is the hover animation of the 'READ MORE' on the Blog Page
	$('.blog-animation').hover(
	    		
			function(){
				$(this).children('a').animate({opacity: .5}, 200);	 
				$(this).children('h3').animate({opacity: 1, paddingRight: '50px'}, 200);				
				},
				
				
			function(){	
				$(this).children('a').animate({opacity: 1}, 200);
				$(this).children('h3').animate({opacity: 0, paddingRight: '20px'}, 200);

	});
	
	
	//	Starts the Homepage Slider in Motion //
	$('#slider').s3Slider({ timeOut: 6000});
	
});  

