jQuery('html').addClass('js');

jQuery(function($) {
  
  $(window).bind('load', function(event) {
    if (typeof pageInit != 'undefined') {
      pageInit();
    }  
  });
  var $netData = $('#network-data tbody');
  $netData
    .find('td:first-child').addClass('colhead')
    .end()
    .find('tr:nth-child(odd)').addClass('alt');
    
    
  $('div.additional-options a:has(img)').each(function(index) {
    var $this = $(this);
    var bubbleText = $('img', this).attr('alt');
    $this.append('<span class="bubble">' + bubbleText + '</span>')
      .hover(function() {
        $this
          .find('img').attr('alt', '')
          .end()
          .find('span').fadeIn(200);
      }, function() {
        $this
          .find('img').attr('alt', bubbleText)
          .end()
          .find('span').hide();
      });
  });
});


// Cycle images 

jQuery(document).ready(function($) {
  var $body = $('body');
  if ($body.hasClass('home')) {
    $('div.home-banner ul').cycle({timeout: 7000});
    // $('#comment-container').cycle();
  } else if ($body.hasClass('page') && $('#sidebar div.image-body img').length > 1) {
    
    $('div.image-body').cycle({timeout: 6000});
  }
});


