+ self.slideChangeHorizontalFlip = function (from, to){
+ var f = SWS.Presentation.getSlide(from);
+ var t = SWS.Presentation.getSlide(to);
+ f.animate({ 'left': '50%', 'width': '0pt', 'opacity':'0' }, 150,
+ function () {
+ SWS.Templates.slideDeactivate(f);
+ f.css({'left':'0%', 'width': '100%'});
+ t.css({ 'left': '50%', 'width': '0pt','opacity':'0' });
+ SWS.Templates.slideActivate(t);
+ t.animate({'left':'0%', 'width': '100%','opacity':'1'});
+ });
+ };
+ self.slideChangeFadeOutIn = function (from, to) {
+ var f = SWS.Presentation.getSlide(from);
+ var t = SWS.Presentation.getSlide(to);
+ f.animate({ 'opacity': '0'}, 150,
+ function () { SWS.Templates.slideDeactivate(f);
+ SWS.Templates.slideActivate(t);
+ t.css('opacity', '0');
+ t.animate({ 'opacity': '1'}, 150);
+ });
+ };
+ self.slideChangeHorizontalSlide = function (from, to) {
+ var f = SWS.Presentation.getSlide(from);
+ var t = SWS.Presentation.getSlide(to);
+ if (from < to) {
+ t.css('left', '100%');
+ SWS.Templates.slideActivate(t);
+ f.animate({ 'left': '-100%' }, 250, function () { SWS.Templates.slideDeactivate(f); });
+ t.animate({ 'left': '0%' }, 250);
+ } else {
+ t.css('left', '-100%');
+ SWS.Templates.slideActivate(t);
+ f.animate({ 'left': '100%' }, 250, function () { SWS.Templates.slideDeactivate(f); });
+ t.animate({ 'left': '0%' }, 250);
+ };
+ };
+
+
+ self.slideChangeVerticalSlide = function (from, to) {
+ var f = SWS.Presentation.getSlide(from);
+ var t = SWS.Presentation.getSlide(to);
+ if (from < to) {
+ t.css('top', '100%');
+ SWS.Templates.slideActivate(t);
+ f.animate({ 'top': '-100%' }, 250, function () { SWS.Templates.slideDeactivate(f); });
+ t.animate({ 'top': '0%' }, 250);
+ } else {
+ t.css('top', '-100%');
+ SWS.Templates.slideActivate(t);
+ f.animate({ 'top': '100%' }, 250, function () { SWS.Templates.slideDeactivate(f); });
+ t.animate({ 'top': '0%' }, 250);
+ };
+ };
+
+};
+
+SWS.Presentation = new function () {
+
+
+ var self = this;
+
+ //TODO move outside of the Presentation object
+
+
+ var _total_slides;
+ var _initialized = false;
+ var _disable_input_events = false;
+
+ var _slide_callbacks = new Array ();
+
+
+ self.getNumSlides = function () { return _total_slides; };
+
+ self.getSlide = function(i) {
+ return $($(".sws-canvas")[i]);
+ };
+
+ self.registerCallback = function (i, f) {