/**
 * @author Christopher Wallace
 */

jQuery(window).load(function(){

	 //move the image in pixel  
     var movex = -11; 
	 var movey = -6;  
       
     //zoom percentage, 1.2 =120%  
     var zoom = 1.1;  

  // Lazy Load images below the fold
  jQuery(".content img.thumbnail").lazyload();

  // The magic sliding panels
	
	
	jQuery('.entry-content a').hover(function() {  
           
         //Set the width and height according to the zoom percentage  
         width = jQuery(this).find('img.thumbnail').width() * zoom;  
         height = jQuery(this).find('img.thumbnail').height() * zoom;  
           
         //Move and zoom the image  
         jQuery(this).find('img.thumbnail').stop(false,true).animate({'width':width, 'height':height, 'top':movey, 'left':movex}, {duration:150});  
           
         //Display the caption  
         jQuery(this).find('span.slide-title').stop(false,true).fadeIn(150);  
     },  
     function() {  
         //Reset the image  
         jQuery(this).find('img.thumbnail').stop(false,true).animate({'width':jQuery('.entry-content a').width(), 'height':jQuery('.entry-content a').height(), 'top':'0', 'left':'0'}, {duration:100});    
   
         //Hide the caption  
         jQuery(this).find('span.slide-title').stop(false,true).fadeOut(200);  
    });  
	
	/*jQuery('.entry-content a span.slide-title').css({
		opacity : '0.0'
	}).parent('a').append('<span class="cover-up"></span>');*/
	/*jQuery('.entry-content a').mouseover(function(e){
	   width = jQuery(this).find('img.thumbnail').width() * zoom;  
       height = jQuery(this).find('img.thumbnail').height() * zoom;
	
	  jQuery(this).find('img.thumbnail').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200}).parent('a').find('span.slide-title').stop(false,true).fadeIn(200);  
	
      //jQuery(this).find('img.thumbnail').stop().animate({
	  //	marginTop : '-25px'
	  //}, 100).parent('a').find('span.slide-title').stop().fadeTo("slow",1.0);
	  
	});
	jQuery('.entry-content a').mouseout(function(e){
	  width = jQuery(this).find('img.thumbnail').width() / zoom;  
      height = jQuery(this).find('img.thumbnail').height() / zoom;
	  jQuery(this).find('img.thumbnail').stop(false,true).animate({'width':width, 'height':height, 'top':'0', 'left':'0'}, {duration:100}).parent('a').find('span.slide-title').stop(false,true).fadeOut(200);
	
      //jQuery(this).find('img.thumbnail').stop().animate({
	  //	marginTop : '0'
	  //}, 100).parent('a').find('span.slide-title').stop().fadeTo("slow",0.0);
	});*/
  
  // Comment Author URL hover effect
  jQuery('.comment-author a.url').mouseover(function(e){
  	var url = jQuery(this).attr('href');
	jQuery(this).parent('span').append('<span class="hover-url">'+url+'</span>');
  })
  jQuery('.comment-author a.url').mouseout(function(e){
	jQuery(this).parent('span').find('.hover-url').remove();
  })
  
  jQuery('#footer .widgetcontainer:nth-child(3n+1)').addClass('reset');
  jQuery('.ie6 #footer .widgetcontainer:nth-child(3n+1),.ie7 #footer .widgetcontainer:nth-child(3n+1)').css({
    clear : 'left'
  });

});