var cssObj = {
         "position":"absolute",
         "z-index":7
      }
var cssObj2 = {
         "position":"absolute",
         "z-index":1001,
         "background-color":"#555",
         "height":"47px",
         "overflow":"hidden",
         "width":"438px"
      }

function onBefore() {
   if ($.browser.msie) {
      $('.headlineOverlay').css(cssObj);
      $('.newestIndexText').css(cssObj2);
   }
}

function onAfter() { 
   $('.headlineOverlay').opacity("0.5");
}

$.fn.opacity = function(amount) {
   if (amount > 1) amount = 1;
   if (amount < 0) amount = 0;
   if ($.browser.msie) {
      amount = (parseFloat(amount) * 100);
      this.css('opacity', amount);
      this.css('filter', 'alpha(opacity='+amount+')');
   } else {
      this.css('opacity', amount);
      this.css('-moz-opacity', amount);
   }
   return this;
}

$(document).ready(function() {
   
   $('#box_list_banner').css('display','inline');
   $('#cycle_play').hide();

   $('#box_list_banner').cycle({ 
      fx: 'fade', 
      speedIn: 1000, 
      speedOut: 1000, 
      delay: -1000,
      timeout: 3000,
      before: onBefore,
      pause: 1,
      pauseOnPagerHover: false,
      forcePause: 0,
      pager: '#cycle_index'
});

   $('a#cycle_stop').click(function() {
      $('#box_list_banner').cycle('pause');
      $('#cycle_play').show();
      $('#cycle_stop').hide();
   });
   
   $('a#cycle_play').click(function() {
      $('#box_list_banner').cycle('resume');
      $('#cycle_play').hide();
      $('#cycle_stop').show();
   });
   
   $('a#cycle_next').click(function() {
      $('#box_list_banner').cycle('nextCycle');
      $('#cycle_play').show();
      $('#cycle_stop').hide();
   });
   
   $('a#cycle_prev').click(function() {
      $('#box_list_banner').cycle('prevCycle');
      $('#cycle_play').show();
      $('#cycle_stop').hide();
   });
});
