+ };
+
+ 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%');
+ t.css('opacity', '1');
+ SWS.Templates.slideActivate(t);
+ f.animate({ 'left': '-100%' }, 250, function () { SWS.Templates.slideDeactivate(f);
+ f.css('opacity', '0');
+ t.animate({ 'left': '0%' }, 250);
+ });
+ } else {
+ t.css('left', '-100%');
+ SWS.Templates.slideActivate(t);
+ f.animate({ 'left': '100%' }, 250, function () { SWS.Templates.slideDeactivate(f);
+ f.css('opacity', '0');
+ });
+ t.css('opacity', '1');
+ 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.Fullscreen = new function () {
+ var self = this;
+
+ if (SWS.Utils.isUndefined(document.fullScreen)) {
+ if (SWS.Utils.isUndefined(document.mozfullScreen)) {
+ self.status = function () { return document.webkitIsFullScreen; };
+ self.enter = function(e) {
+ e.webkitRequestFullScreen();
+ };
+ self.exit = function () {
+ document.webkitCancelFullScreen();
+ };
+
+ } else {
+ self.status = function () { return document.mozfullScreen; };
+ self.enter = function(e) {
+ e.mozRequestFullScreen();
+ };
+ self.exit = function () {
+ document.mozCancelFullScreen();
+ };
+
+ };
+ } else {
+ self.status = function () { return document.fullScreen; };
+ self.enter = function(e) {
+ e.requestFullScreen();
+ };
+ self.exit = function () {
+ document.cancelFullScreen();
+ };
+
+ };
+
+
+};
+
+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 _print_mode = false;
+ var _slide_callbacks = new Array ();
+ var _total_steps = -1;
+ var _current_theme = "";
+
+ self.getNumSlides = function () { return _total_slides; };
+
+ self.getSlide = function(i) {
+ return $($(".sws-canvas")[i]);
+ };
+
+ self.registerCallback = function (i, f) {