/* This code changes the DOM, altering element ids and class names so that the grid-box blocks * are in a flexible grid. Right now, this code is written for having 12 blocks; * four rows of three blocks. A row is specified by a div with the class "row". * In each row, the col_# must add up to twelve. So in a row of three, the divs have the class "col_4". * The last div in each row must also have the class "last". */ $(document).ready(function() { var block = $( "#grid-box-wrapper .block" ); block.addClass( "grid-box col_4" ).removeClass( "block block-block" ); for ( var i = 0; i < block.length; i++ ) { block.eq( i ).attr( "id", "grid-box-" + ( i + 1 ) ); if ( ! ( ( i + 1 ) % 3 ) ) { block.eq( i ).addClass( "last" ); } } // insert the div row tags where needed. block.slice( 0, 3 ).wrapAll( "