  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-3010495-3']);
  _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);
  })();

  
google.load("feeds", "1");

function initialize() {
  var feed = new google.feeds.Feed("http://www.facebook.com/feeds/page.php?id=197776023610747&format=rss20");
  feed.load(function(result) {
    if (!result.error) {
      var container = document.getElementById("feed");
      container.innerHTML = "";
      // loads 4 entries by default
      for (var i = 0; i < result.feed.entries.length; i++) {
        var entry = result.feed.entries[i];
        var div = document.createElement("div");
        if (i == 3) {
          div.className = "feed-container-last";
        }
        else {
           div.className = "feed-container";
        }
        
        var dateText = entry.publishedDate.substring(0, entry.publishedDate.length - 15); //" 16:32:40 -0700"; // 15
        
        var html = "<div class=\"feed-content\">" + entry.content + "</div>" + 
                   "<div class=\"feed-data\">posted <span class=\"feed-date\">" + dateText + "</span>" +
                   " from " + "<a href=\"" + entry.link + "\" target=\"_blank\">Facebook</a><hr/>";
        
        div.innerHTML = html;
        
        container.appendChild(div);
      }
    }
  });
}
google.setOnLoadCallback(initialize);


//  $(function() {
//    $("#about").hide();
//
//    $("#splash-link").click(function() {
//      //$("#about").height($("#splash").height() - 50);
//      var href = $(this).attr("href");
//      $.bbq.pushState({
//        url : href
//      });
//      return false;
//    });
//    
//    $("#logo-link").click(function() {
//      var href = $(this).attr("href");
//      $.bbq.pushState({
//        url : href
//      });
//      return false;
//    });
//
//    $(window).bind("hashchange", function(e) {
//      var url = $.bbq.getState("url");
//      if ("#about" === url) {
//        $("#splash").fadeOut("fast", function() {
//          $("#about").fadeIn("fast");
//        });
//      }
//      else {
//        $("#about").fadeOut("fast", function() {
//          $("#splash").fadeIn("fast");
//        });
//      }
//    });
//    
//    $(window).trigger("hashchange");
//  });
$(window).load(function() {
  $('#featured').orbit({
    bullets: false,
    timer: true,
    directionalNav: false
  });
  
  //alert(Modernizr.audio);
  if (Modernizr.audio) {
    $('#flash-player').hide();
  }
  else {
    $('#html-player').hide();
  }
});

function showModal(id) {
  //_trackEvent('banner-clicks', id);
  _gaq.push(['_trackEvent', 'banner-clicks', id, 'banner clicked']);
  $('#' + id).reveal();
}
