
//Standard variables
var loading = false;
var contentHandler = "/_handlers/loader/content.ashx";
var videoHandler = "/_handlers/loader/bcvideo.ashx";
var addThisUrl = "";
var xidUrl = "";
var elListing;
var elListingLoad;
var elListingLoading = false;
var elListingTimout;

$(document).ready(function() {

   elListingLoad = $('.newsListingWrap .updListLoader');

   //Hover over
   $('.hoverText').mousemove(function(e) {
      var el = $(this);
      var elPopover = $('.popoverHover');
      var mouseX = e.pageX;
      var mouseY = e.pageY;
      var thisWidth = elPopover.width();
      var thisHeight = elPopover.height();
      if (el.attr('rel') == "low") {
         mouseY = mouseY + 10;
      }
      elPopover.css({ 'left': (mouseX - Math.floor(thisWidth / 2) - 10) + 'px', 'top': (mouseY - 15 - thisHeight) + 'px' });
   });
   $('.hoverText').mouseover(function() {
      $('.popoverHover').html($(this).attr('title'));
   });
   $('.hoverText').mouseout(function() {
      $('.popoverHover').html('&nbsp;');
      $('.popoverHover').css('top', '-100px');
   });


   //Drop Down Box an alternative option to select items
   var ddBoxDefaultHeight = 0;
   $('.dropDownBox .arrow').click(function() {
      var ddBox = $(this).parent();
      var ddBoxList = ddBox.find('.labelLinks');
      if (ddBoxDefaultHeight == 0) {
         ddBoxDefaultHeight = ddBoxList.height();
      }
      ddBoxList.css('height', 'auto');
      var newHeight = ddBoxList.height();
      ddBoxList.css('height', ddBoxDefaultHeight + 'px');
      ddBoxList.animate({ height: newHeight + 'px' });
      return false;
   });
   $('.dropDownBox').hover(
     function() {
        if (ddBoxDefaultHeight == 0) {
           var ddBoxList = $(this).find('.labelLinks');
           ddBoxDefaultHeight = ddBoxList.height();
        }
     },
     function() {
        var ddBoxList = $(this).find('.labelLinks');
        ddBoxList.animate({ height: ddBoxDefaultHeight + 'px' });
     }
   );

});


