(function ($) {
	$.fn.vAlign = function(container) {
		return this.each(function(i){
			container = 'div';
			$(this).html("<div>" + $(this).html() + "</div>");
			var el = $(this).children(container + ":first");
			var elh = $(el).height(); //new element height
			var ph = $(this).parent().height(); //parent height
			var nh = (ph - elh) / 2; //new height to apply
			$(el).css('margin-top', nh);
		});
	};
})(jQuery);


$(document).ready(function(){
/*
    $.get('ajaxResponse.php?action=getOneTest&testId=4', '', function(data){
      $("#ajaxResponse").html(data);
    });
  

  $("a.fancybox.iframe").fancybox({ 
    'frameWidth': 800, 
    'frameHeight': 600
  });
  
  $("a.fancybox.iframeFlesh").fancybox({ 
    'frameWidth': 955, 
    'frameHeight': 655,
    'padding': 0,
		'overlayOpacity'		: 1
  });
  
  
  	// fourth example
	$("#courseProgramMenu ul.menu").treeview({	
    collapsed: true,
		animated: "medium",
		unique: true
	});
	
	    // -------------------------------- init contact form validate
    $("form#formularz_kontaktowy").validate({
	   rules: {
			formEmail: {
				required: true,
	      email: true

			},
			formTresc: {
				required: true
			}
		}
	 });		
	 
    $("form#formularz_kontaktowy_firma").validate({
  	   rules: {
  			formNazwaFirmy: {
  				required: true
  			},
  			formNazwa: {
  				required: true
  			},
  			formTelefon: {
  				required: true
  			},
  			formEmail: {
  				required: true,
  	      email: true
  
  			},
  			formAdres: {
  				required: true
  			},
  			formTresc: {
  				required: true
  			}
  		}
	  });		
    $("form#formularz_test").validate({
  	   rules: {
  			formNazwa: {
  				required: true
  			}
  		}
	  });		
	  
	 $(".fixAlign").vAlign("p");

  $("#formularz_test").hide();
    $(".zapiszSie span").click(function () {
    $("#formularz_test").toggle("slow");
  });    
  */
});

