  $.Isotope.prototype._spineAlignReset = function() {
    this.spineAlign = {
      colA: 0,
      colB: 0
    };
  };

  $.Isotope.prototype._spineAlignLayout = function( $elems ) {
    var instance = this,
        props = this.spineAlign,
        gutterWidth = Math.round( this.options.spineAlign && this.options.spineAlign.gutterWidth ) || 0,
        centerX = Math.round(this.element.width() / 2);

    $elems.each(function(){
      var $this = $(this),
          isColA = props.colB > props.colA,
          x = isColA ?
            centerX - ( $this.outerWidth(true) + gutterWidth / 2 ) :
            centerX + gutterWidth / 2, 
          y = isColA ? props.colA : props.colB;
      instance._pushPosition( $this, x, y );
      props[( isColA ? 'colA' : 'colB' )] += $this.outerHeight(true);
    });
  };

  $.Isotope.prototype._spineAlignGetContainerSize = function() {
    var size = {};
    size.height = this.spineAlign[( this.spineAlign.colB > this.spineAlign.colA ? 'colB' : 'colA' )];
    return size;
  };

  $.Isotope.prototype._spineAlignResizeChanged = function() {
    return true;
  };
  
 

$(document).ready(function() {
	$("#access .menu ul li:last-child").addClass("last");
	$(".more-reviews a:last-child").addClass("last-p");
	$(".column-block p:last-child").addClass("last-p");
	$(".menus-list li a:last-child").addClass("smaller");
	$("#content .right-column .column-block ul li:last-child").addClass("last-li");
	
	var i = 1;

	$("ul#fade li").each( function() {
	    $(this).attr("class", "item-"+i);
	    i++;
	});
	
	$('ul#masonry').isotope({
  		layoutMode: 'spineAlign',
 	 	spineAlign: {
    		gutterWidth: 10
  		},
  		resizesContainer: false
	});
	
	$('#slideshow').slideshow({
		slide_width: 1218
	});
	
	setInterval(function() {
		$('#slideshow').slideshow('gotoNextSlide');
	}, (1000 * 5));

 });
