Please update your jQuery Version to min. 1.7 in Case you wish to use the Revolution Slider Plugin
The Current Version of jQuery:'+version+'
');
}
if (versionTop>1) opt.ie=false;
// Delegate .transition() calls to .animate()
// if the browser can't do CSS transitions.
if (!jQuery.support.transition)
jQuery.fn.transition = jQuery.fn.animate;
// CATCH THE CONTAINER
// LOAD THE YOUTUBE API IF NECESSARY
container.find('.caption').each(function() { jQuery(this).addClass('tp-caption')});
if (is_mobile()) {
container.find('.tp-caption').each(function() {
var nextcaption = jQuery(this);
if (nextcaption.data('autoplayonlyfirsttime') == true || nextcaption.data('autoplayonlyfirsttime')=="true")
nextcaption.data('autoplayonlyfirsttime',"false");
if (nextcaption.data('autoplay')==true || nextcaption.data('autoplay')=="true")
nextcaption.data('autoplay',false);
})
}
var addedyt=0;
var addedvim=0;
var addedvid=0;
var httpprefix = "http";
if (location.protocol === 'https:') {
httpprefix = "https";
}
container.find('.tp-caption').each(function(i) {
// IF SRC EXIST, RESET SRC'S since WE DONT NEED THEM !!
try {
if ((jQuery(this).data('ytid')!=undefined || jQuery(this).find('iframe').attr('src').toLowerCase().indexOf('youtube')>0) && addedyt==0) {
addedyt=1;
var s = document.createElement("script");
var httpprefix2 = "https";
s.src = httpprefix2+"://www.youtube.com/iframe_api"; /* Load Player API*/
var before = document.getElementsByTagName("script")[0];
var loadit = true;
jQuery('head').find('*').each(function(){
if (jQuery(this).attr('src') == httpprefix2+"://www.youtube.com/iframe_api")
loadit = false;
});
if (loadit) {
before.parentNode.insertBefore(s, before);
}
}
} catch(e) {}
try{
if ((jQuery(this).data('vimeoid')!=undefined || jQuery(this).find('iframe').attr('src').toLowerCase().indexOf('vimeo')>0) && addedvim==0) {
addedvim=1;
var f = document.createElement("script");
f.src = httpprefix+"://a.vimeocdn.com/js/froogaloop2.min.js"; /* Load Player API*/
var before = document.getElementsByTagName("script")[0];
var loadit = true;
jQuery('head').find('*').each(function(){
if (jQuery(this).attr('src') == httpprefix+"://a.vimeocdn.com/js/froogaloop2.min.js")
loadit = false;
});
if (loadit)
before.parentNode.insertBefore(f, before);
}
} catch(e) {}
try{
if ((jQuery(this).data('videomp4')!=undefined || jQuery(this).data('videowebm')!=undefined)) {
}
} catch(e) {}
});
// REMOVE ANY VIDEO JS SETTINGS OF THE VIDEO IF NEEDED
container.find('.tp-caption video').each(function(i) {
jQuery(this).removeClass("video-js").removeClass("vjs-default-skin");
jQuery(this).attr("preload","");
jQuery(this).css({display:"none"});
});
container.find('>ul:first-child >li').each(function() {
var t = jQuery(this);
t.data('origindex',t.index());
})
// SHUFFLE MODE
if (opt.shuffle=="on") {
var fsa = new Object,
fli = container.find('>ul:first-child >li:first-child')
fsa.fstransition = fli.data('fstransition');
fsa.fsmasterspeed = fli.data('fsmasterspeed');
fsa.fsslotamount = fli.data('fsslotamount');
for (var u=0;u'+
''+
''+
''+
''+
''+
'
');
// RESET THE TIMER
if (container.find('.tp-bannertimer').length==0) container.append('');
var bt=container.find('.tp-bannertimer');
if (bt.length>0) {
bt.css({'width':'0%'});
};
// WE NEED TO ADD A BASIC CLASS FOR SETTINGS.CSS
container.addClass("tp-simpleresponsive");
opt.container=container;
//if (container.height()==0) container.height(opt.startheight);
// AMOUNT OF THE SLIDES
opt.slideamount = container.find('>ul:first >li').length;
// A BASIC GRID MUST BE DEFINED. IF NO DEFAULT GRID EXIST THAN WE NEED A DEFAULT VALUE, ACTUAL SIZE OF CONAINER
if (container.height()==0) container.height(opt.startheight);
if (opt.startwidth==undefined || opt.startwidth==0) opt.startwidth=container.width();
if (opt.startheight==undefined || opt.startheight==0) opt.startheight=container.height();
// OPT WIDTH && HEIGHT SHOULD BE SET
opt.width=container.width();
opt.height=container.height();
// DEFAULT DEPENDECIES
opt.bw= opt.startwidth / container.width();
opt.bh = opt.startheight / container.height();
// IF THE ITEM ALREADY IN A RESIZED FORM
if (opt.width!=opt.startwidth) {
opt.height = Math.round(opt.startheight * (opt.width/opt.startwidth));
container.height(opt.height);
}
// LETS SEE IF THERE IS ANY SHADOW
if (opt.shadow!=0) {
container.parent().append('');
var loff=0;
if (opt.forceFullWidth=="on")
loff = 0-opt.container.parent().offset().left;
container.parent().find('.tp-bannershadow').css({'width':opt.width,'left':loff});
}
container.find('ul').css({'display':'none'});
var fliparent = container;
// PREPARE THE SLIDES
container.find('ul').css({'display':'block'});
prepareSlides(container,opt);
if (opt.parallax!="off") checkForParallax(container,opt);
// CREATE BULLETS
if (opt.slideamount >1) createBullets(container,opt);
if (opt.slideamount >1 && opt.navigationType=="thumb") createThumbs(container,opt);
if (opt.slideamount >1) createArrows(container,opt);
if (opt.keyboardNavigation=="on") createKeyboard(container,opt);
swipeAction(container,opt);
if (opt.hideThumbs>0) hideThumbs(container,opt);
setTimeout(function() {
swapSlide(container,opt);
},opt.startDelay);
opt.startDelay=0;
// START COUNTDOWN
if (opt.slideamount >1) countDown(container,opt);
setTimeout(function() {
container.trigger('revolution.slide.onloaded');
},500);
/******************************
- FULLSCREEN CHANGE -
********************************/
// FULLSCREEN MODE TESTING
jQuery("body").data('rs-fullScreenMode',false);
jQuery(window).on ('mozfullscreenchange webkitfullscreenchange fullscreenchange',function(){
jQuery("body").data('rs-fullScreenMode',!jQuery("body").data('rs-fullScreenMode'));
if (jQuery("body").data('rs-fullScreenMode')) {
setTimeout(function() {
jQuery(window).trigger("resize");
},200);
}
})
var resizid = "resize.revslider-"+container.attr('id');
// IF RESIZED, NEED TO STOP ACTUAL TRANSITION AND RESIZE ACTUAL IMAGES
jQuery(window).on(resizid,function() {
if (container==undefined) return false;
if (jQuery('body').find(container)!=0)
if (opt.forceFullWidth=="on" ) {
var loff = opt.container.closest('.forcefullwidth_wrapper_tp_banner').offset().left;
//opt.container.parent().css({'width':jQuery(window).width()});
opt.container.parent().css({'left':(0-loff)+"px",'width':jQuery(window).width()});
}
if (container.outerWidth(true)!=opt.width || container.is(":hidden")) {
containerResized(container,opt);
}
});
// HIDE THUMBS UNDER SIZE...
try{
if (opt.hideThumbsUnderResoluition!=0 && opt.navigationType=="thumb") {
if (opt.hideThumbsUnderResoluition>jQuery(window).width())
jQuery('.tp-bullets').css({display:"none"});
else
jQuery('.tp-bullets').css({display:"block"});
}
} catch(e) {}
// CHECK IF THE CAPTION IS A "SCROLL ME TO POSITION" CAPTION IS
//if (opt.fullScreen=="on") {
container.find('.tp-scrollbelowslider').on('click',function() {
var off=0;
try{
off = jQuery('body').find(opt.fullScreenOffsetContainer).height();
} catch(e) {}
try{
off = off - parseInt(jQuery(this).data('scrolloffset'),0);
} catch(e) {}
jQuery('body,html').animate(
{scrollTop:(container.offset().top+(container.find('>ul >li').height())-off)+"px"},{duration:400});
});
//}
// FIRST TIME STOP/START HIDE / SHOW SLIDER
//REMOVE AND SHOW SLIDER ON DEMAND
var contpar= container.parent();
if (jQuery(window).width()'+
''+
''+
''+
''+
''+
'
');
}
// RESET DEFAULTS
var autoplaywason = false;
if (nextcaption.data('autoplayonlyfirsttime') == true || nextcaption.data('autoplayonlyfirsttime')=="true" || nextcaption.data('autoplay')==true) {
nextcaption.data('autoplay',true);
autoplaywason = true;
}
nextcaption.find('iframe').each(function() {
var ifr=jQuery(this);
punchgs.TweenLite.to(ifr,0.1,{autoAlpha:1, zIndex:0, transformStyle:"preserve-3d",z:0,rotationX:0,force3D:"auto"});
if (is_mobile()) {
var oldsrc = ifr.attr('src');
ifr.attr('src',"");
ifr.attr('src',oldsrc);
}
// START YOUTUBE HANDLING
opt.nextslideatend = nextcaption.data('nextslideatend');
// IF VIDEOPOSTER EXISTING
if (nextcaption.data('videoposter')!=undefined && nextcaption.data('videoposter').length>2 && nextcaption.data('autoplay')!=true && !internrecalled) {
if (nextcaption.find('.tp-thumb-image').length==0)
nextcaption.append('');
else
punchgs.TweenLite.set(nextcaption.find('.tp-thumb-image'),{autoAlpha:1});
}
// IF IFRAME IS A YOUTUBE FRAME
if (ifr.attr('src').toLowerCase().indexOf('youtube')>=0) {
// IF LISTENER DOES NOT EXIST YET
if (!ifr.hasClass("HasListener")) {
try {
ifr.attr('id',frameID);
var player;
var ytint = setInterval(function() {
if (YT !=undefined)
if (typeof YT.Player != undefined && typeof YT.Player !="undefined") {
player = new YT.Player(frameID, {
events: {
"onStateChange": onPlayerStateChange,
'onReady': function(event) {
var embedCode = event.target.getVideoEmbedCode(),
ytcont = jQuery('#'+embedCode.split('id="')[1].split('"')[0]),
nextcaption = ytcont.closest('.tp-caption'),
videorate = nextcaption.data('videorate'),
videostart = nextcaption.data('videostart');
if (videorate!=undefined)
event.target.setPlaybackRate(parseFloat(videorate));
/*if (nextcaption.data('autoplay')==true || autoplaywason)
event.target.playVideo();*/
if (!is_mobile() && nextcaption.data('autoplay')==true || autoplaywason) {
nextcaption.data('timerplay',setTimeout(function() {
event.target.playVideo();
},nextcaption.data('start')));
}
// PLAY VIDEO IF THUMBNAIL HAS BEEN CLICKED
nextcaption.find('.tp-thumb-image').click(function() {
punchgs.TweenLite.to(jQuery(this),0.3,{autoAlpha:0,force3D:"auto",ease:punchgs.Power3.easeInOut})
if (!is_mobile()) {
player.playVideo();
}
})
}
}
});
}
ifr.addClass("HasListener");
nextcaption.data('player',player);
clearInterval(ytint);
}, 100)
} catch(e) {}
} else {
if (!recalled) {
var player=nextcaption.data('player');
if (nextcaption.data('forcerewind')=="on" && !is_mobile())
player.seekTo(0);
if (!is_mobile() && nextcaption.data('autoplay')==true || autoplaywason) {
nextcaption.data('timerplay',setTimeout(function() {
player.playVideo();
},nextcaption.data('start')));
}
}
} // END YOUTUBE HANDLING
} else
// START VIMEO HANDLING
if (ifr.attr('src').toLowerCase().indexOf('vimeo')>=0) {
if (!ifr.hasClass("HasListener")) {
ifr.addClass("HasListener");
ifr.attr('id',frameID);
var isrc = ifr.attr('src');
var queryParameters = {}, queryString = isrc,
re = /([^&=]+)=([^&]*)/g, m;
// Creates a map with the query string parameters
while (m = re.exec(queryString)) {
queryParameters[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
}
if (queryParameters['player_id']!=undefined)
isrc = isrc.replace(queryParameters['player_id'],frameID);
else
isrc=isrc+"&player_id="+frameID;
try{ isrc = isrc.replace('api=0','api=1'); } catch(e) {}
isrc=isrc+"&api=1";
ifr.attr('src',isrc);
var player = nextcaption.find('iframe')[0];
var vimint = setInterval(function() {
if ($f !=undefined){
if (typeof $f(frameID).api != undefined && typeof $f(frameID).api !="undefined") {
$f(player).addEvent('ready', function(){
vimeoready_auto(frameID,autoplaywason)
});
clearInterval(vimint);
}
}
},100);
} else {
if (!recalled) {
if (!is_mobile() && (nextcaption.data('autoplay')==true || nextcaption.data('forcerewind')=="on")) {
var ifr = nextcaption.find('iframe');
var id = ifr.attr('id');
var froogaloop = $f(id);
if (nextcaption.data('forcerewind')=="on")
froogaloop.api("seekTo",0);
nextcaption.data('timerplay',setTimeout(function() {
if (nextcaption.data('autoplay')==true)
froogaloop.api("play");
},nextcaption.data('start')));
}
}
}// END HAS LISTENER HANDLING
} // END OF VIMEO HANDLING
}); // END OF LOOP THROUGH IFRAMES
// START OF HTML5 VIDEOS
if ((is_mobile() && nextcaption.data('disablevideoonmobile')==1) ||isIE(8)) nextcaption.find('video').remove();
//if (is_mobile() && jQuery(window).width()<569) nextcaption.find('video').remove()
if (nextcaption.find('video').length>0) {
nextcaption.find('video').each(function(i) {
var video = this,
jvideo = jQuery(this);
if (!jvideo.parent().hasClass("html5vid"))
jvideo.wrap('');
var html5vid = jvideo.parent();
// WAITING FOR META DATAS
addEvent(video,'loadedmetadata',function(html5vid) {
html5vid.data('metaloaded',1);
}(html5vid));
clearInterval(html5vid.data('interval'));
html5vid.data('interval',setInterval(function() {
if (html5vid.data('metaloaded')==1 || video.duration!=NaN) {
clearInterval(html5vid.data('interval'));
// FIRST TIME LOADED THE HTML5 VIDEO
if (!html5vid.hasClass("HasListener")) {
html5vid.addClass("HasListener");
if (nextcaption.data('dottedoverlay')!="none" && nextcaption.data('dottedoverlay')!=undefined)
if (nextcaption.find('.tp-dottedoverlay').length!=1)
html5vid.append('');
if (jvideo.attr('control') == undefined ) {
if (html5vid.find('.tp-video-play-button').length==0)
html5vid.append(' ');
html5vid.find('video, .tp-poster, .tp-video-play-button').click(function() {
if (html5vid.hasClass("videoisplaying"))
video.pause();
else
video.play();
})
}
if (nextcaption.data('forcecover')==1 || nextcaption.hasClass('fullscreenvideo')) {
if (nextcaption.data('forcecover')==1) {
updateHTML5Size(html5vid,opt.container);
html5vid.addClass("fullcoveredvideo");
nextcaption.addClass("fullcoveredvideo");
}
html5vid.css({width:"100%", height:"100%"});
}
var playButton = nextcaption.find('.tp-vid-play-pause')[0],
muteButton = nextcaption.find('.tp-vid-mute')[0],
fullScreenButton = nextcaption.find('.tp-vid-full-screen')[0],
seekBar = nextcaption.find('.tp-seek-bar')[0],
volumeBar = nextcaption.find('.tp-volume-bar')[0];
if (playButton!=undefined) {
// Event listener for the play/pause button
addEvent(playButton,"click", function() {
if (video.paused == true)
// Play the video
video.play();
else
// Pause the video
video.pause();
});
// Event listener for the mute button
addEvent(muteButton,"click", function() {
if (video.muted == false) {
// Mute the video
video.muted = true;
// Update the button text
muteButton.innerHTML = "Unmute";
} else {
// Unmute the video
video.muted = false;
// Update the button text
muteButton.innerHTML = "Mute";
}
});
// Event listener for the full-screen button
addEvent(fullScreenButton,"click", function() {
if (video.requestFullscreen) {
video.requestFullscreen();
} else if (video.mozRequestFullScreen) {
video.mozRequestFullScreen(); // Firefox
} else if (video.webkitRequestFullscreen) {
video.webkitRequestFullscreen(); // Chrome and Safari
}
});
// Event listener for the seek bar
addEvent(seekBar,"change", function() {
// Calculate the new time
var time = video.duration * (seekBar.value / 100);
// Update the video time
video.currentTime = time;
});
// Update the seek bar as the video plays
addEvent(video,"timeupdate", function() {
// Calculate the slider value
var value = (100 / video.duration) * video.currentTime;
// Update the slider value
seekBar.value = value;
});
// Pause the video when the seek handle is being dragged
addEvent(seekBar,"mousedown", function() {
video.pause();
});
// Play the video when the seek handle is dropped
addEvent(seekBar,"mouseup", function() {
video.play();
});
// Event listener for the volume bar
addEvent(volumeBar,"change", function() {
// Update the video volume
video.volume = volumeBar.value;
});
}
// VIDEO EVENT LISTENER FOR "PLAY"
addEvent(video,"play",function() {
if (nextcaption.data('volume')=="mute")
video.muted=true;
html5vid.addClass("videoisplaying");
if (nextcaption.data('videoloop')=="loopandnoslidestop") {
opt.videoplaying=false;
opt.container.trigger('starttimer');
opt.container.trigger('revolution.slide.onvideostop');
} else {
opt.videoplaying=true;
opt.container.trigger('stoptimer');
opt.container.trigger('revolution.slide.onvideoplay');
}
var playButton = nextcaption.find('.tp-vid-play-pause')[0],
muteButton = nextcaption.find('.tp-vid-mute')[0];
if (playButton!=undefined)
playButton.innerHTML = "Pause";
if (muteButton!=undefined && video.muted)
muteButton.innerHTML = "Unmute";
});
// VIDEO EVENT LISTENER FOR "PAUSE"
addEvent(video,"pause",function() {
html5vid.removeClass("videoisplaying");
opt.videoplaying=false;
opt.container.trigger('starttimer');
opt.container.trigger('revolution.slide.onvideostop');
var playButton = nextcaption.find('.tp-vid-play-pause')[0];
if (playButton!=undefined)
playButton.innerHTML = "Play";
});
// VIDEO EVENT LISTENER FOR "END"
addEvent(video,"ended",function() {
html5vid.removeClass("videoisplaying");
opt.videoplaying=false;
opt.container.trigger('starttimer');
opt.container.trigger('revolution.slide.onvideostop');
if (opt.nextslideatend==true)
opt.container.revnext();
});
} // END OF LISTENER DECLARATION
var autoplaywason = false;
if (nextcaption.data('autoplayonlyfirsttime') == true || nextcaption.data('autoplayonlyfirsttime')=="true")
autoplaywason = true;
var mediaaspect=16/9;
if (nextcaption.data('aspectratio')=="4:3") mediaaspect=4/3;
html5vid.data('mediaAspect',mediaaspect);
if (html5vid.closest('.tp-caption').data('forcecover')==1) {
updateHTML5Size(html5vid,opt.container);
html5vid.addClass("fullcoveredvideo");
}
jvideo.css({display:"block"});
opt.nextslideatend = nextcaption.data('nextslideatend');
// IF VIDEO SHOULD BE AUTOPLAYED
if (nextcaption.data('autoplay')==true || autoplaywason==true) {
if (nextcaption.data('videoloop')=="loopandnoslidestop") {
opt.videoplaying=false;
opt.container.trigger('starttimer');
opt.container.trigger('revolution.slide.onvideostop');
} else {
opt.videoplaying=true;
opt.container.trigger('stoptimer');
opt.container.trigger('revolution.slide.onvideoplay');
}
if (nextcaption.data('forcerewind')=="on" && !html5vid.hasClass("videoisplaying"))
if (video.currentTime>0) video.currentTime=0;
if (nextcaption.data('volume')=="mute")
video.muted = true;
html5vid.data('timerplay',setTimeout(function() {
if (nextcaption.data('forcerewind')=="on" && !html5vid.hasClass("videoisplaying"))
if (video.currentTime>0) video.currentTime=0;
if (nextcaption.data('volume')=="mute")
video.muted = true;
video.play();
},10+nextcaption.data('start')));
}
if (html5vid.data('ww') == undefined) html5vid.data('ww',jvideo.attr('width'));
if (html5vid.data('hh') == undefined) html5vid.data('hh',jvideo.attr('height'));
if (!nextcaption.hasClass("fullscreenvideo") && nextcaption.data('forcecover')==1) {
try{
html5vid.width(html5vid.data('ww')*opt.bw);
html5vid.height(html5vid.data('hh')*opt.bh);
} catch(e) {}
}
clearInterval(html5vid.data('interval'));
}
}),100); // END OF SET INTERVAL
});
} // END OF HTML5 VIDEO FUNCTIONS
// IF AUTOPLAY IS ON, WE NEED SOME STOP FUNCTION ON
if (nextcaption.data('autoplay')==true) {
setTimeout(function() {
if (nextcaption.data('videoloop')!="loopandnoslidestop") {
opt.videoplaying=true;
opt.container.trigger('stoptimer');
}
},200)
if (nextcaption.data('videoloop')!="loopandnoslidestop") {
opt.videoplaying=true;
opt.container.trigger('stoptimer');
}
if (nextcaption.data('autoplayonlyfirsttime') == true || nextcaption.data('autoplayonlyfirsttime')=="true" ) {
nextcaption.data('autoplay',false);
nextcaption.data('autoplayonlyfirsttime',false);
}
}
}
// NEW ENGINE
//if (nextcaption.hasClass("randomrotate") && (opt.ie || opt.ie9)) nextcaption.removeClass("randomrotate").addClass("sfb");
// nextcaption.removeClass('noFilterClass');
var imw =0;
var imh = 0;
if (nextcaption.find('img').length>0) {
var im = nextcaption.find('img');
if (im.width()==0) im.css({width:"auto"});
if (im.height()==0) im.css({height:"auto"});
if (im.data('ww') == undefined && im.width()>0) im.data('ww',im.width());
if (im.data('hh') == undefined && im.height()>0) im.data('hh',im.height());
var ww = im.data('ww');
var hh = im.data('hh');
if (ww==undefined) ww=0;
if (hh==undefined) hh=0;
im.width(ww*opt.bw);
im.height(hh*opt.bh);
imw = im.width();
imh = im.height();
} else {
if (nextcaption.find('iframe').length>0 || nextcaption.find('video').length>0) {
var html5vid = false,
im = nextcaption.find('iframe');
if (im.length==0) {
im = nextcaption.find('video');
html5vid = true;
}
im.css({display:"block"});
if (nextcaption.data('ww') == undefined) nextcaption.data('ww',im.width());
if (nextcaption.data('hh') == undefined) nextcaption.data('hh',im.height());
var ww = nextcaption.data('ww'),
hh = nextcaption.data('hh');
var nc =nextcaption;
if (nc.data('fsize') == undefined) nc.data('fsize',parseInt(nc.css('font-size'),0) || 0);
if (nc.data('pt') == undefined) nc.data('pt',parseInt(nc.css('paddingTop'),0) || 0);
if (nc.data('pb') == undefined) nc.data('pb',parseInt(nc.css('paddingBottom'),0) || 0);
if (nc.data('pl') == undefined) nc.data('pl',parseInt(nc.css('paddingLeft'),0) || 0);
if (nc.data('pr') == undefined) nc.data('pr',parseInt(nc.css('paddingRight'),0) || 0);
if (nc.data('mt') == undefined) nc.data('mt',parseInt(nc.css('marginTop'),0) || 0);
if (nc.data('mb') == undefined) nc.data('mb',parseInt(nc.css('marginBottom'),0) || 0);
if (nc.data('ml') == undefined) nc.data('ml',parseInt(nc.css('marginLeft'),0) || 0);
if (nc.data('mr') == undefined) nc.data('mr',parseInt(nc.css('marginRight'),0) || 0);
if (nc.data('bt') == undefined) nc.data('bt',parseInt(nc.css('borderTop'),0) || 0);
if (nc.data('bb') == undefined) nc.data('bb',parseInt(nc.css('borderBottom'),0) || 0);
if (nc.data('bl') == undefined) nc.data('bl',parseInt(nc.css('borderLeft'),0) || 0);
if (nc.data('br') == undefined) nc.data('br',parseInt(nc.css('borderRight'),0) || 0);
if (nc.data('lh') == undefined) nc.data('lh',parseInt(nc.css('lineHeight'),0) || 0);
// IE8 FIX FOR AUTO LINEHEIGHT
if (nc.data('lh')=="auto") nc.data('lh',nc.data('fsize')+4);
var fvwidth=opt.width,
fvheight=opt.height;
if (fvwidth>opt.startwidth) fvwidth=opt.startwidth;
if (fvheight>opt.startheight) fvheight=opt.startheight;
if (!nextcaption.hasClass('fullscreenvideo'))
nextcaption.css({
'font-size': (nc.data('fsize') * opt.bw)+"px",
'padding-top': (nc.data('pt') * opt.bh) + "px",
'padding-bottom': (nc.data('pb') * opt.bh) + "px",
'padding-left': (nc.data('pl') * opt.bw) + "px",
'padding-right': (nc.data('pr') * opt.bw) + "px",
'margin-top': (nc.data('mt') * opt.bh) + "px",
'margin-bottom': (nc.data('mb') * opt.bh) + "px",
'margin-left': (nc.data('ml') * opt.bw) + "px",
'margin-right': (nc.data('mr') * opt.bw) + "px",
'border-top': (nc.data('bt') * opt.bh) + "px",
'border-bottom': (nc.data('bb') * opt.bh) + "px",
'border-left': (nc.data('bl') * opt.bw) + "px",
'border-right': (nc.data('br') * opt.bw) + "px",
'line-height': (nc.data('lh') * opt.bh) + "px",
'height':(hh*opt.bh)+'px'
});
else {
offsetx=0; offsety=0;
nextcaption.data('x',0)
nextcaption.data('y',0)
var ovhh = opt.height
if (opt.autoHeight=="on")
ovhh = opt.container.height()
nextcaption.css({
'width':opt.width,
'height':ovhh
});
}
if (html5vid == false) {
im.width(ww*opt.bw);
im.height(hh*opt.bh);
}
else
if (nextcaption.data('forcecover')!=1 && !nextcaption.hasClass('fullscreenvideo')) {
im.width(ww*opt.bw);
im.height(hh*opt.bh);
}
imw = im.width();
imh = im.height();
}
else {
nextcaption.find('.tp-resizeme, .tp-resizeme *').each(function() {
calcCaptionResponsive(jQuery(this),opt);
});
if (nextcaption.hasClass("tp-resizeme")) {
nextcaption.find('*').each(function() {
calcCaptionResponsive(jQuery(this),opt);
});
}
calcCaptionResponsive(nextcaption,opt);
imh=nextcaption.outerHeight(true);
imw=nextcaption.outerWidth(true);
// NEXTCAPTION FRONTCORNER CHANGES
var ncch = nextcaption.outerHeight();
var bgcol = nextcaption.css('backgroundColor');
nextcaption.find('.frontcorner').css({
'borderWidth':ncch+"px",
'left':(0-ncch)+'px',
'borderRight':'0px solid transparent',
'borderTopColor':bgcol
});
nextcaption.find('.frontcornertop').css({
'borderWidth':ncch+"px",
'left':(0-ncch)+'px',
'borderRight':'0px solid transparent',
'borderBottomColor':bgcol
});
// NEXTCAPTION BACKCORNER CHANGES
nextcaption.find('.backcorner').css({
'borderWidth':ncch+"px",
'right':(0-ncch)+'px',
'borderLeft':'0px solid transparent',
'borderBottomColor':bgcol
});
// NEXTCAPTION BACKCORNER CHANGES
nextcaption.find('.backcornertop').css({
'borderWidth':ncch+"px",
'right':(0-ncch)+'px',
'borderLeft':'0px solid transparent',
'borderTopColor':bgcol
});
}
}
if (opt.fullScreenAlignForce == "on") {
//xbw = 1;
//xbh = 1;
offsetx=0;
offsety=0;
}
if (nextcaption.data('voffset')==undefined) nextcaption.data('voffset',0);
if (nextcaption.data('hoffset')==undefined) nextcaption.data('hoffset',0);
var vofs= nextcaption.data('voffset')*xbw;
var hofs= nextcaption.data('hoffset')*xbw;
var crw = opt.startwidth*xbw;
var crh = opt.startheight*xbw;
if (opt.fullScreenAlignForce == "on") {
crw = opt.container.width();
crh = opt.container.height();
}
// CENTER THE CAPTION HORIZONTALLY
if (nextcaption.data('x')=="center" || nextcaption.data('xcenter')=='center') {
nextcaption.data('xcenter','center');
//nextcaption.data('x',(crw/2 - nextcaption.outerWidth(true)/2)/xbw+ hofs);
nextcaption.data('x',(crw/2 - nextcaption.outerWidth(true)/2) + hofs);
}
// ALIGN LEFT THE CAPTION HORIZONTALLY
if (nextcaption.data('x')=="left" || nextcaption.data('xleft')=='left') {
nextcaption.data('xleft','left');
nextcaption.data('x',(0)/xbw+hofs);
}
// ALIGN RIGHT THE CAPTION HORIZONTALLY
if (nextcaption.data('x')=="right" || nextcaption.data('xright')=='right') {
nextcaption.data('xright','right');
nextcaption.data('x',((crw - nextcaption.outerWidth(true))+hofs)/xbw);
//konsole.log("crw:"+crw+" width:"+nextcaption.outerWidth(true)+" xbw:"+xbw);
//konsole.log("x-pos:"+nextcaption.data('x'))
}
// CENTER THE CAPTION VERTICALLY
if (nextcaption.data('y')=="center" || nextcaption.data('ycenter')=='center') {
nextcaption.data('ycenter','center');
nextcaption.data('y',(crh/2 - nextcaption.outerHeight(true)/2) + vofs);
}
// ALIGN TOP THE CAPTION VERTICALLY
if (nextcaption.data('y')=="top" || nextcaption.data('ytop')=='top') {
nextcaption.data('ytop','top');
nextcaption.data('y',(0)/opt.bh+vofs);
}
// ALIGN BOTTOM THE CAPTION VERTICALLY
if (nextcaption.data('y')=="bottom" || nextcaption.data('ybottom')=='bottom') {
nextcaption.data('ybottom','bottom');
nextcaption.data('y',((crh - nextcaption.outerHeight(true))+vofs)/xbw);
}
// THE TRANSITIONS OF CAPTIONS
// MDELAY AND MSPEED
if (nextcaption.data('start') == undefined) nextcaption.data('start',1000);
var easedata=nextcaption.data('easing');
if (easedata==undefined) easedata="punchgs.Power1.easeOut";
var mdelay = nextcaption.data('start')/1000,
mspeed = nextcaption.data('speed')/1000;
if (nextcaption.data('x')=="center" || nextcaption.data('xcenter')=='center')
var calcx = (nextcaption.data('x')+offsetx);
else {
var calcx = (xbw*nextcaption.data('x')+offsetx);
}
if (nextcaption.data('y')=="center" || nextcaption.data('ycenter')=='center')
var calcy = (nextcaption.data('y')+offsety);
else {
//if (opt.fullScreenAlignForce == "on" && (nextcaption.data('y')=="bottom" || nextcaption.data('ybottom')=='bottom'))
// opt.bh = 1;
var calcy = (opt.bh*nextcaption.data('y')+offsety);
}
punchgs.TweenLite.set(nextcaption,{top:calcy,left:calcx,overwrite:"auto"});
if (staticdirection == 0)
internrecalled = true;
if (nextcaption.data('timeline')!=undefined && !internrecalled) {
if (staticdirection!=2)
nextcaption.data('timeline').gotoAndPlay(0);
internrecalled = true;
}
if (!internrecalled) {
// CLEAR THE TIMELINE, SINCE IT CAN BE DAMAGED, OR PAUSED AT A FEW PART
if (nextcaption.data('timeline')!=undefined) {
//nextcaption.data('timeline').clear();
}
var tl = new punchgs.TimelineLite({smoothChildTiming:true,onStart:tlstart});
tl.pause();
if (opt.fullScreenAlignForce == "on") {
//calcy = nextcaption.data('y')+offsety;
}
var animobject = nextcaption;
if (nextcaption.data('mySplitText') !=undefined) nextcaption.data('mySplitText').revert();
if (nextcaption.data('splitin') == "chars" || nextcaption.data('splitin') == "words" || nextcaption.data('splitin') == "lines" || nextcaption.data('splitout') == "chars" || nextcaption.data('splitout') == "words" || nextcaption.data('splitout') == "lines") {
if (nextcaption.find('a').length>0)
nextcaption.data('mySplitText',new punchgs.SplitText(nextcaption.find('a'),{type:"lines,words,chars",charsClass:"tp-splitted",wordsClass:"tp-splitted",linesClass:"tp-splitted"}));
else
if (nextcaption.find('.tp-layer-inner-rotation').length>0)
nextcaption.data('mySplitText',new punchgs.SplitText(nextcaption.find('.tp-layer-inner-rotation'),{type:"lines,words,chars",charsClass:"tp-splitted",wordsClass:"tp-splitted",linesClass:"tp-splitted"}));
else
nextcaption.data('mySplitText',new punchgs.SplitText(nextcaption,{type:"lines,words,chars",charsClass:"tp-splitted",wordsClass:"tp-splitted",linesClass:"tp-splitted"}));
nextcaption.addClass("splitted");
}
if (nextcaption.data('splitin') == "chars")
animobject = nextcaption.data('mySplitText').chars;
if (nextcaption.data('splitin') == "words")
animobject = nextcaption.data('mySplitText').words;
if (nextcaption.data('splitin') == "lines")
animobject = nextcaption.data('mySplitText').lines;
var frm = newAnimObject();
var endfrm = newAnimObject();
if (nextcaption.data('repeat')!=undefined) repeatV = nextcaption.data('repeat');
if (nextcaption.data('yoyo')!=undefined) yoyoV = nextcaption.data('yoyo');
if (nextcaption.data('repeatdelay')!=undefined) repeatdelayV = nextcaption.data('repeatdelay');
var ncc = nextcaption.attr('class');
// WHICH ANIMATION TYPE SHOULD BE USED
if (ncc.match("customin")) frm = getAnimDatas(frm,nextcaption.data('customin'));
else
if (ncc.match("randomrotate")) {
frm.scale = Math.random()*3+1;
frm.rotation = Math.round(Math.random()*200-100);
frm.x = Math.round(Math.random()*200-100);
frm.y = Math.round(Math.random()*200-100);
}
else
if (ncc.match('lfr') || ncc.match('skewfromright')) frm.x = 15+opt.width;
else
if (ncc.match('lfl') || ncc.match('skewfromleft')) frm.x = -15-imw;
else
if (ncc.match('sfl') || ncc.match('skewfromleftshort')) frm.x = -50;
else
if (ncc.match('sfr') || ncc.match('skewfromrightshort')) frm.x = 50;
else
if (ncc.match('lft')) frm.y = -25 - imh;
else
if (ncc.match('lfb')) frm.y = 25 + opt.height;
else
if (ncc.match('sft')) frm.y = -50;
else
if (ncc.match('sfb')) frm.y = 50;
if (ncc.match('skewfromright') || nextcaption.hasClass('skewfromrightshort')) frm.skewX = -85
else
if (ncc.match('skewfromleft') || nextcaption.hasClass('skewfromleftshort')) frm.skewX = 85
if (ncc.match("fade") || ncc.match('sft') || ncc.match('sfl') || ncc.match('sfb') || ncc.match('skewfromleftshort') || ncc.match('sfr') || ncc.match('skewfromrightshort'))
frm.opacity = 0;
// FOR SAFARI WE NEED TO REMOVE 3D ROTATIONS
if (get_browser().toLowerCase()=="safari") {
//frm.rotationX=0;frm.rotationY=0;
}
var elemdelay = (nextcaption.data('elementdelay') == undefined) ? 0 : nextcaption.data('elementdelay');
endfrm.ease = frm.ease = (nextcaption.data('easing') == undefined) ? punchgs.Power1.easeInOut : nextcaption.data('easing');
// DISTANCES SHOULD BE RESIZED ALSO
frm.data = new Object();
frm.data.oldx = frm.x;
frm.data.oldy = frm.y;
endfrm.data = new Object();
endfrm.data.oldx = endfrm.x;
endfrm.data.oldy = endfrm.y;
frm.x = frm.x * xbw;
frm.y = frm.y * xbw;
var newtl = new punchgs.TimelineLite();
if (staticdirection != 2) {
// CHANGE to punchgs.TweenLite. if Yoyo and Repeat is used. Dont forget to laod the Right Tools for it !!
if (ncc.match("customin")) {
if (animobject != nextcaption)
tl.add(punchgs.TweenLite.set(nextcaption, { force3D:"auto",opacity:1,scaleX:1,scaleY:1,rotationX:0,rotationY:0,rotationZ:0,skewX:0,skewY:0,z:0,x:0,y:0,visibility:'visible',delay:0,overwrite:"all"}));
frm.visibility = "hidden";
endfrm.visibility = "visible";
endfrm.overwrite = "all";
endfrm.opacity = 1;
endfrm.onComplete = animcompleted();
endfrm.delay = mdelay;
endfrm.force3D="auto"
tl.add(newtl.staggerFromTo(animobject,mspeed,frm,endfrm,elemdelay),"frame0");
} else {
frm.visibility = "visible";
frm.transformPerspective = 600;
if (animobject != nextcaption)
tl.add(punchgs.TweenLite.set(nextcaption, { force3D:"auto",opacity:1,scaleX:1,scaleY:1,rotationX:0,rotationY:0,rotationZ:0,skewX:0,skewY:0,z:0,x:0,y:0,visibility:'visible',delay:0,overwrite:"all"}));
endfrm.visibility = "visible";
endfrm.delay = mdelay;
endfrm.onComplete = animcompleted();
endfrm.opacity = 1;
endfrm.force3D="auto";
if (ncc.match("randomrotate") && animobject != nextcaption) {
for (var i=0;i