/**
 * @author Christopher Wallace
 */

jQuery(window).load(function(){
	 // Lazy Load images below the fold
	 jQuery(".content img.thumbnail").lazyload();
  
	 //move the image in pixel  
	 var move = -15;       
	 //zoom percentage, 1.2 =120%  
	 var zoom = 1.2;

	//hoverIntent
  	var		over = function(e){
				//jQuery(this).find('img.thumbnail').stop().animate({
				//  	marginTop : '-50px'
				//  }, 100)
				
				//Set the width and height according to the zoom percentage  
				//width = 125 * zoom;  
				//height = 125 * zoom;  

				//jQuery(this).find('img.thumbnail').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200})
				//.parent('a').find('span.slider').stop(false,true).fadeIn(200)
				//.parent('a').find('span.title').stop(false,true).fadeOut(200);
				
			jQuery(this).find('img.thumbnail').stop().animate({marginTop : '-50px'}, 100)
			  .parent('a').find('span.slider').stop().fadeTo("slow",1.0)
			  .parent('a').find('span.title').stop().fadeTo("slow",0.0);
			},
			out = function(e){
				//jQuery(this).find('img.thumbnail').stop().animate({
				//  	marginTop : '0'
				//  }, 100)

				//jQuery(this).find('img.thumbnail').stop(false,true).animate({'width':'125', 'height':'125', 'top':'0', 'left':'0'}, {duration:100})
				//.parent('a').find('span.slider').stop(false,true).fadeOut(200)
				//.parent('a').find('span.title').stop(false,true).fadeIn(200);
				
				jQuery(this).find('img.thumbnail').stop().animate({marginTop : '0'}, 100)
					.parent('a').find('span.slider').stop().fadeTo("slow",0.0)
					.parent('a').find('span.title').stop().fadeTo("slow",1.0);
				
			};
  
	// The magic sliding panels
	jQuery('.entry-content a span.slider').css({
		opacity : '0.0'
	});
	
	jQuery('.entry-content a').hover(over, out);
});