function startCycle(name, elem) {
    //$(elem).children().remove();
    //http://benjaminporterhouse.com/
    $.post("/lib/ajax.php", { 'action': 'getSlideshow', 'name': name },
        function(data)  {
            if(data && data[name]) {
                var images = Array();
                var numImages = data[name]['slides'].length;
                $.each(data[name]['slides'], function(i, item) {
                    if(i != 0) {
                        images[i] = new Image();
                        $(images[i]).load(function() {
                            $(this).appendTo(elem);
                            if($(elem + ' img').length == numImages) {
                                $(elem).cycle(data[name]['config']);
                            }
                        }).attr("src", item.src).attr("alt", "");
                    }
                });
            }
        }, "json");
}
