title: Wrap first/last 2 posts in different containers
body: <p>I am trying to create a similar featured section like on <a href="http://dicedandspiced.com/" rel="nofollow noreferrer">this site</a>. The script that I'm using is the one below but the problem is that I have just one item variable and I'm not able to add posts on the left/right side of the middle one since all the posts are wrapped the same. How can I style each post separately? I want to wrap the first and last 2 posts in a div container so that I can put the large one in the middle.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script type='text/javascript'&gt;
    function mycallback(json) {
      for (var i = 0; i &lt; json.feed.entry.length; i++) {
        for (var j = 0; j &lt; json.feed.entry[i].link.length; j++) {
          if (json.feed.entry[i].link[j].rel == 'alternate') {
            var postUrl = json.feed.entry[i].link[j].href;
            break;
          }
        }
        var postTitle = json.feed.entry[i].title.$t;
        var postAuthor = json.feed.entry[i].author[0].name.$t;
        var postSummary = json.feed.entry[i].summary.$t;
        var entryShort = postSummary.substring(0,400);
        var entryEnd = entryShort.lastIndexOf(" ");
        var postContent = entryShort.substring(0, entryEnd) + '...';
        var postImage = json.feed.entry[i].media$thumbnail.url.replace('s72-c/','s1600/');
        var item = '&lt;div class="wrapper"&gt;&lt;img src="' + postImage + '"/&gt;&lt;h3&gt;&lt;a href=' + postUrl + '&gt;' + postTitle + '&lt;/h3&gt;&lt;/a&gt;&lt;span&gt;'+ postAuthor + '&lt;/span&gt;&lt;p&gt;' + postContent + '&lt;/p&gt;&lt;/div&gt;';
        document.write(item);
      }
    }
  &lt;/script&gt;
  &lt;script src="/feeds/posts/summary?orderby=published&amp;max-results=5&amp;alt=json-in-script&amp;callback=mycallback"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>