// spry.effect.js - version 0.39 - spry pre-release 1.6.1 // // copyright (c) 2006. adobe systems incorporated. // all rights reserved. // // redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * neither the name of adobe systems incorporated nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // this software is provided by the copyright holders and contributors "as is" // and any express or implied warranties, including, but not limited to, the // implied warranties of merchantability and fitness for a particular purpose // are disclaimed. in no event shall the copyright owner or contributors be // liable for any direct, indirect, incidental, special, exemplary, or // consequential damages (including, but not limited to, procurement of // substitute goods or services; loss of use, data, or profits; or business // interruption) however caused and on any theory of liability, whether in // contract, strict liability, or tort (including negligence or otherwise) // arising in any way out of the use of this software, even if advised of the // possibility of such damage. (function() { // beginsprycomponent if (typeof spry == "undefined") window.spry = {}; if (!spry.effect) spry.effect = {}; spry.forwards = 1; // const spry.backwards = 2; // const spry.effect.transitions = { lineartransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + (time / duration) * change; }, sinusoidaltransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + ((-math.cos((time/duration)*math.pi)/2) + 0.5) * change; }, squaretransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + math.pow(time/duration, 2) * change; }, squareroottransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + math.sqrt(time/duration) * change; }, fifthtransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + math.sqrt((-math.cos((time/duration)*math.pi)/2) + 0.5) * change; }, circletransition: function(time, begin, change, duration) { if (time > duration) return change+begin; var pos = time/duration; return begin + math.sqrt(1 - math.pow((pos-1), 2))* change; }, pulsatetransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + (0.5 + math.sin(17*time/duration)/2) * change; }, growspecifictransition: function(time, begin, change, duration) { if (time > duration) return change+begin; var pos = time/duration; return begin + (5 * math.pow(pos, 3) - 6.4 * math.pow(pos, 2) + 2 * pos) * change; } }; for (var trans in spry.effect.transitions) { spry[trans] = spry.effect.transitions[trans]; } ////////////////////////////////////////////////////////////////////// // // spry.effect.registry // ////////////////////////////////////////////////////////////////////// spry.effect.registry = function() { this.effects = []; }; spry.effect.registry.prototype.getregisteredeffect = function(element, options) { var a = {}; a.element = spry.effect.getelement(element); a.options = options; for (var i=0; i0) { if(isfirstentry) { camelizedstring = ostringlist[i]; isfirstentry = false; } else { var s = ostringlist[i]; camelizedstring += s.charat(0).touppercase() + s.substring(1); } } } return camelizedstring; }; spry.effect.utils.ispercentvalue = function(value) { var result = false; if (typeof value == 'string' && value.length > 0 && value.lastindexof("%") > 0) result = true; return result; }; spry.effect.utils.getpercentvalue = function(value) { var result = 0; try { result = number(value.substring(0, value.lastindexof("%"))); } catch (e) {spry.effect.utils.showerror('spry.effect.utils.getpercentvalue: ' + e);} return result; }; spry.effect.utils.getpixelvalue = function(value) { var result = 0; if (typeof value == 'number') return value; var unitindex = value.lastindexof("px"); if ( unitindex == -1) unitindex = value.length; try { result = parseint(value.substring(0, unitindex), 10); } catch (e){} return result; }; spry.effect.utils.getfirstchildelement = function(node) { if (node) { var childcurr = node.firstchild; while (childcurr) { if (childcurr.nodetype == 1) // node.element_node return childcurr; childcurr = childcurr.nextsibling; } } return null; }; spry.effect.utils.fetchchildimages = function(starteltin, targetimagesout) { if(!starteltin || starteltin.nodetype != 1 || !targetimagesout) return; if(starteltin.haschildnodes()) { var childimages = starteltin.getelementsbytagname('img'); var imagecnt = childimages.length; for(var i=0; i