(function ($) {

/**
 * Front_Datepicker
 * @constructor jQuery
 *
 */
$.widget('ui.Front_Schedule_ForADay', $.extend({}, $.ui.Component.prototype, {
	type: 'Front_Schedule_ForADay',
	_init: function () {
		$.ui.Component.prototype._init.call(this) // chain parent constructor

		var self = this;

		function slideer() {
			obj = $("div.dropdownMenu")
			if($('#ForADay_Menu', obj).css("display") == 'none' ){
				$('.menuFirst', obj).addClass('slideDown')
				$('#ForADay_Menu', obj).slideDown(200)
			} else {
				$('#ForADay_Menu', obj).slideUp(200, function(){$('.menuFirst', obj).removeClass('slideDown')})
			}
		}

		$('#ForADay_btn').click(function (ev) {
			ev.preventDefault()
			slideer()
		})

		$(".tvProgrammLeft tr").click(function () {
			if($('td.borderBlack div', this).css("display") == 'none' ){
				$('.tvProgrammLeft tr').removeClass("current")
				$('td.borderBlack div').slideUp(10)
			}
			$(this).toggleClass("current")
			$('td.borderBlack div', this).slideToggle(10)
		})
	}
}));

}).require('Component')(jQuery);