jQuery(function($) {


     //$('.gallery.new dl:nth-child(3n+1)').css('clear', 'left');

     $('ul.blogroll').before('<h2>Dope Sites &amp; Blogs</h2>');

     $('#respond .comment-form-author label').append('<span class="asterisk">*</span>');
     $('#respond .comment-form-email label').append('<span class="asterisk">*</span>');

     $('div.pageRecent').prepend('<h2>View More Recent Members</h2>');

     // Set up the tabbing
     $(".tabber").each(function() {
       $(this).children('div').each(function() {
         $(this).addClass('tabbed-content');
       });
       var tabberId = $(this).attr('id');
       var cookiedTab = $.cookie(tabberId);
       if (cookiedTab == null) {
         var cookiedTab = "0";
       };
       $(this).children('.tabbed-content:eq(' + cookiedTab + ')').addClass('visible');
       $(this).children('.tabbed-content:first').before('<div class="tab-controls"></div>')
       $(this).children('.tabbed-content').children('h3').each(function(index) {
         var $tabTitle = $(this).text();
         $(this).closest('.tabber').children('.tab-controls').append('<span>' + $tabTitle + '</span>');
         $(this).remove();
       });
       $(this).children('.tab-controls').children('span:eq(' + cookiedTab + ')').addClass('active-tab');
     });
     // Handle the clicking
     $('.tab-controls span').click(function() {
       if ($(this).hasClass('active-tab')) {
       } else {
         var index = $(this).parent().children().index(this);
         var tabberId = $(this).closest('.tabber').attr('id');
         $.cookie(tabberId, index, { expires: 1, path: '/' });
         $(this).siblings().removeClass('active-tab');
         $(this).addClass('active-tab');
         $(this).parent().siblings('.visible').removeClass('visible');
         $(this).parent().siblings('div:eq(' + index + ')').addClass('visible');
       };
     });


      function addLoadEvent(func) {
             var oldonload = window.onload;
             if (typeof window.onload != 'function') {
                     window.onload = func;
             } else {
                     window.onload = function() {
                             if (oldonload) {
                                     oldonload();
                             }
                             func();
                     }
             }
     }

     $("#topNav li").bind("mouseenter", function(){
          $(this).addClass("over");
     });

     $("#topNav li").bind("mouseleave", function(){
          $(this).removeClass("over");
     });

     $(".tab-controls span").bind("mouseenter", function(){
          $(this).addClass("over");
     });

     $(".tab-controls span").bind("mouseleave", function(){
          $(this).removeClass("over");
     });

     $("#featurePhotoBox .feat").bind("mouseenter", function(){
          $(this).addClass("over");
     });

     $("#featurePhotoBox .feat").bind("mouseleave", function(){
          $(this).removeClass("over");
     });

     $(".gallery .gallery-item").bind("mouseenter", function(){
          $(this).addClass("over");
     });

     $(".gallery .gallery-item").bind("mouseleave", function(){
          $(this).removeClass("over");
     });

     $("#galleryIndex .galItems .gal").bind("mouseenter", function(){
          $(this).addClass("over");
     });

     $("#galleryIndex .galItems .gal").bind("mouseleave", function(){
          $(this).removeClass("over");
     });
});



jQuery(function($) {

  if ($('body').hasClass('logged-in')) {
    $('#login-link').addClass('loggedIn').text('Logout');
    $('.signIn .logText span').text('Logged In');
  } else {
    $('#login-link').addClass('loggedOut').text('Login');
    $('.signIn .logText span').text('Logged Out');
  };

  $('#login-link.loggedOut').click(function() {
    $('#login-form').slideToggle('slow');
	return false;
  });

  $('#login-link.loggedIn').live('click', function() {
		$('#login-link').removeClass("loggedIn");
		$('#login-link').addClass('loggedOut').text('Login');
		 window.location = '/wp-login.php?action=logout&redirect_to=http://concreteloop.buzznetdev.com&_wpnonce=62012300a3';
		return false;
  });

});

