
if(typeof cdc=="undefined"){cdc={}}if(typeof cdc.homepage=="undefined"){cdc.homepage={}}cdc.homepage.canAnimate=function(){return(navigator.platform.toLowerCase().indexOf("linux")==-1&&!(jQuery.browser.safari&&jQuery.browser.version<500))};
 
(function(A){A.fn.hoverIntent=function(I,H){var J={sensitivity:7,interval:100,timeout:0};J=A.extend(J,H?{over:I,out:H}:I);var L,K,F,D;var E=function(M){L=M.pageX;K=M.pageY};var C=function(N,M){M.hoverIntent_t=clearTimeout(M.hoverIntent_t);if((Math.abs(F-L)+Math.abs(D-K))<J.sensitivity){A(M).unbind("mousemove",E);M.hoverIntent_s=1;return J.over.apply(M,[N])}else{F=L;D=K;M.hoverIntent_t=setTimeout(function(){C(N,M)},J.interval)}};var G=function(N,M){M.hoverIntent_t=clearTimeout(M.hoverIntent_t);M.hoverIntent_s=0;return J.out.apply(M,[N])};var B=function(P){var O=(P.type=="mouseover"?P.fromElement:P.toElement)||P.relatedTarget;while(O&&O!=this){try{O=O.parentNode}catch(P){O=this}}if(O==this){return false}var N=jQuery.extend({},P);var M=this;if(M.hoverIntent_t){M.hoverIntent_t=clearTimeout(M.hoverIntent_t)}if(P.type=="mouseover"){F=N.pageX;D=N.pageY;A(M).bind("mousemove",E);if(M.hoverIntent_s!=1){M.hoverIntent_t=setTimeout(function(){C(N,M)},J.interval)}}else{A(M).unbind("mousemove",E);if(M.hoverIntent_s==1){M.hoverIntent_t=setTimeout(function(){G(N,M)},J.timeout)}}};return this.mouseover(B).mouseout(B)}})(jQuery);

//1st Drop Down

cdc.homepage.quicklinks = {
   listOpen: false,
 
   fixDirection:function() {
      var qul = jQuery('#q1');
      var browht = jQuery.browser.msie?document.documentElement.clientHeight:window.innerHeight;
      var scrolloff = jQuery.browser.msie?document.documentElement.scrollTop:window.pageYOffset;
      var headerht = jQuery("#quicklinks").height();
      var listht = jQuery("#q1").height();
 
      if (jQuery("#quicklinks").offset().top - scrolloff + listht + 50 <= browht) {
         qul.css('top',(headerht+5)+'px').css('bottom','auto');
         jQuery("#quicklinks .control").removeClass('control-up');
         if (! qul.hasClass('ql-corner-bottom') ){
            qul.removeClass('ql-corner-top');
            qul.addClass('ql-corner-bottom')
         }
      }
      else {
         qul.css('top',-listht+'px');
         if (! jQuery("#quicklinks .control").hasClass('control-up') ) jQuery("#quicklinks .control").addClass('control-up') ;
         if (! qul.hasClass('ql-corner-top') ){
            qul.removeClass('ql-corner-bottom');
            qul.addClass('ql-corner-top')
         }
      }
   },
 
   openList:function() {
      if ( !this.listopen ) {
         this.listopen = true;
         this.fixDirection();
         jQuery('#q1').show();
      } else {
         this.listopen = false;
         jQuery('#q1').hide();
      }
   }
 
}
 
jQuery(document).ready(function(){
   jQuery('#quicklinks #q1').css({position:'absolute',display:'none'});
   jQuery('#quicklinks h3').after('<span class="control"></span>');
   jQuery('#quicklinks h3').wrapInner('<a href="javascript:cdc.homepage.quicklinks.openList();"></a>');
/*  It might be nice if tabbing off the list closed it, but this doesn't work with ie */
   jQuery('#quicklinks').hoverIntent(
      function(){
         if (cdc.homepage.canAnimate()) {
         } 
         jQuery('#q1').show();
      },
      function(){
         jQuery('#q1').hide();
      }
   );
});

//2nd Drop Down

