$(function() {
  Cufon.replace('.sharedfeaturesh3', { fontFamily: 'MetaPro-Bold' });
  Cufon.replace('#content-bottom h1', { fontFamily: 'MetaPro-Bold' });
  Cufon.replace('.sharedplan h1', { fontFamily: 'MetaPro-Medium' });
  $('#content_overview').show();
  $('#contenttopnav_overview li a').addClass("activetab");
  $('#content_features').hide();
  $('#contenttopnav_features li a').addClass("inactivetab");
  
  $('#gmailmoreinfobutton').click(function() {
    if (confirm("Leave lithiumhosting.com?")) {
      window.open('http://www.google.com/apps/intl/en/group/index.html');
    } else {
      return false;
    }
  });
  
  $('#whmcsmoreinfobutton').click(function() {
    if (confirm("Leave lithiumhosting.com?")) {
      window.open('http://www.whmcs.com/members/aff.php?aff=999');
    } else {
      return false;
    }
  });
  
  $('#viewallsslbutton').click(function() {
    window.location='/ssl.html';
    return false;
  });
  
  
  $.address.init(function(event) {
    if (event.value == '/') {
      event.value = '/overview';
    }
  }).change(function(event) {
    if (event.value == '/') {
      event.value = '/overview';
    }
    var selection = $('a[rel=address:' + event.value + ']');
    $('.activetab').addClass('inactivetab').removeClass('activetab');
    var clicked_button = selection.parent().attr('id');
    var div_to_show = clicked_button.replace('contenttopnav', 'content');
    $('#contenttopnav li').each(function() {
      if ($(this).attr('id') == clicked_button) {
        if (div_to_show == 'content_overview') {
          $('.contentbody').css({'overflow' : 'visible'});
        } else {
          $('.contentbody').css({'overflow' : 'hidden'});
        }
        $('#' + clicked_button + ' a').removeClass('inactivetab').addClass('activetab');
      } else {
        $('#' + $(this).attr('id') + ' a').removeClass('activetab').addClass('inactivetab');;
      }
    });
    $('.sharedcontent').hide();
    $('#' + div_to_show).show();
  });
});
