(function($) {
	$(function() {
		picker = $('#fecha').datepicker({
			defaultDate: fecha,
			beforeShowDay: function(date) {
				if(eventos[date.getDate()] != null) {
					return [true, '', eventos[date.getDate()]];
				} else {
					return [false, '', ''];
				}
			},
			onChangeMonthYear: function(year, month, inst) {
				document.location = '/Eventos/' + year + '/' + month;
				picker.setDate(fecha);
			},
			onSelect: function(dateText, inst) {
				document.location = '/Eventos/' + dateText;
				picker.setDate(fecha);
			},
			showOtherMonths: true
		});
		
		$('.menu a').click(function() {
			$.scrollTo($(this).attr('href'), 'slow');
			return false;
		});

		$('a[rel=colorbox]').colorbox();		
		
		var correo = $('input.correo');
		correo
			.data('texto-inicial', correo.val())
			.focus(function() {
				if($(this).data('texto-inicial') == $(this).val()) {
					$(this).val('');
				}
			})
			.blur(function() {
				if($(this).val() == '') {
					$(this).val($(this).data('texto-inicial'));
				}
			});
	});
})(jQuery);
