function openChildWindow(file, window, options) {
    childWindow = open(file,window,options);
    if (childWindow.opener == null) childWindow.opener=self;
}

$(document).ready(function(){
	$("#recForm").validate();

	$("#rezerwuj").validate({
	  success: function(label) {
		label.html("&nbsp;").addClass("sprawdzony");
	}
	});
		
	$("#rezerwuj2").validate({
	  success: function(label) {
		label.html("&nbsp;").addClass("sprawdzony");
	}
	});
	
	$("#rezerwuj3").validate({
		errorPlacement: function(error, element) {error.appendTo( element.parent("td").next("td") );},
		  success: function(label) {
		label.html("&nbsp;").addClass("sprawdzony");
	}
	});
	
	
	$(".file").click(function() 
		{
			$("#plik2").val($(this).attr('id'));
			$("#plik").val($(this).attr('id'));
		});
		$(".file").fancybox({
				'scrolling'		: 'no',
				'titleShow'		: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
		});
		$("#pobierz").bind("submit", function() {
		if ($("#pobierz").valid()==false) { return false;}
				$.fancybox.showActivity();
				$.ajax({
					type		: "POST",
					cache	: false,
					url		: "download",
					data		: $(this).serializeArray(),
					success: function(data) {
						$.fancybox(data);
					}
				});
				return false;
		});
		
		
		$("#pobierz2").bind("submit", function() {
		$.fancybox.showActivity();
				$.ajax({
					type		: "POST",
					cache	: false,
					url		: "download",
					data		: $(this).serializeArray(),
					success: function(data) {
						$.fancybox(data);
					}
				});
				return false;
		});
		
		
		
  //  information_box.assign("#informacja", 250, 2500);
    //$("#menu_new_item_name").change(function() {
      //  example_menu.update_item(this);
    //});
    //$("#menu_new_item_parent").change(function() {
      //  example_menu.load($(this).val());
    //});
});

		
		
