// ----- Carousel

$j(document).ready( function() {
	$j('#scroller').billy({
		slidePause: 8000
	});
});

$j(function(){
  // Accordion
  $j("#accordion").accordion({ header: "h4.handle", autoHeight: false, icons:false });

  // Tabs
  $j('#menus').tabs();

  // Datepicker
  $j('#datepicker').datepicker({
  inline: true,
  minDate: '-0d',
  dateFormat: 'd M yy',
  beforeShowDay: function(date) {
      opening = new Date(2011,1,14,'00','00','00');
      //console.log(opening);
      //console.log(opening.getTime);
      //console.log(date.getTime);

      if(date.getTime() < opening.getTime())
      {
          return Array(false);
      }
      else
      {
          return Array(true);
      }
  }
});

  //hover states on the static widgets
  $j('#dialog_link, ul#icons li').hover(
   function() { $(this).addClass('ui-state-hover'); },
   function() { $(this).removeClass('ui-state-hover'); }
  );
});
