jQuery.noConflict();
jQuery(document).ready(function(){
	var width = jQuery(window).width();
	var height= jQuery(window).height();
	var aheight= jQuery(document).height();
	
	var schovat = false;
	var pruhlednepozadi = jQuery("<div>").css({
		'width' : width,
		'height' : aheight,
		'position':'absolute',
		'top': 38,
		'left' : 0,
		'background' : 'white',
		'opacity': 0.8,
		'display' : 'none'
	}).addClass('pruhledne_pozadi');
	jQuery('#login_form').click(function(){
		if (schovat == false){
			jQuery('.login').fadeIn('slow');
			schovat=true;
		}else{
			jQuery('.login').fadeOut('slow');
			schovat=false;
		}
	});
	
	jQuery(".klikni").click(function(){
		jQuery("#hlavicka").hide();
		jQuery(".flashmapa").hide();
		var posun = jQuery(document).scrollTop();
		jQuery(".telo").append(pruhlednepozadi);
		jQuery(".pruhledne_pozadi").show();
		jQuery(".flashBox").css({
			'top':posun + height/2	- jQuery(".flashBox").height()/2,
			'left': width/2	- jQuery(".flashBox").width()/2,
			'opacity' : 0.9
		});
		jQuery(".flashBox").show();
	});
	jQuery(".zavrit_flash_okno").click(function(){
		jQuery(".flashBox").hide();
		jQuery(".pruhledne_pozadi").remove();
		jQuery(".flashmapa").show('fast');
		jQuery("#hlavicka").show('fast');
		jQuery('html, body').animate({scrollTop:0}, 'normal');
	});
	
	jQuery(".read").click(function (){  
			jQuery(this).next().next(".hideClass").slideToggle(300);  
				if( jQuery(this).html() == "+")  
 				jQuery(this).html("-");  
				 else  
 				jQuery(this).html("+");  
	});  

	jQuery(".napiste_nam").click(function(){
		jQuery("#hlavicka").hide();
		jQuery(".flashmapa").hide();
		var posun = jQuery(document).scrollTop();
		jQuery(".telo").append(pruhlednepozadi);
		jQuery(".pruhledne_pozadi").show();
		var data="ZobrazInformacniEmail=form";
		jQuery.ajax({
			type: "POST",
			url: "informacni_email.php",
			data: data,
			success: function(msg){
				var posun = jQuery(document).scrollTop();
				jQuery(".telo").append(jQuery("<div></div>").addClass("boxEmail"));
				jQuery(".boxEmail").css({
					'top':posun + height/2	- jQuery(".boxEmail").height()/2,
					'left': width/2	- jQuery(".boxEmail").width()/2
				});
				jQuery(".boxEmail").append(msg);
				jQuery(".informacni_email").submit(function(){
					var email = jQuery(this).serialize();
					jQuery.ajax({
						type: "POST",
						url: "informacni_email.php",
						data: email,
						success: function(msg){
							jQuery(".boxEmail").html("").html(msg).delay(1000).fadeOut('slow',function(){
								jQuery(".pruhledne_pozadi").remove();
								jQuery(".flashmapa").show('fast');
								jQuery("#hlavicka").show('fast');
								jQuery('html, body').animate({scrollTop:0}, 'normal');
							});
						
						}
					})
					return false;
				});
					
				
		
			}
		});
		
	});
	jQuery("#printPage").click(function() {
		jQuery("#printPage").css("display","none");
		printElem();
    });
	function printElem(options){
	    jQuery('.entry').printElement(options);
	    jQuery("#printPage").css("display","inline");
	 }
	


});


