﻿new function() {
    tilt.attachEvent(document, "contentreceived", function() {
        /* debugging */ try {
        var c = __layout.distribute(document.getElementById("content"), ["flickr", "description"], "related");
        var content = __layout.appendNode("l-col-2");
        __layout.appendNode("l-col-2").className = "l-bottom";
        content.className = "l-content";
        var titling = document.getElementById("titling");
        if (titling) {
            __layout.prettifyTitling(titling, content);
            __layout.appendNode(titling, content);
        }
        __layout.appendNode(c.description, content);
        __layout.appendNode("l-title-bottom", content).className = "l-title-bottom";
        var last = __layout.getFeed("last-post");
        if (last) {
            __layout.addLinkaroo(last);
            __layout.appendNode(last, content);
        }
        __layout.appendNode(__layout.feeds["links"], "l-col-3");
        var flickr = c.flickr && c.flickr[0];
        if (flickr) {
            __layout.appendNode(flickr, "l-col-3");
            __layout.initFlickrGroups(flickr, 10);
       }
        __layout.appendNode(__layout.feeds["web2"], "l-col-3");
        var posts = __layout.appendNode("l-recent-posts", "l-bottom-hook");
        __layout.appendNode(__layout.feeds["recent-posts"], "l-recent-posts");
        
        __layout.onwide = function() {
            __layout.appendNode("l-recent-posts", "l-col-4");
        }
        
        __layout.onnarrow = function() {
            __layout.appendNode("l-recent-posts", "l-bottom-hook");
        }
        
        __layout.relativizeDates(document.getElementById("form"), "posted");

        __layout.finalize("l-profile");

        /* debugging */ } catch(e) { alert(e) }
    });
}
