$(document).ready(function() {
    $(window).resize(function() {
        $('.header #logo').css('margin-left', ($(window).width() - 896)/2);
    });
    $('.header #logo').css('margin-left', ($(window).width() - 896)/2);
    $.getJSON("http://twitter.com/statuses/user_timeline/colornm.json?callback=?", function(data) {
        $("#tweets").html(data[0].text);
    });
    $('.twitter').mouseover(function() {
        $('#tweets').css('display', 'block');
    });
    $('.twitter').mouseout(function() {
        $('#tweets').css('display', 'none');
    });
    
    carouselwidth = 0;
    currentslide = 0;
    $('#showcase ul li').each(function() {
        carouselwidth += 800;
    });
    $('#showcase ul').width(carouselwidth);
    totalslides = Math.ceil(carouselwidth / 800);
    
    $('#showcase-navigation .prev').click(function() {
        if(currentslide > 0) {
            currentslide -= 1;
            pos = currentslide * -800;
            $('#showcase ul').stop().animate({marginLeft:pos+'px'},800);
        }
        return false;
    });
    $('#showcase-navigation .next').click(function() {
        if(currentslide < totalslides-1) {
            currentslide += 1;
            pos = currentslide * -800;
            $('#showcase ul').stop().animate({marginLeft:pos+'px'},800);
        }
        return false;
    });
});

var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-618375-10']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

