window.onscroll = function()
{
	if( window.XMLHttpRequest ) {
		if (document.documentElement.scrollTop > 600 || self.pageYOffset > 600) {
			$('#damask').css('position', 'fixed');
			$('#damask').css('top', '0');
		} else if (document.documentElement.scrollTop < 600 || self.pageYOffset < 600) {
			$('#damask').css('position', 'absolute');
			$('#damask').css('top', '600px');
		}
	}
}

$(document).ready(function(){
	// flash msg
	var d = $('.flash').size();
	$('body').mousemove(function(){
	$('.flash').each(function() {
		var delay = d-- * 1000;
		$(this).click(function() {
			$(this).hide();
		});
		$(this).delay(delay).fadeOut('slow');
	});
	});
	
	if ($('input.datetimepicker').length > 0) {
		$('input.datetimepicker').datepicker({
			duration: '',
			dateFormat: 'dd.mm.yy',
			changeMonth: true,
			changeYear: true,
			yearRange: '2010:2020',
			showTime: true,
			time24h: true,
			stepMinutes: 5,
			currentText: 'Dnes',
			closeText: 'OK'
		});
	}
	Shadowbox.init();

});

