

function wczytajSzczegoly(idt) {
	bodyContent = $.ajax({
		url: "tekst.php",
		global: false,
		type: "POST",
		data: "id="+idt,
		dataType: "html",
		async:false,
		success: function(html){
			$("#ListaTeksty").hide();
			$("#realizacjeTeksty").hide();
			$("#szczegolyTeksty").empty();
			$("#szczegolyTeksty").append(html);
			$("#szczegolyTeksty").show();
			$(".linkTekst").wrap("<div class=white></div>");
		}
	}
	);
} 
function wczytajFragment(idt) {
	bodyContent = $.ajax({
		url: "fragment.php",
		global: false,
		type: "POST",
		data: "id="+idt,
		dataType: "html",
		async:false,
		success: function(html){
			$("#ListaTeksty").hide();
			$("#realizacjeTeksty").hide();
			$("#szczegolyTeksty").hide();
			$("#fragmentTeksty").empty();
			$("#fragmentTeksty").append(html);
			$("#fragmentTeksty").show();
			$(".linkTekst").wrap("<div class=white></div>");
			kolorujFragment();
			$("a[rel='galeria']").colorbox();
		}
	}
	);
} 


function wczytajOpisRealizacji(idr, idt) {
	bodyContent = $.ajax({
		url: "opis_realizacji.php",
		global: false,
		type: "POST",
		data: "idr="+idr+"&idt="+idt,
		dataType: "html",
		async:false,
		success: function(html){
			$("#ListaTeksty").hide();
			$("#realizacjeTeksty").hide();
			$("#realizacjeOpis").empty();
			$("#realizacjeOpis").append(html);
			$("#realizacjeOpis").show();
			$(".linkTekst").wrap("<div class=white></div>");
			$("a[rel='galeria']").colorbox();
		}
	}
	);
} 
function wczytajOpis(idr, idt) {
	bodyContent = $.ajax({
		url: "opis_realizacji2.php",
		global: false,
		type: "POST",
		data: "idr="+idr+"&idt="+idt,
		dataType: "html",
		async:false,
		success: function(html){
			$("#realizacjeStrona").hide();
			$("#realizacjeStronaOpis").empty();
			$("#realizacjeStronaOpis").append(html);
			$("#realizacjeStronaOpis").show();
			$(".linkTekst").wrap("<div class=white></div>");
			$("a[rel='galeria']").colorbox();
		}
	}
	);
} 
function wczytajrealizacje(idt) {

	bodyContent = $.ajax({
		url: "realizacje_lista.php",
		global: false,
		type: "POST",
		data: "id="+idt,
		dataType: "html",
		async:false,
		success: function(html){
			$(".linkTekst").wrap("<div class=white></div>");
			$("#ListaTeksty").hide();
			$("#szczegolyTeksty").hide();
			$("#realizacjeTeksty").empty();
			$("#realizacjeTeksty").append(html);
			$("#realizacjeTeksty").show();
			$("#tabelaRealizacje").tablesorter({ headers: { 5: { sorter: false } } }); 
			koloruj();
			$(".linkTekst").wrap("<div class=white></div>");
			$("a[rel='galeria']").colorbox();
		}
	}
	);
} 
function wrocDoListy() {
	$("#ListaTeksty").show();
	$("#szczegolyTeksty").empty();
	$("#szczegolyTeksty").hide();
	$("#realizacjeTeksty").empty();
	$("#realizacjeTeksty").hide();
	$("#fragmentTeksty").empty();
	$("#fragmentTeksty").hide();
} 
function wrocDoSzczegolow() {
	$("#szczegolyTeksty").show();
	$("#ListaTeksty").hide();
	$("#realizacjeTeksty").empty();
	$("#realizacjeTeksty").hide();
	$("#fragmentTeksty").empty();
	$("#fragmentTeksty").hide();
} 
function wrocDoRealizacji() {
	$("#szczegolyTeksty").hide();
	$("#realizacjeTeksty").show();
	$("#ListaTeksty").hide();
	$("#realizacjeOpis").empty();
	$("#realizacjeOpis").hide();
} 
function koloruj(){

	$("#tabelaRealizacje tr:odd").css("background-color", "#e3e2e6"); 
	$("#tabelaRealizacje tr:even").css("background-color", "#f1f0f4"); 
    $("#tabelaRealizacje tr:first").css("background-color", "#808080"); 
    $("#tabelaRealizacje tr:first").css("font-weight", "bold"); 
    $("#tabelaRealizacje tr:first").css("text-align", "center");
	$("#tabelaRealizacje").css("background-color", "#FFFFFF"); 
	$("#tabelaRealizacje").attr("cellpadding", "7"); 
	$("#tabelaRealizacje").attr("cellspacing", "2");
	$("#tabelaRealizacje th").css("color", "#FFFFFF"); 
	$("#tabelaRealizacje th").css("background-color", "#808080"); 
	$("#tabelaRealizacje th").css("font-weight", "bold"); 
	$("#tabelaRealizacje th").css("text-align", "center");
	$("#tabelaRealizacje th").css("font-size", "12px");
	
}
function kolorujFragment(){

   $("#fragment td:first").css("font-weight", "bold"); 
 //  $('td:first', $(this).parents('tr')).css("font-weight", "bold"); 

	
}
