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("" + (text || "") + ""); } writeScript("slideshow.js"); if (options.effect) { writeScript("slideshow." + options.effect.toLowerCase() + ".js"); } if (options.sound) { writeScript("swfobject.js"); } window.addEvent("domready", function () { if (options.sound) { window.vssSoundListener = { onInit: function () {} }; $(options.id).grab(new Element("div", { id: "vssSound" })); swfobject.createSWF({ data: path + "player_mp3_js.swf", width: "1", height: "1" }, { allowScriptAccess: "always", loop: true, FlashVars: "listener=vssSoundListener&loop=1&autoplay=1&mp3=" + options.sound }, "vssSound"); } 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; var h = $$("#" + options.id + " div.slideshow-images"); }); } VisualSlideShow({ "duration": 3400, "delay": 2000, "id": "show", "width": 400, "height": 125, "captions": false, "controller": false, "thumbnails": false, "loop": true, "paused": false, "effect": "KenBurns" });