B1.calendar_new = function() {
  return {
	  
	  page: function() {
	  B1.page();
	  $(function() {
		  B1.calendar_new.scroller();
		  //$('.calendar .cell .graying').show();
    	  /*$('.calendar .cell').hover(function () {
    		$('.graying', this).slideUp();
    	  }, function () {
    		  $('.graying', this).slideDown();
    	  });*/
	  });
  	},
  	
  	refresh: function () {
  	  //$('.calendar .cell .graying').show();
  	 /* $('.calendar .cell.last').hover(function () {
  		$('.graying', this).slideUp();
  	  }, function () {
  		  $('.graying', this).slideDown();
  	  });*/
  	},
	  
	  scroller: function(selector) {
  		var selector = selector || '.scroller .calendar';
  		$(selector).cycle({
  			fx: 'fade',
  			height: 180,
  			timeout:       0,
  			startingSlide: 0,
  			continuous:    0,
  			cleartype: 1,
  			next: '.scroller div.r a',
  			prev: '.scroller div.l a',
  			before: function (curr, next, opts, fwd) {
  				$('.cell .graying').hide();
  			},
  			after: function (curr, next, opts, fwd) {
  				$('.cell .graying').show();
  			
    				if (opts.currSlide == (opts.slideCount-1)) {
    					$('.scroller div.r a').hide();
      				}
              else {
      					$('.scroller div.r a').show();
      				}
    				if (opts.currSlide == 0) {
    					$('.scroller div.l a').hide();
      				} else {
      					$('.scroller div.l a').show();
      				}
      				
          }
  	 });
  	 return this;
	  }
  };
}();




