(function($) {
  $(window).resize(function() {
    $("#bg-image").css("height", $(window).height());
    $("#bg-image").css("width", $(window).width());
    if($('#stripe-2').length) {
      var offset = $("#stripe-2").offset();
      $("#stripe-2").width($(window).width()-offset.left);
    }
  });
  
  $('a.modal').live('click', function() {
    $(this.href.replace(/.*#/, '#')).dialog('open');
    return false;
  });
  
  $(function() {
    $('#submit').dialog({width:500, height: 500, autoOpen:false, title:"Submit Your Presentation"});
    $('#become-a-sponsor').dialog({width:500, height: 500, autoOpen:false, title:"Sponsorship Packages"});
    $(window).trigger('resize');
    
    $.Juitter.start({
      searchType:"searchWord",        // needed, you can use "searchWord", "fromUser", "toUser"
      searchObject:"greatlakesruby -RT",  // needed, you can insert a username here or a word to be searched for, if you wish multiple search, separate the words by comma.
      live:"live-120", // the number after "live-" indicates the time in seconds to wait before request the Twitter API for updates.
      placeHolder:"juitterContainer", // Set a place holder DIV which will receive the list of tweets example <div id="juitterContainer"></div>
      loadMSG: "Loading messages...", // Loading message, if you want to show an image, fill it with "image/gif" and go to the next variable to set which image you want to use on 
      total: 5, // number of tweets to be show - max 100
      // readMore: "Read it on Twitter", // read more message to be show after the tweet content
      nameUser:"image", // insert "image" to show avatar of "text" to show the name of the user that sent the tweet 
      openExternalLinks:"newWindow" // here you can choose how to open link to external websites, "newWindow" or "sameWindow"
    });

    // un-comment this when we start getting the speaker lineup
    $('#speakers li.speaker').hover(function() {
      $('#speakers .active').removeClass('active');
      $(this).addClass('active');
    }, function() {});
    $('#speakers li.speaker:first').addClass('active');
  });
})(jQuery);
