//Big thanks to Ingo Birkenstock for helping with tooltip positioning
//Here is his tutorial http://webagentur-meerbusch.de/blog/2009/12/tooltip-als-men-zentrietes-nutzen/
//
// Robert Waters - B&W Tek, Inc.
$(document).ready(function (){

	$(document.body).addClass('js');
	$("ul#Navigation a").tooltip();
       (function () {
           var animating = false;
           var Item = $("ul#Navigation > li");
           var Tooltip = Item.children('div.b1,div.b2,div.b3,div.b4,div.b5,div.b6'); // Here is the Container  
           function resetCss(el) {
               el.css({
                   visibility: 'visible'
               });
           }
           Item.each(function (numItems) {
               var Items = $(this);
               var Tooltip_over = Tooltip.eq(numItems);
               Items.hover(function (e) {
                   if (animating) {
                       Tooltip.stop().hide();
                       resetCss(Tooltip);
                       Tooltip_over.show();
                       animating = false;
                   } else {
                       Tooltip_over.fadeIn(0); // If you use PNG Background, dont fade, IE cant show this 
                       animating = true;
                   }
               }, function (e) {
                   animating = true;
                   Tooltip_over.stop();
                   resetCss(Tooltip_over);
                   Tooltip_over.fadeOut(0).queue(function () { // If you use PNG Background, dont fade, IE cant show this 
                       animating = false;
                       Tooltip.dequeue();
                   });
               });
           });
       })(); 	
 });
  