$(function() {

	var content = $("#generatedtable");
	var sections = $("#showmem");
	sections.click(function(){
		content.slideUp();
		content.load("http://marthel.pl/table1k.php?grupa=26");
		content.slideDown(); 
		});

		
	
	// hide all the sub-menus
	$("span.togglesub").next().hide();
	
	// add a link nudging animation effect to each link
    $("#jQ-menu a, #jQ-menu span.toggle, #jQ-menu span.togglesub").hover(function() {
        $(this).stop().animate( {
			fontSize:"12px",
			paddingLeft:"5px",
			color:"blue"
        }, 100);
    }, function() {
        $(this).stop().animate( {
			fontSize:"12px",
			paddingLeft:"0",
			color:"black"
        }, 100);
    });
	
	// set the cursor of the toggling span elements
	$("span.toggle").css("cursor", "pointer");
	
	// prepend a plus sign to signify that the sub-menus aren't expanded
	//$("span.toggle").prepend("+ ");
	
	// add a click function that toggles the sub-menu when the corresponding
	// span element is clicked
	$("span.toggle").click(function() {
		$(this).next().toggle(100);

	});
	$("span.togglesub").click(function() {
		$(this).next().toggle(100);

		
	//	// switch the plus to a minus sign or vice-versa
	//	var v = $(this).html().substring( 0, 1 );
	//	if ( v == "+" )
	//		$(this).html( "-" + $(this).html().substring( 1 ) );
	//	else if ( v == "-" )
	//		$(this).html( "+" + $(this).html().substring( 1 ) );
	});
});
