$(document).ready(function(){

  $("#foto_home").before("<ul id=\"zdjecie\">").cycle({
   fx: "fade", // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    timeout: 5000,
     speed: 2000,
    pager:  "#zdjecie",
    pagerEvent:     "mouseover", // name of event which drives the pager navigation
    // callback fn that creates a thumbnail to use as pager anchor
    pagerAnchorBuilder: function(idx, slide) {
        myString = new String(slide.src)
splitString = myString.split("uploads/images/home/");
        return "<div class=\"thb\"><div class=\"thb2\"><a href=\"#\"><img src=\"uploads/images/home/thumb_" + splitString[1] + "\" /></a></div></div>";
    }
  });
});

