// JavaScript Document

 // Related Information Drop Down
$(function() {
$('#Related-Information').hide();
$('a[title="Related-Information"]').click(function() {
$('#Related-Information').slideToggle('slow');
return false;
});
});
 
 // COTD And Weather Popout
 
 
$(function () {
  $('.bubbleInfo').each(function () {
     var distance = 10;
    var time = 250;
    var hideDelay = 2000;
     var hideDelayTimer = null;
     var beingShown = false;
    var shown = false;
     var trigger = $('.trigger', this);
    var popup = $('.bdipopup', this).css('opacity', 0);
     $([trigger.get(0), popup.get(0)]).click(function () {
       if (hideDelayTimer) clearTimeout(hideDelayTimer);
       if (beingShown || shown) {
        return;
      } else {
        beingShown = true;
         popup.css({
          top: -150,
          left: 50,
          display: 'block' // brings the popup back in to view
          })
         .animate({
          top: '-=' + distance + 'px',
          opacity: 1
        }, time, 'swing', function() {
           beingShown = false;
          shown = true;
        });
      }
    }).mouseout(function () {
       if (hideDelayTimer) clearTimeout(hideDelayTimer);
       hideDelayTimer = setTimeout(function () {
        hideDelayTimer = null;
        popup.animate({
          top: '-=' + distance + 'px',
          opacity: 0
        }, time, 'swing', function () {
           shown = false;
           popup.css('display', 'none');
        });
      }, hideDelay);
    });
  });
});


 // Links Border Right
 
         	$(function() {
				$("#bottomLinks a:last").css("border", "none");
				$("#topLinks a:last").css("border", "none");
				$("#relatedInfo a:last").css("border", "none");
				$("#leftLinks a:last").css("border", "none");
			});
			
			
			
// Image Float Left And Right

        	$(function() {
				$("#bdicontent img:odd").css("float", "right");
					$("#bdicontent img:even").css("float", "left");

			});
			
			
			
// Pre Load Image For Background Of PopDrop  // Still Not To Sure If I Did That Right
			
			jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}


$.preloadImages("/images/popupbk.png");

 
 