$(document).ready(function() {

$('#gallery a').lightBox();

$("#commentForm").validate();
// third example
	$("#red").treeview({
		animated: "fast",
		collapsed: true,
		unique: true,
		persist: "cookie",
		toggle: function() {
			window.console && console.log("%o was toggled", this);
		}
	});

       
});


function Link2(div,tar)
{
$("#loading").ajaxStart(function(){
$(this).show();
});

    $(div).load(tar, function()
          {
             $(div).find('a');
            
           });
$("#loading").ajaxStop(function() {
$(this).hide();
});


}

function Link3(div,tar)
{
$("#loading").ajaxStart(function(){
$(this).show();
});

$('a').live('click', function(event) {
    $(div).load(tar, function()
          {
             $(div).find('a');

           });
    });
    
$("#loading").ajaxStop(function() {
$(this).hide();
});


}

function Link4(div,tar)
{

if(confirm('Czy usunąć?')) {
$("#loading").ajaxStart(function(){
$(this).show();
});

    $(div).load(tar, function()
          {
             $(div).find('a');

           });
$("#loading").ajaxStop(function() {
$(this).hide();
});
}

}


function Show(pole)
{

$(pole).live("click", function(event){
             $($('#actTab').attr('value')).css( "display", "none" );
             $(pole).css( "display", "block" );

             $("#actTab").val('P'+pole);
           
  return false;
});
}




function Link_pk(div, tar)
{
$("#loader").ajaxStart(function(){
$(this).show();
});
$("#loader").ajaxStop(function() {
$(this).hide();
});
$(div).load(tar, function()
          {
             $(div).find('a');
           });
}


