var $j = jQuery.noConflict();
$j(window).load(function(){
$j('#content').masonry({

  singleMode: false,
  // Disables measuring the width of each floated element.
  // Set to true if floated elements have the same width.
  // default: false

  columnWidth: 250,
  // Width in pixels of 1 column of your grid.
  // default: outer width of the first floated element.

 //  itemSelector: 'div:visible',
  // Additional selector to specify which elements inside
  // the wrapping element will be rearranged.
  // Required for Infinite Scroll with window resizing.

  resizeable: true,
  // Binds a Masonry call to window resizes 
  // so layout appears fluid.
  // default: true

  animate: false,
  // Animates layout rearrangements.
  // default: false

  animationOptions: {},
  // A map of options for animation.


  saveOptions: true,
  // Masonry will use the options from previous Masonry
  // calls by default, so you only have to enter in options once
  // default: true

}
);})



			var gLoadSpinnerUrl ='http://www.streghepergioco.it/testrune/images/ajax-loader.gif';
			var gFailImage = 'http://www.streghepergioco.it/testrune/images/ajax-loader.gif';

			function LoadImage(pSelector, pCallback){
    			var loader = $j(pSelector);
				loader.html('<img src="' + gLoadSpinnerUrl + '"/>');
 
				LoadThisImage($j(img), loader, pCallback);
			}
			
			function LoadThisImage(loader, pCallback){
				image_src = loader.attr('src');
				img = new Image();
				$j(img).hide();
 
				$j(img).load(function() {
					cb_js = loader.get(0).getAttribute('onload');              
					onload_cb = function(){
						eval(cb_js);
					}       
 
					loader.html(this);
					loader.removeClass('loadable-image');
					loader.removeAttr('src');
					loader.removeAttr('onload');
					$j(this).show(); 
					if (onload_cb){                
						onload_cb($j(this));
					}              
					if (pCallback){
						cb = pCallback;
						cb($j(this));
					}
				})
				.error(function() { $j(this).attr('src', gFailImage).show(); })
				.attr('src', image_src)
				.show();
			}
	
			function LoadAllImages(){
				$j('.loadable-image').each(function(){       
        			var loader = $j(this);
        			loader.html('<img src="' + gLoadSpinnerUrl + '"/>');
        			LoadThisImage(loader);
	});
}



