
$(document).ready(function(){

	
	$("a img, .hoverIt, input[type=image]").hover(
      function () {
        $(this).fadeTo("fast", 0.8);
      }, 
      function () {
        $(this).fadeTo("fast", 1);
      }
	);
	
	if ($(window).height()-155 > 525) {
		$(".container").css("height", $(window).height()-155);
		$(".containerIn").vAlign();
	};
	
	$("#save").click(function(){
		var tempEmail = $("#email").val();
		
		$.ajax({
			type: "POST",
			data: {email:tempEmail,step:'2',confirm:'zapis'},
			url: 'flymail.php',
			error: function(msg){
				alert( "ERROR: " + msg );
			},
			beforeSend: function(){
	   			$("#ajax").show();
	   		},
			success: function(msg){
				$("#reply").html(msg);
				$("#email").val("");
				$("#ajax").hide();
			}
		});
	});
	
 });
 
(function ($) {
  $.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(this).parent().height();
	var mh = (ph - ah) / 2;
	$(this).css('top', mh);
	});
};
})(jQuery);

