$(document).ready(function() {

		var now = new Date();
		$('#datepicker').datepicker({ beforeShowDay: highlightDays,dateFormat: 'yy-mm-dd',  onSelect: function(dateText, inst) {
			$("#frmdatumForm-datum").val(dateText).trigger('change');
		} });

		function highlightDays(date) {

			for (var i = 0; i < dates.length; i++) {
			  if((date.getYear() == now.getYear()) && (date.getMonth() == now.getMonth()) && (date.getDate() == now.getDate())) {
        	  	return [true,'ui-state-highlight','Dnes']
        	  }
        	  else {
        	  	if (dates[i][0] <= date && dates[i][1] >= date) {
               		return [true, 'ui-state-active, ui-widget-content, ui-state-active', dates[i][2]];
               	}
        	  }
			}
			return [true, ''];
		}
 });
