
$(document).ready(function() {

   $("ul.screenshots a").fancybox();
  


	// resize large images
$('.post img').each(function(){
  
        var maxWidth = 505; // Max width for the image
       
        var width = $(this).width();    // Current image width
        var height = $(this).height();  // Current image height

                if(width > maxWidth){
				        $(this).css("width", "auto").css("height", "auto"); // Remove existing CSS
                        $(this).removeAttr("width").removeAttr("height"); // Remove HTML attributes
                        var ratio = maxWidth / width;   // get ratio for scaling image
                        $(this).css("width", maxWidth); // Set new width
                       // $(this).css("height", height * ratio);  // Scale height based on ratio
                        //height = height * ratio;        // Reset height to match scaled image
                }
      

});

	
	
});




