$(document).ready(function(){
	//$(".entry").find("span").css("border", "2px red solid");
	screenWidth();					   		   
});

//nastavenipozadí
function screenWidth() {
	//alert("Rozlišení je větší než 1024x768. Width - "+screen.width+" Height - "+screen.height);
	if ($(document).width()>1023) {
		//alert("hi");
		$("body").addClass("sticky-true");
	} else {
		//alert("low");
		$("body").addClass("sticky-false");
	}	
}

function imageInfoDrak() {
	$(".entry .popup-box").css({'bottom':'-100%'});
	$(".entry").hover(
		function() {
			/* if ($.support.opacity) {
					$(this).find(".popup-box").stop().animate({"bottom": "0", opacity: 1}, "fast");
			 } else {
				 	$(this).find(".popup-box").stop().animate({"bottom": "0", filter: 'alpha(opacity=100)'}, "fast");
			 }			*/
			$(this).find(".popup-box").stop().animate({"bottom": "0"}, "fast");
		},
		function() {
			/*if ($.support.opacity) {
					$(this).find(".popup-box").stop().animate({"bottom": "-100%", opacity: 0}, "fast");
			 } else {
				 	$(this).find(".popup-box").stop().animate({"bottom": "-100%", filter: 'alpha(opacity=0)'}, "fast");
					//jQuery('#list_box').animate({filter: 'alpha(opacity=100)',height: '300px',top: newTop},{duration: 300});
			 }	*/
			$(this).find(".popup-box").stop().animate({"bottom": "-100%"}, "slow");
	});		
}

function fotogalery(id) {
	$("a[rel="+id+"]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Obrázek ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});	
}

function SendEmail() {
	//alert("xxx");
	var email = $("#send_email");
	var email_reg = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$"); 
	
	if (!email.val()) {alert("Zadejte emailovou adresu!!!!"); return false}
	if (email.val().indexOf('@')==-1 || email.val().indexOf('.')==-1) {alert("Zadaly jste špatný formát emailové adresy.!!!!"); return false; } 
	$("#emailing").submit();
   
}


	

