function show(element){
    
    $("#img-show div.img-item").hide(); 
    var item = $("#img-show div.img-item:eq("+element+")");
    item.prepend("<span class=\"close\"></span>")
    var width = $("#img-show div.img-item:eq("+element+") img").css("width");
    item.css({"width":width})
    item.fadeTo("slow",1,function(){$(this).show});
    $("span.close").click(function(){
        hide(element);
    });
}
function hide(element){
    var item = $("#img-show div.img-item:eq("+element+")");
    $("span.close").remove();
    item.fadeTo("slow",0,function(){
        $(this).hide();
        $("#content").fadeTo("slow",1);
    });
}
$(document).ready(function(){ 
    $("div.img-item img").each(function(index){
        $(this).css({"width":$(this).width(),"height":$(this).height()});
    });
   $("#img-show div.img-item").hide(); 
   var przesuniecie = $("div#content").outerHeight() - 80;
   $("#img-show div.img-item").css({"top":przesuniecie * - 1,"margin-bottom":przesuniecie * - 1});
   $("#news div.item").click(function(){
       var element = $(this).index();
       $("#content").fadeTo("slow",0.3,function(){show(element);});
   });
});
