var classASPSS = new ASPSS.Class({ initialize: function(oInst, oSettings) { this["container"] = ASPSS.$(oInst); if (!this["container"]["hasClass"]("isinitialized")) { this["container"]["addClass"]("isinitialized"); this["slides"] = []; this["buttons"] = []; this["slidetexts"] = []; this["textFx"] = new Array(); this["mouseOver"] = false; this["pauseClicked"] = false; this["options"] = Object["extend"]({ sSlidesSelector: ".slide", sButtonsSelector: ".button", sSlidetextSelector: ".slidetext", iCrossFadeDelay: 4000, iTransitionDelay: 700, iStartIndex: 0, sButtonOnClass: "menu-active", sButtonOffClass: "off", sRotateOn: "click", sAutoStart: true, sAutoRotate: true, sPauseText: "Pause", sStartText: "Start", sTransitionDirection: "", sTransition: "bounce", sTransitionEase: "easeout", fJsPlayButtonClicked: false, fJsNextButtonClicked: false, fJsPrevButtonClicked: false, fJsMenuItemClicked: false, fJsSlideChanged: false, fStopOnMouseOver: false, stop: false }, oSettings || {}); if (this["options"]["sTransitionDirection"]["length"] == 0) { this["options"]["sTransition"] = ""; this["options"]["sTransitionEase"] = ""; }; this["slides"] = ASPSS.$(oInst)["getElements"](this["options"]["sSlidesSelector"]); this["buttons"] = ASPSS.$(oInst)["getElements"](this["options"]["sButtonsSelector"]); this["slidetexts"] = ASPSS.$$(this["options"]["sSlidetextSelector"]); this["createFx"](); this["showSlide"](this["options"]["iStartIndex"]); if (this["options"]["fJsSlideChanged"]) { ASPSS_Slide_Changed(0); }; if (this["options"]["sRotateOn"] != "") { this["setupAction"](this["options"]["sRotateOn"]); }; if (this["options"]["sAutoStart"]) { this["autoStart"](); } else { this["setupNavigation"](); }; return this; } else { return false; }; }, setupNavigation: function() { if (this["options"]["sAutoRotate"]) { ASPSS.$(this["container"]["id"] + "_playButton")["innerHTML"] = this["options"]["sStartText"]; ASPSS.$(this["container"]["id"] + "_playButton")["addClass"]("pause"); this["stop"](); } else { ASPSS.$(this["container"]["id"] + "_playButton")["setStyle"]("visibility", "hidden"); }; }, setupAction: function(c1) { this["buttons"]["each"](function(a1, b1) { ASPSS.$(a1)["addEvent"](c1, function() { if (c1 == "click") { this["slideFx"]["clearTimer"](false); }; this["slideFx"]["setOptions"](this["slideFx"]["options"], { duration: this["options"]["iTransitionDelay"] }); if (this["currentSlide"] != b1) { this["selected"](b1); }; if (this["options"]["stop"]) { this["stop"](); }; } ["bind"](this)); }, this); ASPSS.$(this["container"]["id"] + "_prev")["addEvent"](c1, function() { this["prev"](); if (this["options"]["stop"]) { ASPSS.$(this["container"]["id"] + "_playButton")["innerHTML"] = this["options"]["sStartText"]; ASPSS.$(this["container"]["id"] + "_playButton")["addClass"]("pause"); this["stop"](); }; } ["bind"](this)); ASPSS.$(this["container"]["id"] + "_next")["addEvent"](c1, function() { this["next"](); if (this["options"]["stop"]) { ASPSS.$(this["container"]["id"] + "_playButton")["innerHTML"] = this["options"]["sStartText"]; ASPSS.$(this["container"]["id"] + "_playButton")["addClass"]("pause"); this["stop"](); }; } ["bind"](this)); ASPSS.$(this["container"]["id"] + "_playButton")["addEvent"](c1, function() { if (ASPSS.$(this["container"]["id"] + "_playButton")["hasClass"]("pause")) { ASPSS.$(this["container"]["id"] + "_playButton")["innerHTML"] = this["options"]["sPauseText"]; ASPSS.$(this["container"]["id"] + "_playButton")["removeClass"]("pause"); this["autoStart"](); } else { ASPSS.$(this["container"]["id"] + "_playButton")["innerHTML"] = this["options"]["sStartText"]; ASPSS.$(this["container"]["id"] + "_playButton")["addClass"]("pause"); this["stop"](); }; } ["bind"](this)); }, createFx: function() { this["slideFx"] = new ASPSS["Fx"].Elements(this["slides"], { duration: this["options"]["iTransitionDelay"] }); this["slides"]["each"](function(a1) { a1["setStyle"]("opacity", 0); }); if (this["options"]["sTransitionDirection"]["length"] > 0) { if (this["options"]["sTransition"] != "Bounce" && this["options"]["sTransition"] != "Expo" && this["options"]["sTransitionEase"] != "Sine") { this["options"]["sTransition"] = "Linear"; }; if (this["options"]["sTransitionEase"]["length"] == 0) { this["options"]["sTransitionEase"] = "easeOut"; } else { if (this["options"]["sTransitionEase"] != "easeOut" && this["options"]["sTransitionEase"] != "easeIn" && this["options"]["sTransitionEase"] != "easeInOut") { this["options"]["sTransitionEase"] = "easeOut"; }; }; for (var i = 0; i < this["slidetexts"]["length"]; i++) { this["textFx"][i] = new ASPSS["Fx"].Slide(this["slidetexts"][i], { duration: this["options"]["iTransitionDelay"], mode: this["options"]["sTransitionDirection"] }); if (this["options"]["sTransition"] != "Linear") { this["textFx"][i]["options"]["transition"] = ASPSS["Fx"]["Transitions"][this["options"]["sTransition"]][this["options"]["sTransitionEase"]]; }; }; }; }, showSlide: function(c1) { if (this["options"]["fStopOnMouseOver"] && this["mouseOver"]) { return; }; var d1 = {}; this["slides"]["each"](function(a1, b1) { a1["addEvent"]("mouseover", function() { this["mouseOver"] = true; } ["bind"](this)); a1["addEvent"]("mouseout", function() { this["mouseOver"] = false; } ["bind"](this)); } ["bind"](this)); this["slides"]["each"](function(a1, b1) { if (b1 == c1 && b1 != this["currentSlide"]) { ASPSS.$(this["buttons"][b1])["removeClass"](this["options"]["sButtonOffClass"])["addClass"](this["options"]["sButtonOnClass"]); d1[b1.toString()] = { "opacity": [1] }; textIndex = b1; } else { ASPSS.$(this["buttons"][b1])["removeClass"](this["options"]["sButtonOnClass"])["addClass"](this["options"]["sButtonOffClass"]); d1[b1.toString()] = { "opacity": [0] }; if (this["options"]["sTransition"]["length"] > 0) { this["textFx"][b1]["slideOut"](); }; }; }, this); if (this["options"]["fJsSlideChanged"]) { ASPSS_Slide_Changed(c1); }; this["currentSlide"] = c1; this["slideFx"]["start"](d1); if (this["options"]["sTransition"]["length"] > 0) { this["textFx"][textIndex]["hide"](); this["textFx"][textIndex]["slideIn"](); }; }, autoStart: function() { this["slideshowInt"] = this["rotate"]["periodical"](this["options"]["iCrossFadeDelay"], this); if (this["pauseClicked"]) { if (this["options"]["fJsPlayButtonClicked"]) { ASPSS_PlayButton_Clicked(1, this["currentSlide"]); }; this["pauseClicked"] = false; }; if (!this["options"]["sAutoRotate"]) { this["stop"](); }; }, stop: function() { clearInterval(this["slideshowInt"]); if (this["options"]["fJsPlayButtonClicked"]) { ASPSS_PlayButton_Clicked(0, this["currentSlide"]); }; this["pauseClicked"] = true; }, rotate: function() { current = this["currentSlide"]; if (this["slides"]["length"] == 1) { next = current; return; }; next = (current + 1 >= this["slides"]["length"]) ? 0 : current + 1; this["showSlide"](next); }, next: function() { current = this["currentSlide"]; next = (current + 1 >= this["slides"]["length"]) ? 0 : current + 1; clearInterval(this["slideshowInt"]); this["showSlide"](next); if (this["options"]["fJsNextButtonClicked"]) { ASPSS_NextButton_Clicked(next); }; this["autoStart"](); ASPSS.$(this["container"]["id"] + "_playButton")["innerHTML"] = this["options"]["sPauseText"]; ASPSS.$(this["container"]["id"] + "_playButton")["removeClass"]("pause"); }, prev: function() { current = this["currentSlide"]; prev = (current - 1 < 0) ? this["slides"]["length"] - 1 : current - 1; clearInterval(this["slideshowInt"]); this["showSlide"](prev); if (this["options"]["fJsPrevButtonClicked"]) { ASPSS_PrevButton_Clicked(prev); }; this["autoStart"](); ASPSS.$(this["container"]["id"] + "_playButton")["innerHTML"] = this["options"]["sPauseText"]; ASPSS.$(this["container"]["id"] + "_playButton")["removeClass"]("pause"); }, selected: function(a1) { clearInterval(this["slideshowInt"]); this["showSlide"](a1); if (this["options"]["fJsMenuItemClicked"]) { ASPSS_MenuItem_Clicked(a1); }; this["autoStart"](); ASPSS.$(this["container"]["id"] + "_playButton")["innerHTML"] = this["options"]["sPauseText"]; ASPSS.$(this["container"]["id"] + "_playButton")["removeClass"]("pause"); }, show: function() { ASPSS.$(this["options"]["fpslideshowContainer"])["setStyle"]("visibility", "visible"); if (!ASPSS.$(this["options"]["fpslideshowContainer"])["visible"]()) { ASPSS.$(this["options"]["fpslideshowContainer"])["show"](); }; }, hide: function() { ASPSS.$(this["options"]["fpslideshowContainer"])["setStyle"]("visibility", "hidden"); } }); var _ASPSS = { _settingsInstances: [], init: function($settings) { var $id = this["make_id"](); this["_settingsInstances"][$id] = $settings; window["addEvent"]("domready", function() { if (ASPSS.$($settings.SlideShowId)) { setTimeout("_ASPSS.initSlideshow(\x27" + $id + "\x27)", $settings.LoadingDelay); }; }); }, make_id: function() { var $str = String(Math["random"]()); var $date = new Date(); var $id = "_" + $str["replace"](".", "") + "_" + $date["getSeconds"](); return ($id); }, initSlideshow: function($id) { var $settings = this["_settingsInstances"][$id]; if (ASPSS.$($settings.SlideLoadingSelector)) { ASPSS.$($settings.SlideLoadingSelector)["setStyle"]("display", "none"); } else { return; }; if (ASPSS.$($settings.SlideOuterSelector)) { ASPSS.$($settings.SlideOuterSelector)["setStyle"]("display", "block"); } else { return; }; var myASPSS = new classASPSS(ASPSS.$($settings.SlideShowId), { sSlidetextSelector: $settings["SlideTextSelector"], sPauseText: $settings["PauseText"], sStartText: $settings["StartText"], iCrossFadeDelay: $settings["CrossFadeDelay"], iTransitionDelay: $settings["TransitionDelay"], sRotateOn: $settings["RotateOn"], sAutoStart: $settings["AutoStart"], sAutoRotate: $settings["AutoRotate"], sTransitionDirection: $settings["TextBarTransitionDirection"], sTransition: $settings["TextBarTransition"], sTransitionEase: $settings["TextBarTransitionEase"], fJsPlayButtonClicked: $settings["JSPlayButtonClicked"], fJsNextButtonClicked: $settings["JSNextButtonClicked"], fJsPrevButtonClicked: $settings["JSPrevButtonClicked"], fJsMenuItemClicked: $settings["JSMenuItemClicked"], fJsSlideChanged: $settings["JSSlideChanged"], fStopOnMouseOver: $settings["StopOnMouseOver"], stop: false }); } };