cdc.homepage.quicklinks2 = {
   listOpen: false,
 
   fixDirection:function() {
      var qul = jQuery('#q2');
      var browht = jQuery.browser.msie?document.documentElement.clientHeight:window.innerHeight;
      var scrolloff = jQuery.browser.msie?document.documentElement.scrollTop:window.pageYOffset;
      var headerht = jQuery("#quicklinks2").height();
      var listht = jQuery("#q2").height();
 
      if (jQuery("#quicklinks2").offset().top - scrolloff + listht + 50 <= browht) {
         qul.css('top',(headerht+5)+'px').css('bottom','auto');
         jQuery("#quicklinks2 .control").removeClass('control-up');
         if (! qul.hasClass('ql-corner-bottom') ){
            qul.removeClass('ql-corner-top');
            qul.addClass('ql-corner-bottom')
         }
      }
      else {
         qul.css('top',-listht+'px');
         if (! jQuery("#quicklinks2 .control").hasClass('control-up') ) jQuery("#quicklinks2 .control").addClass('control-up') ;
         if (! qul.hasClass('ql-corner-top') ){
            qul.removeClass('ql-corner-bottom');
            qul.addClass('ql-corner-top')
         }
      }
   },
 
   openList:function() {
      if ( !this.listopen ) {
         this.listopen = true;
         this.fixDirection();
         jQuery('#q2').show();
      } else {
         this.listopen = false;
         jQuery('#q2').hide();
      }
   }
 
}
 
jQuery(document).ready(function(){
   jQuery('#quicklinks2 #q2').css({position:'absolute',display:'none'});
   jQuery('#quicklinks2 h3').after('<span class="control"></span>');
   jQuery('#quicklinks2 h3').wrapInner('<a href="javascript:cdc.homepage.quicklinks2.openList();"></a>');
/*  It might be nice if tabbing off the list closed it, but this doesn't work with ie */
   jQuery('#quicklinks2').hoverIntent(
      function(){
         if (cdc.homepage.canAnimate()) {
         } 
         jQuery('#q2').show();
      },
      function(){
         jQuery('#q2').hide();
      }
   );
});

//3rd Drop Down

cdc.homepage.quicklinks3 = {
   listOpen: false,
 
   fixDirection:function() {
      var qul = jQuery('#q3');
      var browht = jQuery.browser.msie?document.documentElement.clientHeight:window.innerHeight;
      var scrolloff = jQuery.browser.msie?document.documentElement.scrollTop:window.pageYOffset;
      var headerht = jQuery("#quicklinks3").height();
      var listht = jQuery("#q3").height();
 
      if (jQuery("#quicklinks3").offset().top - scrolloff + listht + 50 <= browht) {
         qul.css('top',(headerht+5)+'px').css('bottom','auto');
         jQuery("#quicklinks3 .control").removeClass('control-up');
         if (! qul.hasClass('ql-corner-bottom') ){
            qul.removeClass('ql-corner-top');
            qul.addClass('ql-corner-bottom')
         }
      }
      else {
         qul.css('top',-listht+'px');
         if (! jQuery("#quicklinks3 .control").hasClass('control-up') ) jQuery("#quicklinks3 .control").addClass('control-up') ;
         if (! qul.hasClass('ql-corner-top') ){
            qul.removeClass('ql-corner-bottom');
            qul.addClass('ql-corner-top')
         }
      }
   },
 
   openList:function() {
      if ( !this.listopen ) {
         this.listopen = true;
         this.fixDirection();
         jQuery('#q3').show();
      } else {
         this.listopen = false;
         jQuery('#q3').hide();
      }
   }
 
}
 
jQuery(document).ready(function(){
   jQuery('#quicklinks3 #q3').css({position:'absolute',display:'none'});
   jQuery('#quicklinks3 h3').after('<span class="control"></span>');
   jQuery('#quicklinks3 h3').wrapInner('<a href="javascript:cdc.homepage.quicklinks3.openList();"></a>');
/*  It might be nice if tabbing off the list closed it, but this doesn't work with ie */
   jQuery('#quicklinks3').hoverIntent(
      function(){
         if (cdc.homepage.canAnimate()) {
         } 
         jQuery('#q3').show();
      },
      function(){
         jQuery('#q3').hide();
      }
   );
});