function VisualSlideShow(options)
{
    if (options.effect && options.effect.toLowerCase() == "fade")
    {
        options.effect = "";
    }

    var path = "";
    var regexp = /^(.*)visualslideshow\.js$/;
    $each($$("script"), function (item, index, object)
    {
        if (regexp.test(item.src))
        {
            var res = regexp.exec(item.src);
            path = res[1];
        }
    });

    function writeScript(src, text)
    {
        document.write("<scr" + "ipt type=\"text/javascript\"" + (src ? " src=\"" + path + src + "\"" : "") + ">" + (text || "") + "</scr" + "ipt>");
    }

    writeScript("slideshow.js");

    if (options.effect)
    {
        writeScript("slideshow." + options.effect.toLowerCase() + ".js");
    }

    window.addEvent("domready", function ()
    {
        var Instance;
        if (options.effect)
        {
            Instance = new Slideshow[options.effect](options.id, null, options);
        } else
        {
            Instance = new Slideshow(options.id, null, options);
        }
        if (!window.visualslideshow)
        {
            window.visualslideshow = [];
        }
        window.visualslideshow[window.visualslideshow.length] = Instance;
    });
}

VisualSlideShow({
    "duration": 3000,
    "delay": 1000,
    "id": "show",
    "width": 640,
    "height": 427,
    "captions": false,
    "controller": false,
    "thumbnails": true,
    "loop": true,
    "paused": false,
    "effect": "KenBurns"
});
