(function() {
    if (typeof(TWTR) != "undefined") {
        new TWTR.Widget({
            version: 2,
            type: 'profile',
            rpp: 3,
            interval: 3000,
            width: 354,
            height: 200,
            theme: {
                shell: {
                    background: '#ffffff',
                    color: '#ffffff'
                },
                tweets: {
                    background: '#ffffff',
                    color: '#000000',
                    links: '#0f3377'
                }
            },
            features: {
                scrollbar: true,
                loop: false,
                live: true,
                hashtags: false,
                timestamp: true,
                avatars: false,
                behavior: 'all'
            }
        }).render().setUser('jarcainc').start();

        var head = $$('head')[0];         
        var styleSheetIdx = -1;
        var styleList = head.select('link[rel="stylesheet"]');
        for (var idx = 0; idx < styleList.length - 1; ++idx) {
            if (styleList[idx].href && styleList[idx].href.match(/\/css\/twitter\.css$/)) {
                styleSheetIdx = idx;
                break;
            }
        }
        if (styleSheetIdx == -1) {
            var cssNode = document.createElement('link');
            cssNode.type = 'text/css';
            cssNode.rel = 'stylesheet';
            cssNode.href = basePath + staticPath + '/css/twitter.css';
            cssNode.media = 'all';
            head.appendChild(cssNode);
        } else {
            var linkNode = styleList[styleSheetIdx];
            head.removeChild(linkNode);
            head.appendChild(linkNode);
        }
    }
})();

