$(document).ready( function(){
		$("#link_stand").click( function(){ $("#kts").hide(); $("#normal").show(); return false; } );
		$("#link_kats").click( function(){ $("#normal").hide(); $("#kts").show(); return false; 	} );
	$(".film").each( function(){
		$(this).click( function(){ 
		ident = $(this).attr("title");
		typ = $(this).attr("name");
		
		
		$.ajax({
			type: "POST",
			url: "../includes/ajax_movdata.php",
			data: "id="+ident,
			beforeSend: function(){  },
			dataType: "xml",
			success: function(xml){
				$("response", xml).each(function() {
				 $("#ops").hide(); $("#ops2").hide();
                 var idfilmu = $("idfilmu",this).text();
				 var tytul = $("tytul",this).text();
				 var opis =  $("opis",this).text();
				 var komentarzy = $("komentarzy",this).text();
				 var wyswietlen =  $("wyswietlen",this).text();
				 var kategoria =  $("kategoria",this).text();
				 var typ =  $("typ",this).text();
					$("#ops").show(); 
					$("#ops").html("<div style='margin-bottom:3px; padding-bottom:3px; border-bottom:1px dotted silver;'>Wyświetleń filmu: <span style='color:yellow;'>"+wyswietlen+"</span> Kategoria: <a style='color:yellow;' href='filmkat.php?kategoria="+encodeURI(kategoria)+"'>"+kategoria+"</a> Komentarzy: <a style='color:yellow;' href='film.php?id="+idfilmu+"#komentarze'>"+komentarzy+"</a> </div>"+opis+"</div>");
				}); },
			error: function(){  }
			});
		
			$.get("../includes/ajax_movexp.php", { id: ident } );


		
		$(".opis").each( function(){ $(this).hide(); } );
		$("#"+ident).fadeIn("slow");
		$("#film").html('<div style="background:white; border:1px solid black; padding:2px;"><object width="445" height="364"><param name="movie" value="http://www.youtube.com/'+typ+'/'+ident+'&hl=pl&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/'+typ+'/'+ident+'&hl=pl&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="490" height="390"></embed></object></div>');
		return false;
		});
	});
});
