// Script to make the footer do it's thang
$(document).ready(function(){
	$('ul.blue-links').each(function() {
	  $(this).children('li').slice(5).addClass('most-right');
	  $(this).children('li').children('a:not(:has(li))').each(function() {
	    if($(this).next('div').length == 0) return true;

	    var siblingLinks = $(this).parent().siblings().find('a:not(:has(li))');
	    var timeout = null;

	    $(this).mouseenter(function() {
	      if(timeout) { clearTimeout(timeout); timeout = null; }
	      siblingLinks.trigger('shoo');
	      $(this).addClass('selected').next('.footer-pop:hidden').stop().fadeIn('fast', function() {
	        $(this).addClass('popped').css({opacity: 1});
	      });
	      return false;

	    }).bind('shoo', function() {
	      if(timeout) { clearTimeout(timeout); timeout = null; }
	      $(this).removeClass('selected').next('.footer-pop:visible').removeClass('popped').stop().fadeOut(50);
	      return false;
		
	    }).parent().mouseleave(function() {
	      if(timeout == null) {
	        var $a = $(this).find('a');
	        timeout = setTimeout(function() {
	          $a.trigger('shoo');
	        }, 3000);
	      }
	    });

	    return true;
	  });
	});
});