jquery.themepunch.revolution.js 97 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150
  1. /**************************************************************************
  2. * jquery.themepunch.revolution.js - jQuery Plugin for Revolution Slider
  3. * @version: 5.3.1.5 (08.12.2016)
  4. * @requires jQuery v1.7 or later (tested on 1.9)
  5. * @author ThemePunch
  6. **************************************************************************/
  7. (function(jQuery,undefined){
  8. "use strict";
  9. var version = {
  10. core : "5.3.1.4",
  11. "revolution.extensions.actions.min.js":"2.0.4",
  12. "revolution.extensions.carousel.min.js":"1.2.1",
  13. "revolution.extensions.kenburn.min.js":"1.2.0",
  14. "revolution.extensions.layeranimation.min.js":"3.5.0",
  15. "revolution.extensions.navigation.min.js":"1.3.2",
  16. "revolution.extensions.parallax.min.js":"2.2.0",
  17. "revolution.extensions.slideanims.min.js":"1.6",
  18. "revolution.extensions.video.min.js":"2.0.2"
  19. }
  20. jQuery.fn.extend({
  21. revolution: function(options) {
  22. // SET DEFAULT VALUES OF ITEM //
  23. var defaults = {
  24. delay:9000,
  25. responsiveLevels:4064, // Single or Array for Responsive Levels i.e.: 4064 or i.e. [2048, 1024, 768, 480]
  26. visibilityLevels:[2048,1024,778,480], // Single or Array for Responsive Visibility Levels i.e.: 4064 or i.e. [2048, 1024, 768, 480]
  27. gridwidth:960, // Single or Array i.e. 960 or [960, 840,760,460]
  28. gridheight:500, // Single or Array i.e. 500 or [500, 450,400,350]
  29. minHeight:0,
  30. autoHeight:"off",
  31. sliderType : "standard", // standard, carousel, hero
  32. sliderLayout : "auto", // auto, fullwidth, fullscreen
  33. fullScreenAutoWidth:"off", // Turns the FullScreen Slider to be a FullHeight but auto Width Slider
  34. fullScreenAlignForce:"off",
  35. fullScreenOffsetContainer:"", // Size for FullScreen Slider minimising Calculated on the Container sizes
  36. fullScreenOffset:"0", // Size for FullScreen Slider minimising
  37. hideCaptionAtLimit:0, // It Defines if a caption should be shown under a Screen Resolution ( Basod on The Width of Browser)
  38. hideAllCaptionAtLimit:0, // Hide all The Captions if Width of Browser is less then this value
  39. hideSliderAtLimit:0, // Hide the whole slider, and stop also functions if Width of Browser is less than this value
  40. disableProgressBar:"off", // Hides Progress Bar if is set to "on"
  41. stopAtSlide:-1, // Stop Timer if Slide "x" has been Reached. If stopAfterLoops set to 0, then it stops already in the first Loop at slide X which defined. -1 means do not stop at any slide. stopAfterLoops has no sinn in this case.
  42. stopAfterLoops:-1, // Stop Timer if All slides has been played "x" times. IT will stop at THe slide which is defined via stopAtSlide:x, if set to -1 slide never stop automatic
  43. shadow:0, //0 = no Shadow, 1,2,3 = 3 Different Art of Shadows (No Shadow in Fullwidth Version !)
  44. dottedOverlay:"none", //twoxtwo, threexthree, twoxtwowhite, threexthreewhite
  45. startDelay:0, // Delay before the first Animation starts.
  46. lazyType : "smart", //full, smart, single
  47. spinner:"spinner0",
  48. shuffle:"off", // Random Order of Slides,
  49. viewPort:{
  50. enable:false, // if enabled, slider wait with start or wait at first slide.
  51. outof:"wait", // wait,pause
  52. visible_area:"60%", // Start Animation when 60% of Slider is visible
  53. presize:false // Presize the Height of the Slider Container for Internal Link Positions
  54. },
  55. fallbacks:{
  56. isJoomla:false,
  57. panZoomDisableOnMobile:"off",
  58. simplifyAll:"on",
  59. nextSlideOnWindowFocus:"off",
  60. disableFocusListener:true,
  61. ignoreHeightChanges:"off", // off, mobile, always
  62. ignoreHeightChangesSize:0
  63. },
  64. parallax : {
  65. type : "off", // off, mouse, scroll, mouse+scroll
  66. levels: [10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85],
  67. origo:"enterpoint", // slidercenter or enterpoint
  68. speed:400,
  69. bgparallax : "off",
  70. opacity:"on",
  71. disable_onmobile:"off",
  72. ddd_shadow:"on",
  73. ddd_bgfreeze:"off",
  74. ddd_overflow:"visible",
  75. ddd_layer_overflow:"visible",
  76. ddd_z_correction:65,
  77. ddd_path:"mouse"
  78. },
  79. scrolleffect: {
  80. fade:"off",
  81. blur:"off",
  82. grayscale:"off",
  83. maxblur:10,
  84. on_layers:"off",
  85. on_slidebg:"off",
  86. on_static_layers:"off",
  87. on_parallax_layers:"off",
  88. on_parallax_static_layers:"off",
  89. direction:"both",
  90. multiplicator:1.35,
  91. multiplicator_layers:0.5,
  92. tilt:30,
  93. disable_on_mobile:"on"
  94. },
  95. carousel : {
  96. easing:punchgs.Power3.easeInOut,
  97. speed:800,
  98. showLayersAllTime : "off",
  99. horizontal_align : "center",
  100. vertical_align : "center",
  101. infinity : "on",
  102. space : 0,
  103. maxVisibleItems : 3,
  104. stretch:"off",
  105. fadeout:"on",
  106. maxRotation:0,
  107. minScale:0,
  108. vary_fade:"off",
  109. vary_rotation:"on",
  110. vary_scale:"off",
  111. border_radius:"0px",
  112. padding_top:0,
  113. padding_bottom:0
  114. },
  115. navigation : {
  116. keyboardNavigation:"off",
  117. keyboard_direction:"horizontal", // horizontal - left/right arrows, vertical - top/bottom arrows
  118. mouseScrollNavigation:"off", // on, off, carousel
  119. onHoverStop:"on", // Stop Banner Timet at Hover on Slide on/off
  120. touch:{
  121. touchenabled:"off", // Enable Swipe Function : on/off
  122. swipe_treshold : 75, // The number of pixels that the user must move their finger by before it is considered a swipe.
  123. swipe_min_touches : 1, // Min Finger (touch) used for swipe
  124. drag_block_vertical:false, // Prevent Vertical Scroll during Swipe
  125. swipe_direction:"horizontal"
  126. },
  127. arrows: {
  128. style:"",
  129. enable:false,
  130. hide_onmobile:false,
  131. hide_onleave:true,
  132. hide_delay:200,
  133. hide_delay_mobile:1200,
  134. hide_under:0,
  135. hide_over:9999,
  136. tmp:'',
  137. rtl:false,
  138. left : {
  139. h_align:"left",
  140. v_align:"center",
  141. h_offset:20,
  142. v_offset:0,
  143. container:"slider",
  144. },
  145. right : {
  146. h_align:"right",
  147. v_align:"center",
  148. h_offset:20,
  149. v_offset:0,
  150. container:"slider",
  151. }
  152. },
  153. bullets: {
  154. container:"slider",
  155. rtl:false,
  156. style:"",
  157. enable:false,
  158. hide_onmobile:false,
  159. hide_onleave:true,
  160. hide_delay:200,
  161. hide_delay_mobile:1200,
  162. hide_under:0,
  163. hide_over:9999,
  164. direction:"horizontal",
  165. h_align:"left",
  166. v_align:"center",
  167. space:0,
  168. h_offset:20,
  169. v_offset:0,
  170. tmp:'<span class="tp-bullet-image"></span><span class="tp-bullet-title"></span>'
  171. },
  172. thumbnails: {
  173. container:"slider",
  174. rtl:false,
  175. style:"",
  176. enable:false,
  177. width:100,
  178. height:50,
  179. min_width:100,
  180. wrapper_padding:2,
  181. wrapper_color:"#f5f5f5",
  182. wrapper_opacity:1,
  183. tmp:'<span class="tp-thumb-image"></span><span class="tp-thumb-title"></span>',
  184. visibleAmount:5,
  185. hide_onmobile:false,
  186. hide_onleave:true,
  187. hide_delay:200,
  188. hide_delay_mobile:1200,
  189. hide_under:0,
  190. hide_over:9999,
  191. direction:"horizontal",
  192. span:false,
  193. position:"inner",
  194. space:2,
  195. h_align:"left",
  196. v_align:"center",
  197. h_offset:20,
  198. v_offset:0
  199. },
  200. tabs: {
  201. container:"slider",
  202. rtl:false,
  203. style:"",
  204. enable:false,
  205. width:100,
  206. min_width:100,
  207. height:50,
  208. wrapper_padding:10,
  209. wrapper_color:"#f5f5f5",
  210. wrapper_opacity:1,
  211. tmp:'<span class="tp-tab-image"></span>',
  212. visibleAmount:5,
  213. hide_onmobile:false,
  214. hide_onleave:true,
  215. hide_delay:200,
  216. hide_delay_mobile:1200,
  217. hide_under:0,
  218. hide_over:9999,
  219. direction:"horizontal",
  220. span:false,
  221. space:0,
  222. position:"inner",
  223. h_align:"left",
  224. v_align:"center",
  225. h_offset:20,
  226. v_offset:0
  227. }
  228. },
  229. extensions:"extensions/", //example extensions/ or extensions/source/
  230. extensions_suffix:".min.js",
  231. //addons:[{fileprefix:"revolution.addon.whiteboard",init:"initWhiteBoard",params:"opt",handel:"whiteboard"}],
  232. debugMode:false
  233. };
  234. // Merge of Defaults
  235. options = jQuery.extend(true,{},defaults, options);
  236. return this.each(function() {
  237. var c = jQuery(this);
  238. // Prepare maxHeight
  239. options.minHeight = options.minHeight!=undefined ? parseInt(options.minHeight,0) : options.minHeight;
  240. options.scrolleffect.on = options.scrolleffect.fade==="on" || options.scrolleffect.blur==="on" || options.scrolleffect.grayscale==="on";
  241. //REMOVE SLIDES IF SLIDER IS HERO
  242. if (options.sliderType=="hero") {
  243. c.find('>ul>li').each(function(i) {
  244. if (i>0) jQuery(this).remove();
  245. })
  246. }
  247. options.jsFileLocation = options.jsFileLocation || getScriptLocation("themepunch.revolution.min.js");
  248. options.jsFileLocation = options.jsFileLocation + options.extensions;
  249. options.scriptsneeded = getNeededScripts(options,c);
  250. options.curWinRange = 0;
  251. options.rtl = true; //jQuery('body').hasClass("rtl");
  252. if (options.navigation!=undefined && options.navigation.touch!=undefined)
  253. options.navigation.touch.swipe_min_touches = options.navigation.touch.swipe_min_touches >5 ? 1 : options.navigation.touch.swipe_min_touches;
  254. jQuery(this).on("scriptsloaded",function() {
  255. if (options.modulesfailing ) {
  256. c.html('<div style="margin:auto;line-height:40px;font-size:14px;color:#fff;padding:15px;background:#e74c3c;margin:20px 0px;">!! Error at loading Slider Revolution 5.0 Extrensions.'+options.errorm+'</div>').show();
  257. return false;
  258. }
  259. // CHECK FOR MIGRATION
  260. if (_R.migration!=undefined) options = _R.migration(c,options);
  261. punchgs.force3D = true;
  262. if (options.simplifyAll!=="on") punchgs.TweenLite.lagSmoothing(1000,16);
  263. prepareOptions(c,options);
  264. initSlider(c,options);
  265. });
  266. c[0].opt = options;
  267. waitForScripts(c,options);
  268. })
  269. },
  270. // Remove a Slide from the Slider
  271. revremoveslide : function(sindex) {
  272. return this.each(function() {
  273. var container=jQuery(this),
  274. opt = container[0].opt;
  275. if (sindex<0 || sindex>opt.slideamount) return;
  276. if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) {
  277. if (opt && opt.li.length>0) {
  278. if (sindex>0 || sindex<=opt.li.length) {
  279. var li = jQuery(opt.li[sindex]),
  280. ref = li.data("index"),
  281. nextslideafter = false;
  282. opt.slideamount = opt.slideamount-1;
  283. opt.realslideamount = opt.realslideamount-1;
  284. removeNavWithLiref('.tp-bullet',ref,opt);
  285. removeNavWithLiref('.tp-tab',ref,opt);
  286. removeNavWithLiref('.tp-thumb',ref,opt);
  287. if (li.hasClass('active-revslide'))
  288. nextslideafter = true;
  289. li.remove();
  290. opt.li = removeArray(opt.li,sindex);
  291. if (opt.carousel && opt.carousel.slides)
  292. opt.carousel.slides = removeArray(opt.carousel.slides,sindex)
  293. opt.thumbs = removeArray(opt.thumbs,sindex);
  294. if (_R.updateNavIndexes) _R.updateNavIndexes(opt);
  295. if (nextslideafter) container.revnext();
  296. punchgs.TweenLite.set(opt.li,{minWidth:"99%"});
  297. punchgs.TweenLite.set(opt.li,{minWidth:"100%"});
  298. }
  299. }
  300. }
  301. });
  302. },
  303. // Add a New Call Back to some Module
  304. revaddcallback: function(callback) {
  305. return this.each(function() {
  306. if (this.opt) {
  307. if (this.opt.callBackArray === undefined)
  308. this.opt.callBackArray = new Array();
  309. this.opt.callBackArray.push(callback);
  310. }
  311. })
  312. },
  313. // Get Current Parallax Proc
  314. revgetparallaxproc : function() {
  315. return jQuery(this)[0].opt.scrollproc;
  316. },
  317. // ENABLE DEBUG MODE
  318. revdebugmode: function() {
  319. return this.each(function() {
  320. var c=jQuery(this);
  321. c[0].opt.debugMode = true;
  322. containerResized(c,c[0].opt);
  323. })
  324. },
  325. // METHODE SCROLL
  326. revscroll: function(oy) {
  327. return this.each(function() {
  328. var c=jQuery(this);
  329. jQuery('body,html').animate({scrollTop:(c.offset().top+(c.height())-oy)+"px"},{duration:400});
  330. });
  331. },
  332. // METHODE PAUSE
  333. revredraw: function(oy) {
  334. return this.each(function() {
  335. var c=jQuery(this);
  336. containerResized(c,c[0].opt);
  337. })
  338. },
  339. // METHODE PAUSE
  340. revkill: function(oy) {
  341. var self = this,
  342. container=jQuery(this);
  343. punchgs.TweenLite.killDelayedCallsTo(_R.showHideNavElements);
  344. if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) {
  345. container.data('conthover',1);
  346. container.data('conthover-changed',1);
  347. container.trigger('revolution.slide.onpause');
  348. var bt = container.parent().find('.tp-bannertimer'),
  349. opt = container[0].opt;
  350. opt.tonpause = true;
  351. container.trigger('stoptimer');
  352. punchgs.TweenLite.killTweensOf(container.find('*'),false);
  353. punchgs.TweenLite.killTweensOf(container,false);
  354. container.unbind('hover, mouseover, mouseenter,mouseleave, resize');
  355. var resizid = "resize.revslider-"+container.attr('id');
  356. jQuery(window).off(resizid);
  357. container.find('*').each(function() {
  358. var el = jQuery(this);
  359. el.unbind('on, hover, mouseenter,mouseleave,mouseover, resize,restarttimer, stoptimer');
  360. el.off('on, hover, mouseenter,mouseleave,mouseover, resize');
  361. el.data('mySplitText',null);
  362. el.data('ctl',null);
  363. if (el.data('tween')!=undefined)
  364. el.data('tween').kill();
  365. if (el.data('kenburn')!=undefined)
  366. el.data('kenburn').kill();
  367. if (el.data('timeline_out')!=undefined)
  368. el.data('timeline_out').kill();
  369. if (el.data('timeline')!=undefined)
  370. el.data('timeline').kill();
  371. el.remove();
  372. el.empty();
  373. el=null;
  374. })
  375. punchgs.TweenLite.killTweensOf(container.find('*'),false);
  376. punchgs.TweenLite.killTweensOf(container,false);
  377. bt.remove();
  378. try{container.closest('.forcefullwidth_wrapper_tp_banner').remove();} catch(e) {}
  379. try{container.closest('.rev_slider_wrapper').remove()} catch(e) {}
  380. try{container.remove();} catch(e) {}
  381. container.empty();
  382. container.html();
  383. container = null;
  384. opt = null;
  385. delete(self.c);
  386. delete(self.opt);
  387. return true;
  388. } else {
  389. return false;
  390. }
  391. },
  392. // METHODE PAUSE
  393. revpause: function() {
  394. return this.each(function() {
  395. var c=jQuery(this);
  396. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  397. c.data('conthover',1);
  398. c.data('conthover-changed',1);
  399. c.trigger('revolution.slide.onpause');
  400. c[0].opt.tonpause = true;
  401. c.trigger('stoptimer');
  402. }
  403. })
  404. },
  405. // METHODE RESUME
  406. revresume: function() {
  407. return this.each(function() {
  408. var c=jQuery(this);
  409. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  410. c.data('conthover',0);
  411. c.data('conthover-changed',1);
  412. c.trigger('revolution.slide.onresume');
  413. c[0].opt.tonpause = false;
  414. c.trigger('starttimer');
  415. }
  416. })
  417. },
  418. revstart: function() {
  419. //return this.each(function() {
  420. var c=jQuery(this);
  421. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0 && c[0].opt!==undefined) {
  422. if (!c[0].opt.sliderisrunning) {
  423. runSlider(c,c[0].opt);
  424. return true;
  425. }
  426. else {
  427. console.log("Slider Is Running Already");
  428. return false;
  429. }
  430. }
  431. //})
  432. },
  433. // METHODE NEXT
  434. revnext: function() {
  435. return this.each(function() {
  436. // CATCH THE CONTAINER
  437. var c=jQuery(this);
  438. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  439. _R.callingNewSlide(c,1);
  440. }
  441. })
  442. },
  443. // METHODE RESUME
  444. revprev: function() {
  445. return this.each(function() {
  446. // CATCH THE CONTAINER
  447. var c=jQuery(this);
  448. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  449. _R.callingNewSlide(c,-1);
  450. }
  451. })
  452. },
  453. // METHODE LENGTH
  454. revmaxslide: function() {
  455. // CATCH THE CONTAINER
  456. return jQuery(this).find('.tp-revslider-mainul >li').length;
  457. },
  458. // METHODE CURRENT
  459. revcurrentslide: function() {
  460. // CATCH THE CONTAINER
  461. var c=jQuery(this);
  462. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  463. return parseInt(c[0].opt.act,0)+1;
  464. }
  465. },
  466. // METHODE CURRENT
  467. revlastslide: function() {
  468. // CATCH THE CONTAINER
  469. return jQuery(this).find('.tp-revslider-mainul >li').length;
  470. },
  471. // METHODE JUMP TO SLIDE
  472. revshowslide: function(slide) {
  473. return this.each(function() {
  474. // CATCH THE CONTAINER
  475. var c=jQuery(this);
  476. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  477. _R.callingNewSlide(c,"to"+(slide-1));
  478. }
  479. })
  480. },
  481. revcallslidewithid: function(slide) {
  482. return this.each(function() {
  483. // CATCH THE CONTAINER
  484. var c=jQuery(this);
  485. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  486. _R.callingNewSlide(c,slide);
  487. }
  488. })
  489. }
  490. });
  491. //////////////////////////////////////////////////////////////
  492. // - REVOLUTION FUNCTION EXTENSIONS FOR GLOBAL USAGE - //
  493. //////////////////////////////////////////////////////////////
  494. var _R = jQuery.fn.revolution;
  495. jQuery.extend(true, _R, {
  496. getversion : function() {
  497. return version;
  498. },
  499. compare_version : function(extension) {
  500. if (extension.check!="stop") {
  501. // CHECK FOR CORRECT CORE AND EXTENSION VERSION
  502. if (_R.getversion().core<extension.min_core) {
  503. if (extension.check===undefined) {
  504. console.log("%c"+"Slider Revolution Warning (Core:"+_R.getversion().core+")",'color:#c0392b;font-weight:bold;');
  505. console.log("%c"+" Core is older than expected ("+extension.min_core+") from "+extension.alias,'color:#333');
  506. console.log("%c"+" Please update Slider Revolution to the latest version.",'color:#333');
  507. console.log("%c"+" It might be required to purge and clear Server/Client side Caches.",'color:#333');
  508. }
  509. extension.check="stop";
  510. } else
  511. if (_R.getversion()[extension.name]!=undefined && extension.version <_R.getversion()[extension.name]) {
  512. if (extension.check===undefined) {
  513. console.log("%c"+"Slider Revolution Warning (Core:"+_R.getversion().core+")",'color:#c0392b;font-weight:bold;');
  514. console.log("%c"+" "+extension.alias+" ("+extension.version+") is older than requiered ("+_R.getversion()[extension.name]+")",'color:#333');
  515. console.log("%c"+" Please update Slider Revolution to the latest version.",'color:#333');
  516. console.log("%c"+" It might be required to purge and clear Server/Client side Caches.",'color:#333');
  517. }
  518. extension.check="stop";
  519. }
  520. }
  521. return extension;
  522. },
  523. currentSlideIndex : function(opt) {
  524. var ai = opt.c.find('.active-revslide').index();
  525. ai = ai == -1 ? 0 : ai;
  526. return ai;
  527. },
  528. simp : function(a,b,basic) {
  529. var c = Math.abs(a) - (Math.floor(Math.abs(a / b))*b);
  530. if (basic)
  531. return c;
  532. else
  533. return a<0 ? -1*c : c;
  534. },
  535. // - IS IOS VERSION OLDER THAN 5 ??
  536. iOSVersion : function() {
  537. var oldios = false;
  538. if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
  539. if (navigator.userAgent.match(/OS 4_\d like Mac OS X/i)) {
  540. oldios = true;
  541. }
  542. } else {
  543. oldios = false;
  544. }
  545. return oldios;
  546. },
  547. // - CHECK IF BROWSER IS IE -
  548. isIE : function( version, comparison ){
  549. var $div = jQuery('<div style="display:none;"/>').appendTo(jQuery('body'));
  550. $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');
  551. var ieTest = $div.find('a').length;
  552. $div.remove();
  553. return ieTest;
  554. },
  555. // - IS MOBILE ??
  556. is_mobile : function() {
  557. var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];
  558. var ismobile=false;
  559. for(var i in agents) {
  560. if (navigator.userAgent.split(agents[i]).length>1) {
  561. ismobile = true;
  562. }
  563. }
  564. return ismobile;
  565. },
  566. // - CALL BACK HANDLINGS - //
  567. callBackHandling : function(opt,type,position) {
  568. try{
  569. if (opt.callBackArray)
  570. jQuery.each(opt.callBackArray,function(i,c) {
  571. if (c) {
  572. if (c.inmodule && c.inmodule === type)
  573. if (c.atposition && c.atposition === position)
  574. if (c.callback)
  575. c.callback.call();
  576. }
  577. });
  578. } catch(e) {
  579. console.log("Call Back Failed");
  580. }
  581. },
  582. get_browser : function(){
  583. var N=navigator.appName, ua=navigator.userAgent, tem;
  584. var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
  585. if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
  586. M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?'];
  587. return M[0];
  588. },
  589. get_browser_version : function(){
  590. var N=navigator.appName, ua=navigator.userAgent, tem;
  591. var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
  592. if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
  593. M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?'];
  594. return M[1];
  595. },
  596. // GET THE HORIZONTAL OFFSET OF SLIDER BASED ON THE THU`MBNAIL AND TABS LEFT AND RIGHT SIDE
  597. getHorizontalOffset : function(container,side) {
  598. var thumbloff = gWiderOut(container,'.outer-left'),
  599. thumbroff = gWiderOut(container,'.outer-right');
  600. switch (side) {
  601. case "left":
  602. return thumbloff;
  603. break;
  604. case "right":
  605. return thumbroff;
  606. break;
  607. case "both":
  608. return thumbloff+thumbroff;
  609. break;
  610. }
  611. },
  612. // - CALLING THE NEW SLIDE - //
  613. callingNewSlide : function(container,direction) {
  614. var aindex = container.find('.next-revslide').length>0 ? container.find('.next-revslide').index() : container.find('.processing-revslide').length>0 ? container.find('.processing-revslide').index() : container.find('.active-revslide').index(),
  615. nindex = 0,
  616. opt = container[0].opt;
  617. container.find('.next-revslide').removeClass("next-revslide");
  618. // IF WE ARE ON AN INVISIBLE SLIDE CURRENTLY
  619. if (container.find('.active-revslide').hasClass("tp-invisible-slide"))
  620. aindex = opt.last_shown_slide;
  621. // SET NEXT DIRECTION
  622. if (direction && jQuery.isNumeric(direction) || direction.match(/to/g)) {
  623. if (direction===1 || direction === -1) {
  624. nindex = aindex + direction;
  625. nindex = nindex<0 ? opt.slideamount-1 : nindex>=opt.slideamount ? 0 : nindex;
  626. } else {
  627. direction=jQuery.isNumeric(direction) ? direction : parseInt(direction.split("to")[1],0);
  628. nindex = direction<0 ? 0 : direction>opt.slideamount-1 ? opt.slideamount-1 : direction;
  629. }
  630. container.find('.tp-revslider-slidesli:eq('+nindex+')').addClass("next-revslide");
  631. } else
  632. if (direction) {
  633. container.find('.tp-revslider-slidesli').each(function() {
  634. var li=jQuery(this);
  635. if (li.data('index')===direction) li.addClass("next-revslide");
  636. })
  637. }
  638. nindex = container.find('.next-revslide').index();
  639. container.trigger("revolution.nextslide.waiting");
  640. if ((aindex===nindex && aindex === opt.last_shown_slide) || (nindex !== aindex && nindex!=-1))
  641. swapSlide(container);
  642. else
  643. container.find('.next-revslide').removeClass("next-revslide");
  644. },
  645. slotSize : function(img,opt) {
  646. opt.slotw=Math.ceil(opt.width/opt.slots);
  647. if (opt.sliderLayout=="fullscreen")
  648. opt.sloth=Math.ceil(jQuery(window).height()/opt.slots);
  649. else
  650. opt.sloth=Math.ceil(opt.height/opt.slots);
  651. if (opt.autoHeight=="on" && img!==undefined && img!=="")
  652. opt.sloth=Math.ceil(img.height()/opt.slots);
  653. },
  654. setSize : function(opt) {
  655. var ofh = (opt.top_outer || 0) + (opt.bottom_outer || 0),
  656. cpt = parseInt((opt.carousel.padding_top||0),0),
  657. cpb = parseInt((opt.carousel.padding_bottom||0),0),
  658. maxhei = opt.gridheight[opt.curWinRange],
  659. __mh = 0,
  660. _actli = opt.nextSlide === -1 || opt.nextSlide===undefined ? 0 : opt.nextSlide;
  661. opt.paddings = opt.paddings === undefined ? {top:(parseInt(opt.c.parent().css("paddingTop"),0) || 0), bottom:(parseInt(opt.c.parent().css("paddingBottom"),0) || 0)} : opt.paddings;
  662. if (opt.rowzones && opt.rowzones.length>0)
  663. for (var a=0;a<opt.rowzones[_actli].length;a++) {
  664. __mh = __mh + opt.rowzones[_actli][a][0].offsetHeight;
  665. }
  666. maxhei = maxhei<opt.minHeight ? opt.minHeight : maxhei;
  667. maxhei = maxhei<__mh ? __mh : maxhei;
  668. if (opt.sliderLayout=="fullwidth" && opt.autoHeight=="off") punchgs.TweenLite.set(opt.c,{maxHeight:maxhei+"px"});
  669. opt.c.css({marginTop:cpt,marginBottom:cpb});
  670. opt.width=opt.ul.width();
  671. opt.height=opt.ul.height();
  672. setScale(opt);
  673. opt.height = Math.round(opt.gridheight[opt.curWinRange] * (opt.width/opt.gridwidth[opt.curWinRange]));
  674. if (opt.height>opt.gridheight[opt.curWinRange] && opt.autoHeight!="on") opt.height=opt.gridheight[opt.curWinRange];
  675. if (opt.sliderLayout=="fullscreen" || opt.infullscreenmode) {
  676. opt.height = opt.bw * opt.gridheight[opt.curWinRange];
  677. var cow = opt.c.parent().width();
  678. var coh = jQuery(window).height();
  679. if (opt.fullScreenOffsetContainer!=undefined) {
  680. try{
  681. var offcontainers = opt.fullScreenOffsetContainer.split(",");
  682. if (offcontainers)
  683. jQuery.each(offcontainers,function(index,searchedcont) {
  684. coh = jQuery(searchedcont).length>0 ? coh - jQuery(searchedcont).outerHeight(true) : coh;
  685. });
  686. } catch(e) {}
  687. try{
  688. if (opt.fullScreenOffset.split("%").length>1 && opt.fullScreenOffset!=undefined && opt.fullScreenOffset.length>0)
  689. coh = coh - (jQuery(window).height()* parseInt(opt.fullScreenOffset,0)/100);
  690. else
  691. if (opt.fullScreenOffset!=undefined && opt.fullScreenOffset.length>0)
  692. coh = coh - parseInt(opt.fullScreenOffset,0);
  693. } catch(e) {}
  694. }
  695. coh = coh<opt.minHeight ? opt.minHeight : coh;
  696. coh = coh - ofh;
  697. opt.c.parent().height(coh);
  698. opt.c.closest('.rev_slider_wrapper').height(coh);
  699. opt.c.css({'height':'100%'});
  700. opt.height=coh;
  701. if (opt.minHeight!=undefined && opt.height<opt.minHeight)
  702. opt.height = opt.minHeight;
  703. opt.height = parseInt(__mh,0)>parseInt(opt.height,0) ? __mh : opt.height;
  704. } else {
  705. if (opt.minHeight!=undefined && opt.height<opt.minHeight)
  706. opt.height = opt.minHeight;
  707. opt.height = parseInt(__mh,0)>parseInt(opt.height,0) ? __mh : opt.height;
  708. opt.c.height(opt.height);
  709. }
  710. var si = { height:(cpt+cpb+ofh+opt.height+opt.paddings.top+opt.paddings.bottom)};
  711. opt.c.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').css(si);
  712. opt.c.closest('.rev_slider_wrapper').css(si);
  713. setScale(opt);
  714. },
  715. enterInViewPort : function(opt) {
  716. // START COUNTER IF VP ENTERED, AND COUNTDOWN WAS NOT ON YET
  717. if (opt.waitForCountDown) {
  718. countDown(opt.c,opt);
  719. opt.waitForCountDown=false;
  720. }
  721. // START FIRST SLIDE IF NOT YET STARTED AND VP ENTERED
  722. if (opt.waitForFirstSlide) {
  723. swapSlide(opt.c);
  724. opt.waitForFirstSlide=false;
  725. setTimeout(function() {
  726. opt.c.removeClass("tp-waitforfirststart");
  727. },500);
  728. }
  729. if (opt.sliderlaststatus == "playing" || opt.sliderlaststatus==undefined) {
  730. opt.c.trigger("starttimer");
  731. }
  732. if (opt.lastplayedvideos != undefined && opt.lastplayedvideos.length>0) {
  733. jQuery.each(opt.lastplayedvideos,function(i,_nc) {
  734. _R.playVideo(_nc,opt);
  735. });
  736. }
  737. },
  738. leaveViewPort : function(opt) {
  739. opt.sliderlaststatus = opt.sliderstatus;
  740. opt.c.trigger("stoptimer");
  741. if (opt.playingvideos != undefined && opt.playingvideos.length>0) {
  742. opt.lastplayedvideos = jQuery.extend(true,[],opt.playingvideos);
  743. if (opt.playingvideos)
  744. jQuery.each(opt.playingvideos,function(i,_nc) {
  745. opt.leaveViewPortBasedStop = true;
  746. if (_R.stopVideo) _R.stopVideo(_nc,opt);
  747. });
  748. }
  749. },
  750. unToggleState : function(a) {
  751. if (a!=undefined && a.length>0)
  752. jQuery.each(a,function(i,layer) {
  753. layer.removeClass("rs-toggle-content-active");
  754. });
  755. },
  756. toggleState : function(a) {
  757. if (a!=undefined && a.length>0)
  758. jQuery.each(a,function(i,layer) {
  759. layer.addClass("rs-toggle-content-active");
  760. });
  761. },
  762. swaptoggleState : function(a) {
  763. if (a!=undefined && a.length>0)
  764. jQuery.each(a,function(i,layer) {
  765. if (jQuery(layer).hasClass("rs-toggle-content-active"))
  766. jQuery(layer).removeClass("rs-toggle-content-active");
  767. else
  768. jQuery(layer).addClass("rs-toggle-content-active");
  769. });
  770. },
  771. lastToggleState : function(a) {
  772. var state = 0;
  773. if (a!=undefined && a.length>0)
  774. jQuery.each(a,function(i,layer) {
  775. state = layer.hasClass("rs-toggle-content-active");
  776. });
  777. return state;
  778. }
  779. });
  780. var _ISM = _R.is_mobile();
  781. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  782. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  783. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  784. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  785. var checkIDS = function(opt,item) {
  786. opt.anyid = opt.anyid === undefined ? [] : opt.anyid;
  787. var ind = jQuery.inArray(item.attr('id'),opt.anyid);
  788. if (ind!=-1) {
  789. var newid = item.attr('id')+"_"+Math.round(Math.random()*9999);
  790. item.attr('id',newid);
  791. }
  792. opt.anyid.push(item.attr('id'));
  793. }
  794. var removeArray = function(arr,i) {
  795. var newarr = [];
  796. jQuery.each(arr,function(a,b) {
  797. if (a!=i) newarr.push(b);
  798. })
  799. return newarr;
  800. }
  801. var removeNavWithLiref = function(a,ref,opt) {
  802. opt.c.find(a).each(function() {
  803. var a = jQuery(this);
  804. if (a.data('liref')===ref)
  805. a.remove();
  806. })
  807. }
  808. var lAjax = function(s,o) {
  809. if (jQuery('body').data(s)) return false;
  810. if (o.filesystem) {
  811. if (o.errorm===undefined)
  812. o.errorm = "<br>Local Filesystem Detected !<br>Put this to your header:";
  813. console.warn('Local Filesystem detected !');
  814. o.errorm = o.errorm+'<br>&lt;script type="text/javascript" src="'+o.jsFileLocation+s+o.extensions_suffix+'"&gt;&lt;/script&gt;';
  815. console.warn(o.jsFileLocation+s+o.extensions_suffix+' could not be loaded !');
  816. console.warn('Please use a local Server or work online or make sure that you load all needed Libraries manually in your Document.');
  817. console.log(" ");
  818. o.modulesfailing = true;
  819. return false;
  820. }
  821. jQuery.ajax({
  822. url:o.jsFileLocation+s+o.extensions_suffix+'?version='+version.core,
  823. 'dataType':'script',
  824. 'cache':true,
  825. "error":function(e) {
  826. console.warn("Slider Revolution 5.0 Error !")
  827. console.error("Failure at Loading:"+s+o.extensions_suffix+" on Path:"+o.jsFileLocation)
  828. console.info(e);
  829. }
  830. });
  831. jQuery('body').data(s,true);
  832. }
  833. var getNeededScripts = function(o,c) {
  834. var n = new Object(),
  835. _n = o.navigation;
  836. n.kenburns = false;
  837. n.parallax = false;
  838. n.carousel = false;
  839. n.navigation = false;
  840. n.videos = false;
  841. n.actions = false;
  842. n.layeranim = false;
  843. n.migration = false;
  844. // MIGRATION EXTENSION
  845. if (!c.data('version') || !c.data('version').toString().match(/5./gi)) {
  846. n.kenburns = true;
  847. n.parallax = true;
  848. n.carousel = false;
  849. n.navigation = true;
  850. n.videos = true;
  851. n.actions = true;
  852. n.layeranim = true;
  853. n.migration = true;
  854. }
  855. else {
  856. // KEN BURN MODUL
  857. c.find('img').each(function(){
  858. if (jQuery(this).data('kenburns')=="on") n.kenburns = true;
  859. });
  860. // NAVIGATION EXTENSTION
  861. if (o.sliderType =="carousel" || _n.keyboardNavigation=="on" || _n.mouseScrollNavigation=="on" || _n.touch.touchenabled=="on" || _n.arrows.enable || _n.bullets.enable || _n.thumbnails.enable || _n.tabs.enable )
  862. n.navigation = true;
  863. // LAYERANIM, VIDEOS, ACTIONS EXTENSIONS
  864. c.find('.tp-caption, .tp-static-layer, .rs-background-video-layer').each(function(){
  865. var _nc = jQuery(this);
  866. if ((_nc.data('ytid')!=undefined || _nc.find('iframe').length>0 && _nc.find('iframe').attr('src').toLowerCase().indexOf('youtube')>0))
  867. n.videos = true;
  868. if ((_nc.data('vimeoid')!=undefined || _nc.find('iframe').length>0 && _nc.find('iframe').attr('src').toLowerCase().indexOf('vimeo')>0))
  869. n.videos = true;
  870. if (_nc.data('actions')!==undefined)
  871. n.actions = true;
  872. n.layeranim = true;
  873. });
  874. c.find('li').each(function() {
  875. if (jQuery(this).data('link') && jQuery(this).data('link')!=undefined) {
  876. n.layeranim = true;
  877. n.actions = true;
  878. }
  879. })
  880. // VIDEO EXTENSION
  881. if (!n.videos && (c.find('.rs-background-video-layer').length>0 || c.find(".tp-videolayer").length>0 || c.find(".tp-audiolayer").length>0 || c.find('iframe').length>0 || c.find('video').length>0))
  882. n.videos = true;
  883. // VIDEO EXTENSION
  884. if (o.sliderType =="carousel")
  885. n.carousel = true;
  886. if (o.parallax.type!=="off" || o.viewPort.enable || o.viewPort.enable=="true" || o.scrolleffect.on==="true" || o.scrolleffect.on)
  887. n.parallax = true;
  888. }
  889. if (o.sliderType=="hero") {
  890. n.carousel = false;
  891. n.navigation = false;
  892. }
  893. if (window.location.href.match(/file:/gi)) {
  894. n.filesystem = true;
  895. o.filesystem = true;
  896. }
  897. // LOAD THE NEEDED LIBRARIES
  898. if (n.videos && typeof _R.isVideoPlaying=='undefined') lAjax('revolution.extension.video',o);
  899. if (n.carousel && typeof _R.prepareCarousel=='undefined') lAjax('revolution.extension.carousel',o);
  900. if (!n.carousel && typeof _R.animateSlide=='undefined') lAjax('revolution.extension.slideanims',o);
  901. if (n.actions && typeof _R.checkActions=='undefined') lAjax('revolution.extension.actions',o);
  902. if (n.layeranim && typeof _R.handleStaticLayers=='undefined') lAjax('revolution.extension.layeranimation',o);
  903. if (n.kenburns && typeof _R.stopKenBurn=='undefined') lAjax('revolution.extension.kenburn',o);
  904. if (n.navigation && typeof _R.createNavigation=='undefined') lAjax('revolution.extension.navigation',o);
  905. if (n.migration && typeof _R.migration=='undefined') lAjax('revolution.extension.migration',o);
  906. if (n.parallax && typeof _R.checkForParallax=='undefined') lAjax('revolution.extension.parallax',o);
  907. if (o.addons!=undefined && o.addons.length>0) {
  908. jQuery.each(o.addons, function(i,obj) {
  909. if (typeof obj === "object" && obj.fileprefix!=undefined)
  910. lAjax(obj.fileprefix,o);
  911. })
  912. }
  913. return n;
  914. }
  915. ///////////////////////////////////
  916. // - WAIT FOR SCRIPT LOADS - //
  917. ///////////////////////////////////
  918. var waitForScripts = function(c,o) {
  919. // CHECK KEN BURN DEPENDENCIES
  920. var addonsloaded = true,
  921. n = o.scriptsneeded;
  922. // CHECK FOR ADDONS
  923. if (o.addons!=undefined && o.addons.length>0) {
  924. jQuery.each(o.addons, function(i,obj) {
  925. if (typeof obj === "object" && obj.init!=undefined) {
  926. if (_R[obj.init]===undefined) addonsloaded = false;
  927. }
  928. })
  929. }
  930. if (n.filesystem ||
  931. (typeof punchgs !== 'undefined' &&
  932. (addonsloaded) &&
  933. (!n.kenburns || (n.kenburns && typeof _R.stopKenBurn !== 'undefined')) &&
  934. (!n.navigation || (n.navigation && typeof _R.createNavigation !== 'undefined')) &&
  935. (!n.carousel || (n.carousel && typeof _R.prepareCarousel !== 'undefined')) &&
  936. (!n.videos || (n.videos && typeof _R.resetVideo !== 'undefined')) &&
  937. (!n.actions || (n.actions && typeof _R.checkActions !== 'undefined')) &&
  938. (!n.layeranim || (n.layeranim && typeof _R.handleStaticLayers !== 'undefined')) &&
  939. (!n.migration || (n.migration && typeof _R.migration !== 'undefined')) &&
  940. (!n.parallax || (n.parallax && typeof _R.checkForParallax !== 'undefined')) &&
  941. (n.carousel || (!n.carousel && typeof _R.animateSlide !== 'undefined'))
  942. ))
  943. c.trigger("scriptsloaded");
  944. else
  945. setTimeout(function() {
  946. waitForScripts(c,o);
  947. },50);
  948. }
  949. //////////////////////////////////
  950. // - GET SCRIPT LOCATION - //
  951. //////////////////////////////////
  952. var getScriptLocation = function(a) {
  953. var srcexp = new RegExp("themepunch.revolution.min.js","gi"),
  954. ret = "";
  955. jQuery("script").each(function() {
  956. var src = jQuery(this).attr("src");
  957. if (src && src.match(srcexp))
  958. ret = src;
  959. });
  960. ret = ret.replace('jquery.themepunch.revolution.min.js', '');
  961. ret = ret.replace('jquery.themepunch.revolution.js', '');
  962. ret = ret.split("?")[0];
  963. return ret;
  964. }
  965. //////////////////////////////////////////
  966. // - ADVANCED RESPONSIVE LEVELS - //
  967. //////////////////////////////////////////
  968. var setCurWinRange = function(opt,vis) {
  969. var curlevel = 0,
  970. curwidth = 9999,
  971. lastmaxlevel = 0,
  972. lastmaxid = 0,
  973. curid = 0,
  974. winw = jQuery(window).width(),
  975. l = vis && opt.responsiveLevels==9999 ? opt.visibilityLevels : opt.responsiveLevels;
  976. if (l && l.length)
  977. jQuery.each(l,function(index,level) {
  978. if (winw<level) {
  979. if (lastmaxlevel==0 || lastmaxlevel>level) {
  980. curwidth = level;
  981. curid = index;
  982. lastmaxlevel = level;
  983. }
  984. }
  985. if (winw>level && lastmaxlevel<level) {
  986. lastmaxlevel = level;
  987. lastmaxid = index;
  988. }
  989. });
  990. if (lastmaxlevel<curwidth)
  991. curid = lastmaxid;
  992. if (!vis)
  993. opt.curWinRange = curid;
  994. else
  995. opt.forcedWinRange = curid;
  996. }
  997. //////////////////////////////////////////
  998. // - INITIALISATION OF OPTIONS - //
  999. //////////////////////////////////////////
  1000. var prepareOptions = function(container,opt) {
  1001. opt.carousel.maxVisibleItems = opt.carousel.maxVisibleItems < 1 ? 999 : opt.carousel.maxVisibleItems; // === 1 ? 2 : opt.carousel.maxVisibleItems;
  1002. opt.carousel.vertical_align = opt.carousel.vertical_align === "top" ? "0%" : opt.carousel.vertical_align==="bottom" ? "100%" : "50%";
  1003. }
  1004. var gWiderOut = function(c,cl) {
  1005. var r = 0;
  1006. c.find(cl).each(function() {
  1007. var a = jQuery(this);
  1008. if (!a.hasClass("tp-forcenotvisible") && r<a.outerWidth())
  1009. r = a.outerWidth();
  1010. });
  1011. return r;
  1012. }
  1013. //////////////////////////////////////////
  1014. // - INITIALISATION OF SLIDER - //
  1015. //////////////////////////////////////////
  1016. var initSlider = function (container,opt) {
  1017. if (container==undefined) return false;
  1018. // CHECK FOR ALTERNATIVE IMAGE, AND IFRAM EXIST, AND WE ARE IN IE8, MOBILE, DRAW IT SIMPLE
  1019. if (container.data('aimg')!=undefined)
  1020. if ((container.data('aie8')=="enabled" && _R.isIE(8)) || (container.data('amobile')=="enabled" && _ISM))
  1021. container.html('<img class="tp-slider-alternative-image" src="'+container.data("aimg")+'">');
  1022. // PREPRARE SOME CLASSES AND VARIABLES
  1023. container.find('>ul').addClass("tp-revslider-mainul");
  1024. // CREATE SOME DEFAULT OPTIONS FOR LATER
  1025. opt.c=container;
  1026. opt.ul = container.find('.tp-revslider-mainul');
  1027. // Remove Not Needed Slides for Mobile Devices
  1028. opt.ul.find('>li').each(function(i) {
  1029. var li = jQuery(this);
  1030. if (li.data('hideslideonmobile')=="on" && _ISM) li.remove();
  1031. if (li.data('invisible') || li.data('invisible')===true) {
  1032. li.addClass("tp-invisible-slide");
  1033. li.appendTo(opt.ul);
  1034. }
  1035. });
  1036. if (opt.addons!=undefined && opt.addons.length>0) {
  1037. jQuery.each(opt.addons, function(i,obj) {
  1038. if (typeof obj === "object" && obj.init!=undefined) {
  1039. _R[obj.init](eval(obj.params));
  1040. }
  1041. })
  1042. }
  1043. opt.cid = container.attr('id');
  1044. opt.ul.css({visibility:"visible"});
  1045. opt.slideamount = opt.ul.find('>li').not('.tp-invisible-slide').length;
  1046. opt.realslideamount = opt.ul.find('>li').length;
  1047. opt.slayers = container.find('.tp-static-layers');
  1048. opt.slayers.data('index','staticlayers');
  1049. if (opt.waitForInit == true)
  1050. return;
  1051. else {
  1052. container[0].opt = opt;
  1053. runSlider(container,opt);
  1054. }
  1055. }
  1056. var onFullScreenChange = function() {
  1057. jQuery("body").data('rs-fullScreenMode',!jQuery("body").data('rs-fullScreenMode'));
  1058. if (jQuery("body").data('rs-fullScreenMode')) {
  1059. setTimeout(function() {
  1060. jQuery(window).trigger("resize");
  1061. },200);
  1062. }
  1063. }
  1064. var runSlider = function(container,opt) {
  1065. opt.sliderisrunning = true;
  1066. // Save Original Index of Slides
  1067. opt.ul.find('>li').each(function(i) {
  1068. jQuery(this).data('originalindex',i);
  1069. });
  1070. // RANDOMIZE THE SLIDER SHUFFLE MODE
  1071. if (opt.shuffle=="on") {
  1072. var fsa = new Object,
  1073. fli = opt.ul.find('>li:first-child');
  1074. fsa.fstransition = fli.data('fstransition');
  1075. fsa.fsmasterspeed = fli.data('fsmasterspeed');
  1076. fsa.fsslotamount = fli.data('fsslotamount');
  1077. for (var u=0;u<opt.slideamount;u++) {
  1078. var it = Math.round(Math.random()*opt.slideamount);
  1079. opt.ul.find('>li:eq('+it+')').prependTo(opt.ul);
  1080. }
  1081. var newfli = opt.ul.find('>li:first-child');
  1082. newfli.data('fstransition',fsa.fstransition);
  1083. newfli.data('fsmasterspeed',fsa.fsmasterspeed);
  1084. newfli.data('fsslotamount',fsa.fsslotamount);
  1085. // COLLECT ALL LI INTO AN ARRAY
  1086. opt.li = opt.ul.find('>li').not('.tp-invisible-slide');
  1087. }
  1088. opt.allli = opt.ul.find('>li');
  1089. opt.li = opt.ul.find('>li').not('.tp-invisible-slide');
  1090. opt.inli = opt.ul.find('>li.tp-invisible-slide');
  1091. opt.thumbs = new Array();
  1092. opt.slots=4;
  1093. opt.act=-1;
  1094. opt.firststart=1;
  1095. opt.loadqueue = new Array();
  1096. opt.syncload = 0;
  1097. opt.conw = container.width();
  1098. opt.conh = container.height();
  1099. if (opt.responsiveLevels.length>1)
  1100. opt.responsiveLevels[0] = 9999;
  1101. else
  1102. opt.responsiveLevels = 9999;
  1103. // RECORD THUMBS AND SET INDEXES
  1104. jQuery.each(opt.allli,function(index,li) {
  1105. var li = jQuery(li),
  1106. img = li.find('.rev-slidebg') || li.find('img').first(),
  1107. i = 0;
  1108. li.addClass("tp-revslider-slidesli");
  1109. if (li.data('index')===undefined) li.data('index','rs-'+Math.round(Math.random()*999999));
  1110. var obj = new Object;
  1111. obj.params = new Array();
  1112. obj.id = li.data('index');
  1113. obj.src = li.data('thumb')!==undefined ? li.data('thumb') : img.data('lazyload') !== undefined ? img.data('lazyload') : img.attr('src');
  1114. if (li.data('title') !== undefined) obj.params.push({from:RegExp("\\{\\{title\\}\\}","g"), to:li.data("title")})
  1115. if (li.data('description') !== undefined) obj.params.push({from:RegExp("\\{\\{description\\}\\}","g"), to:li.data("description")})
  1116. for (var i=1;i<=10;i++) {
  1117. if (li.data("param"+i)!==undefined)
  1118. obj.params.push({from:RegExp("\\{\\{param"+i+"\\}\\}","g"), to:li.data("param"+i)})
  1119. }
  1120. opt.thumbs.push(obj);
  1121. li.data('origindex',li.index());
  1122. // IF LINK ON SLIDE EXISTS, NEED TO CREATE A PROPER LAYER FOR IT.
  1123. if (li.data('link')!=undefined) {
  1124. var link = li.data('link'),
  1125. target= li.data('target') || "_self",
  1126. zindex= li.data('slideindex')==="back" ? 0 : 60,
  1127. linktoslide=li.data('linktoslide'),
  1128. checksl = linktoslide;
  1129. if (linktoslide != undefined)
  1130. if (linktoslide!="next" && linktoslide!="prev")
  1131. opt.allli.each(function() {
  1132. var t = jQuery(this);
  1133. if (t.data('origindex')+1==checksl) linktoslide = t.data('index');
  1134. });
  1135. if (link!="slide") linktoslide="no";
  1136. var apptxt = '<div class="tp-caption slidelink" style="cursor:pointer;width:100%;height:100%;z-index:'+zindex+';" data-x="center" data-y="center" data-basealign="slide" ',
  1137. jts = linktoslide==="scroll_under" ? '[{"event":"click","action":"scrollbelow","offset":"100px","delay":"0"}]' :
  1138. linktoslide==="prev" ? '[{"event":"click","action":"jumptoslide","slide":"prev","delay":"0.2"}]' :
  1139. linktoslide==="next" ? '[{"event":"click","action":"jumptoslide","slide":"next","delay":"0.2"}]' : '[{"event":"click","action":"jumptoslide","slide":"'+linktoslide+'","delay":"0.2"}]'
  1140. apptxt = linktoslide=="no" ? apptxt +' data-start="0">' : apptxt + 'data-actions='+"'"+jts + "'"+' data-start="0">';
  1141. apptxt = apptxt + '<a style="width:100%;height:100%;display:block"';
  1142. apptxt = link!="slide" ? apptxt + ' target="'+target+'" href="'+link+'"' : apptxt;
  1143. apptxt = apptxt + '><span style="width:100%;height:100%;display:block"></span></a></div>';
  1144. li.append(apptxt);
  1145. }
  1146. });
  1147. // CREATE GRID WIDTH AND HEIGHT ARRAYS
  1148. opt.rle = opt.responsiveLevels.length || 1;
  1149. opt.gridwidth = cArray(opt.gridwidth,opt.rle);
  1150. opt.gridheight = cArray(opt.gridheight,opt.rle);
  1151. // END OF VERSION 5.0 INIT MODIFICATION
  1152. // SIMPLIFY ANIMATIONS ON OLD IOS AND IE8 IF NEEDED
  1153. if (opt.simplifyAll=="on" && (_R.isIE(8) || _R.iOSVersion())) {
  1154. container.find('.tp-caption').each(function() {
  1155. var tc = jQuery(this);
  1156. tc.removeClass("customin customout").addClass("fadein fadeout");
  1157. tc.data('splitin',"");
  1158. tc.data('speed',400);
  1159. })
  1160. opt.allli.each(function() {
  1161. var li= jQuery(this);
  1162. li.data('transition',"fade");
  1163. li.data('masterspeed',500);
  1164. li.data('slotamount',1);
  1165. var img = li.find('.rev-slidebg') || li.find('>img').first();
  1166. img.data('kenburns',"off");
  1167. });
  1168. }
  1169. opt.desktop = !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i);
  1170. // SOME OPTIONS WHICH SHOULD CLOSE OUT SOME OTHER SETTINGS
  1171. opt.autoHeight = opt.sliderLayout=="fullscreen" ? "on" : opt.autoHeight;
  1172. if (opt.sliderLayout=="fullwidth" && opt.autoHeight=="off") container.css({maxHeight:opt.gridheight[opt.curWinRange]+"px"});
  1173. // BUILD A FORCE FULLWIDTH CONTAINER, TO SPAN THE FULL SLIDER TO THE FULL WIDTH OF BROWSER
  1174. if (opt.sliderLayout!="auto" && container.closest('.forcefullwidth_wrapper_tp_banner').length==0) {
  1175. if (opt.sliderLayout!=="fullscreen" || opt.fullScreenAutoWidth!="on") {
  1176. var cp = container.parent(),
  1177. mb = cp.css('marginBottom'),
  1178. mt = cp.css('marginTop'),
  1179. cid = container.attr('id')+"_forcefullwidth";
  1180. mb = mb===undefined ? 0 : mb;
  1181. mt = mt===undefined ? 0 : mt;
  1182. cp.wrap('<div class="forcefullwidth_wrapper_tp_banner" id="'+cid+'" style="position:relative;width:100%;height:auto;margin-top:'+mt+';margin-bottom:'+mb+'"></div>');
  1183. container.closest('.forcefullwidth_wrapper_tp_banner').append('<div class="tp-fullwidth-forcer" style="width:100%;height:'+container.height()+'px"></div>');
  1184. container.parent().css({marginTop:"0px",marginBottom:"0px"});
  1185. //container.css({'backgroundColor':container.parent().css('backgroundColor'),'backgroundImage':container.parent().css('backgroundImage')});
  1186. container.parent().css({position:'absolute'});
  1187. }
  1188. }
  1189. // SHADOW ADD ONS
  1190. if (opt.shadow!==undefined && opt.shadow>0) {
  1191. container.parent().addClass('tp-shadow'+opt.shadow);
  1192. container.parent().append('<div class="tp-shadowcover"></div>');
  1193. container.parent().find('.tp-shadowcover').css({'backgroundColor':container.parent().css('backgroundColor'),'backgroundImage':container.parent().css('backgroundImage')});
  1194. }
  1195. // ESTIMATE THE CURRENT WINDOWS RANGE INDEX
  1196. setCurWinRange(opt);
  1197. setCurWinRange(opt,true);
  1198. // IF THE CONTAINER IS NOT YET INITIALISED, LETS GO FOR IT
  1199. if (!container.hasClass("revslider-initialised")) {
  1200. // MARK THAT THE CONTAINER IS INITIALISED WITH SLIDER REVOLUTION ALREADY
  1201. container.addClass("revslider-initialised");
  1202. // FOR BETTER SELECTION, ADD SOME BASIC CLASS
  1203. container.addClass("tp-simpleresponsive");
  1204. // WE DONT HAVE ANY ID YET ? WE NEED ONE ! LETS GIVE ONE RANDOMLY FOR RUNTIME
  1205. if (container.attr('id')==undefined) {
  1206. container.attr('id',"revslider-"+Math.round(Math.random()*1000+5));
  1207. }
  1208. checkIDS(opt,container);
  1209. // CHECK IF FIREFOX 13 IS ON WAY.. IT HAS A STRANGE BUG, CSS ANIMATE SHOULD NOT BE USED
  1210. opt.firefox13 = false;
  1211. opt.ie = !jQuery.support.opacity;
  1212. opt.ie9 = (document.documentMode == 9);
  1213. opt.origcd=opt.delay;
  1214. // CHECK THE jQUERY VERSION
  1215. var version = jQuery.fn.jquery.split('.'),
  1216. versionTop = parseFloat(version[0]),
  1217. versionMinor = parseFloat(version[1]),
  1218. versionIncrement = parseFloat(version[2] || '0');
  1219. if (versionTop==1 && versionMinor < 7)
  1220. container.html('<div style="text-align:center; padding:40px 0px; font-size:20px; color:#992222;"> The Current Version of jQuery:'+version+' <br>Please update your jQuery Version to min. 1.7 in Case you wish to use the Revolution Slider Plugin</div>');
  1221. if (versionTop>1) opt.ie=false;
  1222. // PREPARE VIDEO PLAYERS
  1223. var addedApis = new Object();
  1224. addedApis.addedyt=0;
  1225. addedApis.addedvim=0;
  1226. addedApis.addedvid=0;
  1227. //PREPARING FADE IN/OUT PARALLAX
  1228. if (opt.scrolleffect.on)
  1229. opt.scrolleffect.layers = new Array();
  1230. container.find('.tp-caption, .rs-background-video-layer').each(function(i) {
  1231. var _nc = jQuery(this),
  1232. _ = _nc.data(),
  1233. an = _.autoplayonlyfirsttime,
  1234. ap = _.autoplay,
  1235. al = _nc.hasClass("tp-audiolayer"),
  1236. loop = _.videoloop,
  1237. addtofadeout = true,
  1238. addToStaticFadeout = false;
  1239. _.startclasses = _nc.attr('class');
  1240. _.isparallaxlayer = _.startclasses.indexOf("rs-parallax")>=0;
  1241. if (_nc.hasClass("tp-static-layer") && _R.handleStaticLayers) {
  1242. _R.handleStaticLayers(_nc,opt);
  1243. if (opt.scrolleffect.on)
  1244. if ((opt.scrolleffect.on_parallax_static_layers==="on" && _.isparallaxlayer) || (opt.scrolleffect.on_static_layers==="on" && !_.isparallaxlayer)) addToStaticFadeout = true;
  1245. addtofadeout=false;
  1246. }
  1247. var pom = _nc.data('noposteronmobile') || _nc.data('noPosterOnMobile') || _nc.data('posteronmobile') || _nc.data('posterOnMobile') || _nc.data('posterOnMObile');
  1248. _nc.data('noposteronmobile',pom);
  1249. // FIX VISIBLE IFRAME BUG IN SAFARI
  1250. var iff = 0;
  1251. _nc.find('iframe').each(function() {
  1252. punchgs.TweenLite.set(jQuery(this),{autoAlpha:0});
  1253. iff++;
  1254. })
  1255. if (iff>0)
  1256. _nc.data('iframes',true)
  1257. if (_nc.hasClass("tp-caption")) {
  1258. // PREPARE LAYERS AND WRAP THEM WITH PARALLAX, LOOP, MASK HELP CONTAINERS
  1259. var ec = _nc.hasClass("slidelink") ? "width:100% !important;height:100% !important;" : "",
  1260. _ndata = _nc.data(),
  1261. nctype = _ndata.type,
  1262. _pos = nctype==="row" || nctype==="column" ? "relative" : "absolute",
  1263. preclas = "";
  1264. if (nctype==="row") {
  1265. _nc.addClass("rev_row").removeClass("tp-resizeme");
  1266. preclas="rev_row_wrap";
  1267. } else
  1268. if (nctype==="column") {
  1269. preclas = "rev_column";
  1270. _nc.addClass("rev_column_inner").removeClass("tp-resizeme");;
  1271. _nc.data('width','auto');
  1272. punchgs.TweenLite.set(_nc,{width:'auto'});
  1273. } else
  1274. if (nctype==="group") {
  1275. _nc.removeClass("tp-resizeme")
  1276. }
  1277. var dmode = "",
  1278. preid = "";
  1279. if (nctype!=="row" && nctype!=="group" && nctype!=="column"){
  1280. dmode = "display:"+_nc.css('display')+";";
  1281. if (_nc.closest('.rev_column').length>0) {
  1282. _nc.addClass("rev_layer_in_column");
  1283. addtofadeout=false;
  1284. } else
  1285. if (_nc.closest('.rev_group').length>0) {
  1286. _nc.addClass("rev_layer_in_group");
  1287. addtofadeout=false;
  1288. }
  1289. } else
  1290. if (nctype==="column") addtofadeout = false;
  1291. if (_ndata.wrapper_class!==undefined) preclas = preclas+" "+_ndata.wrapper_class;
  1292. if (_ndata.wrapper_id!==undefined) preid ='id="'+_ndata.wrapper_id+'"';
  1293. _nc.wrap('<div '+preid+' class="tp-parallax-wrap '+preclas+'" style="'+ec+'position:'+_pos+';'+dmode+';visibility:hidden"><div class="tp-loop-wrap" style="'+ec+'position:'+_pos+';'+dmode+';"><div class="tp-mask-wrap" style="'+ec+'position:'+_pos+';'+dmode+';" ></div></div></div>');
  1294. // ONLY ADD LAYERS TO FADEOUT DYNAMIC LIST WHC
  1295. if (addtofadeout && opt.scrolleffect.on)
  1296. if ((opt.scrolleffect.on_parallax_layers==="on" && _.isparallaxlayer) || (opt.scrolleffect.on_layers==="on" && !_.isparallaxlayer))
  1297. opt.scrolleffect.layers.push(_nc.parent());
  1298. if (addToStaticFadeout) opt.scrolleffect.layers.push(_nc.parent());
  1299. // Add BG for Columns
  1300. if (nctype==="column") {
  1301. _nc.append('<div class="rev_column_bg rev_column_bg_man_sized" style="display:none"></div>');
  1302. _nc.closest('.tp-parallax-wrap').append('<div class="rev_column_bg rev_column_bg_auto_sized"></div>');
  1303. }
  1304. var lar = ['pendulum', 'rotate','slideloop','pulse','wave'],
  1305. _lc = _nc.closest('.tp-loop-wrap');
  1306. jQuery.each(lar,function(i,k) {
  1307. var lw = _nc.find('.rs-'+k),
  1308. f = lw.data() || "";
  1309. if (f!="") {
  1310. _lc.data(f);
  1311. _lc.addClass("rs-"+k);
  1312. lw.children(0).unwrap();
  1313. _nc.data('loopanimation',"on");
  1314. }
  1315. });
  1316. if (_nc.attr('id')===undefined)
  1317. _nc.attr('id','layer-'+Math.round(Math.random()*999999999));
  1318. checkIDS(opt,_nc);
  1319. punchgs.TweenLite.set(_nc,{visibility:"hidden"});
  1320. }
  1321. var as = _nc.data('actions');
  1322. if (as!==undefined) _R.checkActions(_nc,opt,as);
  1323. checkHoverDependencies(_nc,opt);
  1324. if (_R.checkVideoApis)
  1325. addedApis = _R.checkVideoApis(_nc,opt,addedApis);
  1326. // REMOVE VIDEO AUTOPLAYS FOR MOBILE DEVICES
  1327. if (_ISM) {
  1328. if (an == true || an=="true") {
  1329. _.autoplayonlyfirsttime=false;
  1330. an=false;
  1331. }
  1332. if (ap==true || ap=="true" || ap=="on" || ap=="1sttime") {
  1333. _.autoplay="off";
  1334. ap="off";
  1335. }
  1336. }
  1337. //loop = loop=="none" && _nc.hasClass('rs-background-video-layer') ? "loopandnoslidestop" : loop;
  1338. // PREPARE TIMER BEHAVIOUR BASED ON AUTO PLAYED VIDEOS IN SLIDES
  1339. if (!al && (an == true || an=="true" || ap == "1sttime") && loop !="loopandnoslidestop")
  1340. _nc.closest('li.tp-revslider-slidesli').addClass("rs-pause-timer-once");
  1341. if (!al && (ap==true || ap=="true" || ap == "on" || ap == "no1sttime") && loop !="loopandnoslidestop")
  1342. _nc.closest('li.tp-revslider-slidesli').addClass("rs-pause-timer-always");
  1343. });
  1344. container[0].addEventListener('mouseenter',function() {
  1345. container.trigger('tp-mouseenter');
  1346. opt.overcontainer=true;
  1347. },{passive:true});
  1348. container[0].addEventListener('mouseover',function() {
  1349. container.trigger('tp-mouseover');
  1350. opt.overcontainer=true;
  1351. },{passive:true});
  1352. container[0].addEventListener('mouseleave',function() {
  1353. container.trigger('tp-mouseleft');
  1354. opt.overcontainer=false;
  1355. },{passive:true});
  1356. // REMOVE ANY VIDEO JS SETTINGS OF THE VIDEO IF NEEDED (OLD FALL BACK, AND HELP FOR 3THD PARTY PLUGIN CONFLICTS)
  1357. container.find('.tp-caption video').each(function(i) {
  1358. var v = jQuery(this);
  1359. v.removeClass("video-js vjs-default-skin");
  1360. v.attr("preload","");
  1361. v.css({display:"none"});
  1362. });
  1363. //PREPARE LOADINGS ALL IN SEQUENCE
  1364. if (opt.sliderType!=="standard") opt.lazyType = "all";
  1365. // PRELOAD STATIC LAYERS
  1366. loadImages(container.find('.tp-static-layers'),opt,0,true);
  1367. waitForCurrentImages(container.find('.tp-static-layers'),opt,function() {
  1368. container.find('.tp-static-layers img').each(function() {
  1369. var e = jQuery(this),
  1370. src = e.data('lazyload') != undefined ? e.data('lazyload') : e.attr('src'),
  1371. loadobj = getLoadObj(opt,src);
  1372. e.attr('src',loadobj.src)
  1373. })
  1374. });
  1375. opt.rowzones = [];
  1376. // SET ALL LI AN INDEX AND INIT LAZY LOADING
  1377. opt.allli.each(function(i) {
  1378. var li = jQuery(this);
  1379. opt.rowzones[i] = [];
  1380. li.find('.rev_row_zone').each(function() {
  1381. opt.rowzones[i].push(jQuery(this));
  1382. })
  1383. if (opt.lazyType=="all" || (opt.lazyType=="smart" && (i==0 || i == 1 || i == opt.slideamount || i == opt.slideamount-1))) {
  1384. loadImages(li,opt,i);
  1385. waitForCurrentImages(li,opt,function() {
  1386. //if (opt.sliderType=="carousel")
  1387. //punchgs.TweenLite.to(li,1,{autoAlpha:1,ease:punchgs.Power3.easeInOut});
  1388. });
  1389. }
  1390. });
  1391. // IF DEEPLINK HAS BEEN SET
  1392. var deeplink = getUrlVars("#")[0];
  1393. if (deeplink.length<9) {
  1394. if (deeplink.split('slide').length>1) {
  1395. var dslide=parseInt(deeplink.split('slide')[1],0);
  1396. if (dslide<1) dslide=1;
  1397. if (dslide>opt.slideamount) dslide=opt.slideamount;
  1398. opt.startWithSlide=dslide-1;
  1399. }
  1400. }
  1401. // PREPARE THE SPINNER
  1402. container.append( '<div class="tp-loader '+opt.spinner+'">'+
  1403. '<div class="dot1"></div>'+
  1404. '<div class="dot2"></div>'+
  1405. '<div class="bounce1"></div>'+
  1406. '<div class="bounce2"></div>'+
  1407. '<div class="bounce3"></div>'+
  1408. '</div>');
  1409. opt.loader = container.find('.tp-loader');
  1410. // RESET THE TIMER
  1411. if (container.find('.tp-bannertimer').length===0) container.append('<div class="tp-bannertimer" style="visibility:hidden"></div>');
  1412. container.find('.tp-bannertimer').css({'width':'0%'});
  1413. // PREPARE THE SLIDES
  1414. opt.ul.css({'display':'block'});
  1415. prepareSlides(container,opt);
  1416. if ((opt.parallax.type!=="off" || opt.scrolleffect.on) && _R.checkForParallax) _R.checkForParallax(container,opt);
  1417. // PREPARE SLIDER SIZE
  1418. _R.setSize(opt);
  1419. // Call the Navigation Builder
  1420. if (opt.sliderType!=="hero" && _R.createNavigation) _R.createNavigation(container,opt);
  1421. if (_R.resizeThumbsTabs && _R.resizeThumbsTabs) _R.resizeThumbsTabs(opt);
  1422. contWidthManager(opt);
  1423. var _v = opt.viewPort;
  1424. opt.inviewport = false;
  1425. if (_v !=undefined && _v.enable) {
  1426. if (!jQuery.isNumeric(_v.visible_area))
  1427. if (_v.visible_area.indexOf('%')!==-1)
  1428. _v.visible_area = parseInt(_v.visible_area)/100;
  1429. if (_R.scrollTicker) _R.scrollTicker(opt,container);
  1430. }
  1431. // MAKE SURE CAROUSEL IS NOT YET VISIBE BEFORE IT COMES INTO GAME
  1432. if (opt.sliderType==="carousel" && _R.prepareCarousel) {
  1433. punchgs.TweenLite.set(opt.ul,{opacity:0});
  1434. _R.prepareCarousel(opt,new punchgs.TimelineLite,undefined,0);
  1435. opt.onlyPreparedSlide = true;
  1436. }
  1437. // START THE SLIDER
  1438. setTimeout(function() {
  1439. if (!_v.enable || (_v.enable && opt.inviewport) || (_v.enable && !opt.inviewport && !_v.outof=="wait"))
  1440. swapSlide(container);
  1441. else {
  1442. opt.c.addClass("tp-waitforfirststart");
  1443. opt.waitForFirstSlide = true;
  1444. if (_v.presize) {
  1445. var nextli = jQuery(opt.li[0]);
  1446. // PRELOAD STATIC LAYERS
  1447. loadImages(nextli,opt,0,true);
  1448. waitForCurrentImages(nextli.find('.tp-layers'),opt,function() {
  1449. _R.animateTheCaptions({slide:nextli,opt:opt, preset:true});
  1450. })
  1451. }
  1452. }
  1453. if (_R.manageNavigation) _R.manageNavigation(opt);
  1454. // START COUNTDOWN
  1455. if (opt.slideamount>1) {
  1456. if (!_v.enable || (_v.enable && opt.inviewport))
  1457. countDown(container,opt);
  1458. else
  1459. opt.waitForCountDown = true;
  1460. }
  1461. setTimeout(function() {
  1462. container.trigger('revolution.slide.onloaded');
  1463. },100);
  1464. },opt.startDelay);
  1465. opt.startDelay=0;
  1466. /******************************
  1467. - FULLSCREEN CHANGE -
  1468. ********************************/
  1469. // FULLSCREEN MODE TESTING
  1470. jQuery("body").data('rs-fullScreenMode',false);
  1471. window.addEventListener('fullscreenchange',onFullScreenChange,{passive:true});
  1472. window.addEventListener('mozfullscreenchange',onFullScreenChange,{passive:true});
  1473. window.addEventListener('webkitfullscreenchange',onFullScreenChange,{passive:true});
  1474. var resizid = "resize.revslider-"+container.attr('id');
  1475. // IF RESIZED, NEED TO STOP ACTUAL TRANSITION AND RESIZE ACTUAL IMAGES
  1476. jQuery(window).on(resizid,function() {
  1477. if (container==undefined) return false;
  1478. if (jQuery('body').find(container)!=0)
  1479. contWidthManager(opt);
  1480. var hchange = false;
  1481. if (opt.sliderLayout=="fullscreen") {
  1482. var jwh = jQuery(window).height();
  1483. if ((opt.fallbacks.ignoreHeightChanges=="mobile" && _ISM) || opt.fallbacks.ignoreHeightChanges=="always") {
  1484. opt.fallbacks.ignoreHeightChangesSize = opt.fallbacks.ignoreHeightChangesSize == undefined ? 0 : opt.fallbacks.ignoreHeightChangesSize;
  1485. hchange = (jwh!=opt.lastwindowheight) && (Math.abs(jwh-opt.lastwindowheight) > opt.fallbacks.ignoreHeightChangesSize)
  1486. } else {
  1487. hchange = (jwh!=opt.lastwindowheight)
  1488. }
  1489. }
  1490. if (container.outerWidth(true)!=opt.width || container.is(":hidden") || (hchange)) {
  1491. opt.lastwindowheight = jQuery(window).height();
  1492. containerResized(container,opt);
  1493. }
  1494. });
  1495. hideSliderUnder(container,opt);
  1496. contWidthManager(opt);
  1497. if (!opt.fallbacks.disableFocusListener && opt.fallbacks.disableFocusListener != "true" && opt.fallbacks.disableFocusListener !== true) tabBlurringCheck(container,opt);
  1498. }
  1499. }
  1500. /*************************************
  1501. - CREATE SIMPLE ARRAYS -
  1502. **************************************/
  1503. var cArray = function(b,l) {
  1504. if (!jQuery.isArray(b)) {
  1505. var t = b;
  1506. b = new Array();
  1507. b.push(t);
  1508. }
  1509. if (b.length<l) {
  1510. var t = b[b.length-1];
  1511. for (var i=0;i<(l-b.length)+2;i++)
  1512. b.push(t)
  1513. }
  1514. return b;
  1515. }
  1516. var checkHoverDependencies = function(_nc,opt) {
  1517. var _ = _nc.data(),
  1518. senter = _.start==="sliderenter" || (_.frames!==undefined && _.frames[0]!=undefined && _.frames[0].delay==="sliderenter") ? true : false;
  1519. if (senter) {
  1520. if (opt.layersonhover===undefined) {
  1521. opt.c.on('tp-mouseenter',function() {
  1522. if (opt.layersonhover)
  1523. jQuery.each(opt.layersonhover,function(i,tnc) {
  1524. var cli = tnc.data('closestli') || tnc.closest('.tp-revslider-slidesli'),
  1525. stl = tnc.data('staticli') || tnc.closest('.tp-static-layers');
  1526. if (tnc.data('closestli')===undefined) {
  1527. tnc.data('closestli',cli);
  1528. tnc.data('staticli',stl);
  1529. }
  1530. if ((cli.length>0 && (cli.hasClass("active-revslide")) || cli.hasClass("processing-revslide")) || (stl.length>0)) {
  1531. tnc.data('animdirection',"in");
  1532. if (_R.playAnimationFrame)
  1533. _R.playAnimationFrame({caption:tnc,opt:opt,frame:"frame_0", triggerdirection:"in", triggerframein:"frame_0", triggerframeout:"frame_999"});
  1534. tnc.data('triggerstate',"on");
  1535. }
  1536. });
  1537. });
  1538. opt.c.on('tp-mouseleft',function() {
  1539. if (opt.layersonhover)
  1540. jQuery.each(opt.layersonhover,function(i,tnc) {
  1541. tnc.data('animdirection',"out");
  1542. tnc.data('triggered',true);
  1543. tnc.data('triggerstate',"off");
  1544. if (_R.stopVideo) _R.stopVideo(tnc,opt);
  1545. if (_R.playAnimationFrame) _R.playAnimationFrame({caption:tnc,opt:opt,frame:"frame_999", triggerdirection:"out", triggerframein:"frame_0", triggerframeout:"frame_999"});
  1546. });
  1547. });
  1548. opt.layersonhover = new Array;
  1549. }
  1550. opt.layersonhover.push(_nc);
  1551. }
  1552. }
  1553. var contWidthManager = function(opt) {
  1554. var rl = _R.getHorizontalOffset(opt.c,"left");
  1555. if (opt.sliderLayout!="auto" && (opt.sliderLayout!=="fullscreen" || opt.fullScreenAutoWidth!="on")) {
  1556. var loff = Math.ceil(opt.c.closest('.forcefullwidth_wrapper_tp_banner').offset().left - rl);
  1557. punchgs.TweenLite.set(opt.c.parent(),{'left':(0-loff)+"px",'width':jQuery(window).width()-_R.getHorizontalOffset(opt.c,"both")});
  1558. } else {
  1559. if (opt.sliderLayout=="fullscreen" && opt.fullScreenAutoWidth=="on")
  1560. punchgs.TweenLite.set(opt.ul,{left:0,width:opt.c.width()});
  1561. else
  1562. punchgs.TweenLite.set(opt.ul,{left:rl,width:opt.c.width()-_R.getHorizontalOffset(opt.c,"both")});
  1563. }
  1564. // put Static Layer Wrapper in Position
  1565. if (opt.slayers && (opt.sliderLayout!="fullwidth" && opt.sliderLayout!="fullscreen"))
  1566. punchgs.TweenLite.set(opt.slayers,{left:rl});
  1567. }
  1568. var cv = function(a,d) {
  1569. return a===undefined ? d : a;
  1570. }
  1571. var hideSliderUnder = function(container,opt,resized) {
  1572. // FIRST TIME STOP/START HIDE / SHOW SLIDER
  1573. //REMOVE AND SHOW SLIDER ON DEMAND
  1574. var contpar= container.parent();
  1575. if (jQuery(window).width()<opt.hideSliderAtLimit) {
  1576. container.trigger('stoptimer');
  1577. if (contpar.css('display')!="none")
  1578. contpar.data('olddisplay',contpar.css('display'));
  1579. contpar.css({display:"none"});
  1580. } else {
  1581. if (container.is(":hidden") && resized) {
  1582. if (contpar.data('olddisplay')!=undefined && contpar.data('olddisplay')!="undefined" && contpar.data('olddisplay') != "none")
  1583. contpar.css({display:contpar.data('olddisplay')});
  1584. else
  1585. contpar.css({display:"block"});
  1586. container.trigger('restarttimer');
  1587. setTimeout(function() {
  1588. containerResized(container,opt);
  1589. },150)
  1590. }
  1591. }
  1592. if (_R.hideUnHideNav) _R.hideUnHideNav(opt);
  1593. }
  1594. //////////////////////////
  1595. // CONTAINER RESIZED //
  1596. /////////////////////////
  1597. var containerResized = function (c,opt) {
  1598. c.trigger('revolution.slide.beforeredraw');
  1599. if (opt.infullscreenmode == true)
  1600. opt.minHeight = jQuery(window).height();
  1601. setCurWinRange(opt);
  1602. setCurWinRange(opt,true);
  1603. if (!_R.resizeThumbsTabs || _R.resizeThumbsTabs(opt)===true) {
  1604. hideSliderUnder(c,opt,true);
  1605. contWidthManager(opt);
  1606. if ( opt.sliderType =="carousel") _R.prepareCarousel(opt,true);
  1607. if (c===undefined) return false;
  1608. _R.setSize(opt);
  1609. opt.conw = opt.c.width();
  1610. opt.conh = opt.infullscreenmode ? opt.minHeight : opt.c.height();
  1611. var actsh = c.find('.active-revslide .slotholder'),
  1612. nextsh = c.find('.processing-revslide .slotholder');
  1613. removeSlots(c,opt,c,2);
  1614. if (opt.sliderType==="standard") {
  1615. punchgs.TweenLite.set(nextsh.find('.defaultimg'),{opacity:0});
  1616. actsh.find('.defaultimg').css({'opacity':1});
  1617. }
  1618. if ( opt.sliderType==="carousel" && opt.lastconw != opt.conw) {
  1619. clearTimeout(opt.pcartimer);
  1620. opt.pcartimer = setTimeout(function() {
  1621. _R.prepareCarousel(opt,true);
  1622. // SHOW ALL LAYERS IN ALL SLIDES FOR CAROUSEL
  1623. if (opt.sliderType=="carousel" && opt.carousel.showLayersAllTime==="on")
  1624. jQuery.each(opt.li,function(i) {
  1625. _R.animateTheCaptions({slide:jQuery(opt.li[i]), opt:opt,recall:true});
  1626. })
  1627. },100);
  1628. opt.lastconw = opt.conw;
  1629. }
  1630. if (_R.manageNavigation) _R.manageNavigation(opt);
  1631. if (_R.animateTheCaptions && c.find('.active-revslide').length>0) _R.animateTheCaptions({slide:c.find('.active-revslide'), opt:opt,recall:true});
  1632. if (nextsh.data('kenburns')=="on")
  1633. _R.startKenBurn(nextsh,opt,nextsh.data('kbtl').progress());
  1634. if (actsh.data('kenburns')=="on")
  1635. _R.startKenBurn(actsh,opt,actsh.data('kbtl').progress());
  1636. // DOUBLE CALL FOR SOME FUNCTION TO AVOID PORTRAIT/LANDSCAPE ISSUES, AND TO AVOID FULLSCREEN/NORMAL SWAP ISSUES
  1637. if (_R.animateTheCaptions && c.find('.processing-revslide').length>0) _R.animateTheCaptions({slide:c.find('.processing-revslide'), opt:opt,recall:true});
  1638. if (_R.manageNavigation) _R.manageNavigation(opt);
  1639. }
  1640. c.trigger('revolution.slide.afterdraw');
  1641. }
  1642. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1643. /////////////////////////////////////////////////////////////////////////////// PREPARING / REMOVING ////////////////////////////////////////////////////////
  1644. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1645. var setScale = function(opt) {
  1646. opt.bw = (opt.width / opt.gridwidth[opt.curWinRange]);
  1647. opt.bh = (opt.height / opt.gridheight[opt.curWinRange]);
  1648. if (opt.bh>opt.bw)
  1649. opt.bh=opt.bw
  1650. else
  1651. opt.bw = opt.bh;
  1652. if (opt.bh>1 || opt.bw>1) { opt.bw=1; opt.bh=1; }
  1653. }
  1654. /////////////////////////////////////////
  1655. // - PREPARE THE SLIDES / SLOTS - //
  1656. ///////////////////////////////////////
  1657. var prepareSlides = function(container,opt) {
  1658. container.find('.tp-caption').each(function() {
  1659. var c = jQuery(this);
  1660. if (c.data('transition')!==undefined) c.addClass(c.data('transition'));
  1661. });
  1662. // PREPARE THE UL CONTAINER TO HAVEING MAX HEIGHT AND HEIGHT FOR ANY SITUATION
  1663. opt.ul.css({overflow:'hidden',width:'100%',height:'100%',maxHeight:container.parent().css('maxHeight')})
  1664. if (opt.autoHeight=="on") {
  1665. opt.ul.css({overflow:'hidden',width:'100%',height:'100%',maxHeight:"none"});
  1666. container.css({'maxHeight':'none'});
  1667. container.parent().css({'maxHeight':'none'});
  1668. }
  1669. //_R.setSize("",opt);
  1670. opt.allli.each(function(j) {
  1671. var li=jQuery(this),
  1672. originalIndex = li.data('originalindex');
  1673. //START WITH CORRECT SLIDE
  1674. if ((opt.startWithSlide !=undefined && originalIndex==opt.startWithSlide) || opt.startWithSlide ===undefined && j==0)
  1675. li.addClass("next-revslide");
  1676. // MAKE LI OVERFLOW HIDDEN FOR FURTHER ISSUES
  1677. li.css({'width':'100%','height':'100%','overflow':'hidden'});
  1678. });
  1679. if (opt.sliderType === "carousel") {
  1680. //SET CAROUSEL
  1681. opt.ul.css({overflow:"visible"}).wrap('<div class="tp-carousel-wrapper" style="width:100%;height:100%;position:absolute;top:0px;left:0px;overflow:hidden;"></div>');
  1682. var apt = '<div style="clear:both;display:block;width:100%;height:1px;position:relative;margin-bottom:-1px"></div>';
  1683. opt.c.parent().prepend(apt);
  1684. opt.c.parent().append(apt);
  1685. _R.prepareCarousel(opt);
  1686. }
  1687. // RESOLVE OVERFLOW HIDDEN OF MAIN CONTAINER
  1688. container.parent().css({'overflow':'visible'});
  1689. opt.allli.find('>img').each(function(j) {
  1690. var img=jQuery(this),
  1691. cli = img.closest('li'),
  1692. bgvid = cli.find('.rs-background-video-layer');
  1693. bgvid.addClass("defaultvid").css({zIndex:30});
  1694. img.addClass('defaultimg');
  1695. // TURN OF KEN BURNS IF WE ARE ON MOBILE AND IT IS WISHED SO
  1696. if (opt.fallbacks.panZoomDisableOnMobile == "on" && _ISM) {
  1697. img.data('kenburns',"off");
  1698. img.data('bgfit',"cover");
  1699. }
  1700. var mediafilter = cli.data('mediafilter');
  1701. mediafilter = mediafilter==="none" || mediafilter===undefined ? "" : mediafilter;
  1702. img.wrap('<div class="slotholder" style="position:absolute; top:0px; left:0px; z-index:0;width:100%;height:100%;"></div>');
  1703. bgvid.appendTo(cli.find('.slotholder'));
  1704. var dts = img.data();
  1705. img.closest('.slotholder').data(dts);
  1706. if (bgvid.length>0 && dts.bgparallax!=undefined)
  1707. bgvid.data('bgparallax',dts.bgparallax);
  1708. if (opt.dottedOverlay!="none" && opt.dottedOverlay!=undefined)
  1709. img.closest('.slotholder').append('<div class="tp-dottedoverlay '+opt.dottedOverlay+'"></div>');
  1710. var src=img.attr('src');
  1711. dts.src = src;
  1712. dts.bgfit = dts.bgfit || "cover";
  1713. dts.bgrepeat = dts.bgrepeat || "no-repeat",
  1714. dts.bgposition = dts.bgposition || "center center";
  1715. var pari = img.closest('.slotholder');
  1716. img.parent().append('<div class="tp-bgimg defaultimg '+mediafilter+'" style="background-color:'+img.css("backgroundColor")+';background-repeat:'+dts.bgrepeat+';background-image:url('+src+');background-size:'+dts.bgfit+';background-position:'+dts.bgposition+';width:100%;height:100%;"></div>');
  1717. img.data('mediafilter',mediafilter)
  1718. var comment = document.createComment("Runtime Modification - Img tag is Still Available for SEO Goals in Source - " + img.get(0).outerHTML);
  1719. img.replaceWith(comment);
  1720. img = pari.find('.tp-bgimg');
  1721. img.data(dts);
  1722. img.attr("src",src);
  1723. if (opt.sliderType === "standard" || opt.sliderType==="undefined")
  1724. img.css({'opacity':0});
  1725. })
  1726. if (opt.scrolleffect.on && opt.scrolleffect.on_slidebg==="on") {
  1727. opt.allslotholder = new Array();
  1728. opt.allli.find('.slotholder').each(function() {
  1729. jQuery(this).wrap('<div style="display:block;position:absolute;top:0px;left:0px;width:100%;height:100%" class="slotholder_fadeoutwrap"></div>')
  1730. });
  1731. opt.allslotholder = opt.c.find('.slotholder_fadeoutwrap');
  1732. }
  1733. }
  1734. // REMOVE SLOTS //
  1735. var removeSlots = function(container,opt,where,addon) {
  1736. opt.removePrepare = opt.removePrepare + addon;
  1737. where.find('.slot, .slot-circle-wrapper').each(function() {
  1738. jQuery(this).remove();
  1739. });
  1740. opt.transition = 0;
  1741. opt.removePrepare = 0;
  1742. }
  1743. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1744. /////////////////////////////////////////////////////////////////////////////// SLIDE SWAPS ////////////////////////////////////////////////////////////
  1745. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1746. // THE IMAGE IS LOADED, WIDTH, HEIGHT CAN BE SAVED
  1747. var cutParams = function(a) {
  1748. var b = a;
  1749. if (a!=undefined && a.length>0)
  1750. b = a.split("?")[0];
  1751. return b;
  1752. }
  1753. var relativeRedir = function(redir){
  1754. return location.pathname.replace(/(.*)\/[^/]*/, "$1/"+redir);
  1755. }
  1756. var abstorel = function (base, relative) {
  1757. var stack = base.split("/"),
  1758. parts = relative.split("/");
  1759. stack.pop(); // remove current file name (or empty string)
  1760. // (omit if "base" is the current folder without trailing slash)
  1761. for (var i=0; i<parts.length; i++) {
  1762. if (parts[i] == ".")
  1763. continue;
  1764. if (parts[i] == "..")
  1765. stack.pop();
  1766. else
  1767. stack.push(parts[i]);
  1768. }
  1769. return stack.join("/");
  1770. }
  1771. var imgLoaded = function(img,opt,progress) {
  1772. opt.syncload--;
  1773. if (opt.loadqueue)
  1774. jQuery.each(opt.loadqueue, function(index,queue) {
  1775. var mqsrc = queue.src.replace(/\.\.\/\.\.\//gi,""),
  1776. fullsrc = self.location.href,
  1777. origin = document.location.origin,
  1778. fullsrc_b = fullsrc.substring(0,fullsrc.length-1)+"/"+mqsrc,
  1779. origin_b = origin+"/"+mqsrc,
  1780. absolute = abstorel(self.location.href,queue.src);
  1781. fullsrc = fullsrc.substring(0,fullsrc.length-1)+mqsrc;
  1782. origin = origin+mqsrc;
  1783. if (cutParams(origin) === cutParams(decodeURIComponent(img.src)) ||
  1784. cutParams(fullsrc)=== cutParams(decodeURIComponent(img.src)) ||
  1785. cutParams(absolute)=== cutParams(decodeURIComponent(img.src)) ||
  1786. cutParams(origin_b) === cutParams(decodeURIComponent(img.src)) ||
  1787. cutParams(fullsrc_b)=== cutParams(decodeURIComponent(img.src)) ||
  1788. cutParams(queue.src) === cutParams(decodeURIComponent(img.src)) ||
  1789. cutParams(queue.src).replace(/^.*\/\/[^\/]+/, '') === cutParams(decodeURIComponent(img.src)).replace(/^.*\/\/[^\/]+/, '') ||
  1790. (window.location.origin==="file://" && cutParams(img.src).match(new RegExp(mqsrc)))) {
  1791. queue.progress = progress;
  1792. queue.width = img.width;
  1793. queue.height = img.height;
  1794. }
  1795. });
  1796. progressImageLoad(opt);
  1797. }
  1798. // PRELOAD IMAGES 3 PIECES ON ONE GO, CHECK LOAD PRIORITY
  1799. var progressImageLoad = function(opt) {
  1800. if (opt.syncload == 3) return;
  1801. if (opt.loadqueue)
  1802. jQuery.each(opt.loadqueue, function(index,queue) {
  1803. if (queue.progress.match(/prepared/g)) {
  1804. if (opt.syncload<=3) {
  1805. opt.syncload++;
  1806. if (queue.type=="img") {
  1807. var img = new Image();
  1808. img.onload = function() {
  1809. imgLoaded(this,opt,"loaded");
  1810. queue.error = false;
  1811. };
  1812. img.onerror = function() {
  1813. imgLoaded(this,opt,"failed");
  1814. queue.error = true;
  1815. };
  1816. img.src=queue.src;
  1817. } else {
  1818. jQuery.get(queue.src, function(data) {
  1819. queue.innerHTML = new XMLSerializer().serializeToString(data.documentElement);
  1820. queue.progress="loaded";
  1821. opt.syncload--;
  1822. progressImageLoad(opt);
  1823. }).fail(function() {
  1824. queue.progress="failed";
  1825. opt.syncload--;
  1826. progressImageLoad(opt);
  1827. });
  1828. }
  1829. queue.progress="inload";
  1830. }
  1831. }
  1832. });
  1833. }
  1834. // ADD TO QUEUE THE NOT LOADED IMAGES YES
  1835. var addToLoadQueue = function(src,opt,prio,type,staticlayer) {
  1836. var alreadyexist = false;
  1837. if (opt.loadqueue)
  1838. jQuery.each(opt.loadqueue, function(index,queue) {
  1839. if (queue.src === src) alreadyexist = true;
  1840. });
  1841. if (!alreadyexist) {
  1842. var loadobj = new Object();
  1843. loadobj.src = src;
  1844. loadobj.starttoload = jQuery.now();
  1845. loadobj.type = type || "img";
  1846. loadobj.prio = prio;
  1847. loadobj.progress = "prepared";
  1848. loadobj.static = staticlayer;
  1849. opt.loadqueue.push(loadobj);
  1850. }
  1851. }
  1852. // LOAD THE IMAGES OF THE PREDEFINED CONTAINER
  1853. var loadImages = function(container,opt,prio,staticlayer) {
  1854. container.find('img,.defaultimg, .tp-svg-layer').each(function() {
  1855. var element = jQuery(this),
  1856. src = element.data('lazyload') !== undefined && element.data('lazyload')!=="undefined" ? element.data('lazyload') : element.data('svg_src') !=undefined ? element.data('svg_src') : element.attr('src'),
  1857. type = element.data('svg_src') !=undefined ? "svg" : "img";
  1858. element.data('start-to-load',jQuery.now());
  1859. addToLoadQueue(src,opt,prio,type,staticlayer);
  1860. });
  1861. progressImageLoad(opt);
  1862. }
  1863. // FIND SEARCHED IMAGE/SRC IN THE LOAD QUEUE
  1864. var getLoadObj = function(opt,src) {
  1865. var obj = new Object();
  1866. if (opt.loadqueue)
  1867. jQuery.each(opt.loadqueue, function(index,queue) {
  1868. if (queue.src == src) obj = queue;
  1869. });
  1870. return obj;
  1871. }
  1872. // WAIT PROGRESS TILL THE PREDEFINED CONTAINER HAS ALL IMAGES LOADED INSIDE
  1873. var waitForCurrentImages = function(nextli,opt,callback) {
  1874. var waitforload = false;
  1875. // PRELOAD ALL IMAGES
  1876. nextli.find('img,.defaultimg, .tp-svg-layer').each(function() {
  1877. var element = jQuery(this),
  1878. src = element.data('lazyload') != undefined ? element.data('lazyload') : element.data('svg_src') !=undefined ? element.data('svg_src') : element.attr('src'),
  1879. loadobj = getLoadObj(opt,src);
  1880. // IF ELEMENTS IS NOT LOADED YET, AND IT IS NOW LOADED
  1881. if (element.data('loaded')===undefined && loadobj !==undefined && loadobj.progress && loadobj.progress.match(/loaded/g)) {
  1882. element.attr('src',loadobj.src);
  1883. // IF IT IS A DEFAULT IMG, WE NEED TO ASSIGN SOME SPECIAL VALUES TO IT
  1884. if (loadobj.type=="img") {
  1885. if (element.hasClass("defaultimg")) {
  1886. if (!_R.isIE(8))
  1887. element.css({backgroundImage:'url("'+loadobj.src+'")'});
  1888. else {
  1889. defimg.attr('src',loadobj.src);
  1890. }
  1891. nextli.data('owidth',loadobj.width);
  1892. nextli.data('oheight',loadobj.height);
  1893. nextli.find('.slotholder').data('owidth',loadobj.width);
  1894. nextli.find('.slotholder').data('oheight',loadobj.height);
  1895. } else {
  1896. var w = element.data('ww'),
  1897. h = element.data('hh');
  1898. element.data('owidth',loadobj.width);
  1899. element.data('oheight',loadobj.height);
  1900. w = w==undefined || w =="auto" || w=="" ? loadobj.width : w;
  1901. h = h==undefined || h =="auto" || h=="" ? loadobj.height : h;
  1902. if (!jQuery.isNumeric(w) && w.indexOf("%")>0)
  1903. h = w;
  1904. element.data('ww',w);
  1905. element.data('hh',h);
  1906. }
  1907. } else
  1908. if (loadobj.type=="svg" && loadobj.progress=="loaded") {
  1909. element.append('<div class="tp-svg-innercontainer"></div>');
  1910. element.find('.tp-svg-innercontainer').append(loadobj.innerHTML);
  1911. }
  1912. // ELEMENT IS NOW FULLY LOADED
  1913. element.data('loaded',true);
  1914. }
  1915. if (loadobj && loadobj.progress && loadobj.progress.match(/inprogress|inload|prepared/g))
  1916. if (!loadobj.error && jQuery.now()-element.data('start-to-load')<5000)
  1917. waitforload = true;
  1918. else {
  1919. loadobj.progress="failed";
  1920. if (!loadobj.reported_img) {
  1921. loadobj.reported_img = true;
  1922. console.warn(src+" Could not be loaded !");
  1923. }
  1924. }
  1925. // WAIT FOR VIDEO API'S
  1926. if (opt.youtubeapineeded == true && (!window['YT'] || YT.Player==undefined)) {
  1927. waitforload = true;
  1928. if (jQuery.now()-opt.youtubestarttime>5000 && opt.youtubewarning!=true) {
  1929. opt.youtubewarning = true;
  1930. var txt = "YouTube Api Could not be loaded !";
  1931. if (location.protocol === 'https:') txt = txt + " Please Check and Renew SSL Certificate !";
  1932. console.error(txt);
  1933. opt.c.append('<div style="position:absolute;top:50%;width:100%;color:#e74c3c; font-size:16px; text-align:center; padding:15px;background:#000; display:block;"><strong>'+txt+'</strong></div>')
  1934. }
  1935. }
  1936. if (opt.vimeoapineeded == true && !window['Froogaloop']) {
  1937. waitforload = true;
  1938. if (jQuery.now()-opt.vimeostarttime>5000 && opt.vimeowarning!=true) {
  1939. opt.vimeowarning= true;
  1940. var txt = "Vimeo Froogaloop Api Could not be loaded !";
  1941. if (location.protocol === 'https:') txt = txt + " Please Check and Renew SSL Certificate !";
  1942. console.error(txt);
  1943. opt.c.append('<div style="position:absolute;top:50%;width:100%;color:#e74c3c; font-size:16px; text-align:center; padding:15px;background:#000; display:block;"><strong>'+txt+'</strong></div>')
  1944. }
  1945. }
  1946. });
  1947. if (!_ISM && opt.audioqueue && opt.audioqueue.length>0) {
  1948. jQuery.each(opt.audioqueue,function(i,obj) {
  1949. if (obj.status && obj.status==="prepared")
  1950. if (jQuery.now() - obj.start<obj.waittime)
  1951. waitforload = true;
  1952. });
  1953. }
  1954. jQuery.each(opt.loadqueue,function(i,o) {
  1955. if (o.static===true && (o.progress!="loaded" || o.progress==="failed")) {
  1956. if (o.progress=="failed") {
  1957. if (!o.reported) {
  1958. o.reported = true;
  1959. console.warn("Static Image "+o.src+" Could not be loaded in time. Error Exists:"+o.error);
  1960. }
  1961. }
  1962. else
  1963. if (!o.error && jQuery.now()-o.starttoload<5000) {
  1964. waitforload = true;
  1965. }
  1966. else {
  1967. if (!o.reported) {
  1968. o.reported = true;
  1969. console.warn("Static Image "+o.src+" Could not be loaded within 5s! Error Exists:"+o.error);
  1970. }
  1971. }
  1972. }
  1973. });
  1974. if (waitforload)
  1975. punchgs.TweenLite.delayedCall(0.18,waitForCurrentImages,[nextli,opt,callback]);
  1976. else
  1977. punchgs.TweenLite.delayedCall(0.18,callback);
  1978. }
  1979. //////////////////////////////////////
  1980. // - CALL TO SWAP THE SLIDES - //
  1981. /////////////////////////////////////
  1982. var swapSlide = function(container) {
  1983. var opt = container[0].opt;
  1984. clearTimeout(opt.waitWithSwapSlide);
  1985. if (container.find('.processing-revslide').length>0) {
  1986. opt.waitWithSwapSlide = setTimeout(function() {
  1987. swapSlide(container);
  1988. },150);
  1989. return false;
  1990. }
  1991. var actli = container.find('.active-revslide'),
  1992. nextli = container.find('.next-revslide'),
  1993. defimg= nextli.find('.defaultimg');
  1994. if (opt.sliderType==="carousel" && !opt.carousel.fadein) {
  1995. punchgs.TweenLite.to(opt.ul,1,{opacity:1});
  1996. opt.carousel.fadein=true;
  1997. }
  1998. if (nextli.index() === actli.index() && opt.onlyPreparedSlide!==true) {
  1999. nextli.removeClass("next-revslide");
  2000. return false;
  2001. }
  2002. if (opt.onlyPreparedSlide===true) {
  2003. opt.onlyPreparedSlide=false;
  2004. jQuery(opt.li[0]).addClass("processing-revslide");
  2005. }
  2006. nextli.removeClass("next-revslide").addClass("processing-revslide");
  2007. if (nextli.index()===-1 && opt.sliderType==="carousel") nextli = jQuery(opt.li[0]);
  2008. nextli.data('slide_on_focus_amount',(nextli.data('slide_on_focus_amount')+1) || 1);
  2009. // CHECK IF WE ARE ALREADY AT LAST ITEM TO PLAY IN REAL LOOP SESSION
  2010. if (opt.stopLoop=="on" && nextli.index()==opt.lastslidetoshow-1) {
  2011. container.find('.tp-bannertimer').css({'visibility':'hidden'});
  2012. container.trigger('revolution.slide.onstop');
  2013. opt.noloopanymore = 1;
  2014. }
  2015. // INCREASE LOOP AMOUNTS
  2016. if (nextli.index()===opt.slideamount-1) {
  2017. opt.looptogo=opt.looptogo-1;
  2018. if (opt.looptogo<=0)
  2019. opt.stopLoop="on";
  2020. }
  2021. opt.tonpause = true;
  2022. container.trigger('stoptimer');
  2023. opt.cd=0;
  2024. if (opt.spinner==="off")
  2025. if (opt.loader!==undefined) opt.loader.css({display:"none"});
  2026. else
  2027. opt.loadertimer = setTimeout(function() {if (opt.loader!==undefined) opt.loader.css({display:"block"});},50);
  2028. loadImages(nextli,opt,1);
  2029. if (_R.preLoadAudio) _R.preLoadAudio(nextli,opt,1);
  2030. // WAIT FOR SWAP SLIDE PROGRESS
  2031. waitForCurrentImages(nextli,opt,function() {
  2032. // MANAGE BG VIDEOS
  2033. nextli.find('.rs-background-video-layer').each(function() {
  2034. var _nc = jQuery(this);
  2035. if (!_nc.hasClass("HasListener")) {
  2036. _nc.data('bgvideo',1);
  2037. if (_R.manageVideoLayer) _R.manageVideoLayer(_nc,opt);
  2038. }
  2039. if (_nc.find('.rs-fullvideo-cover').length==0)
  2040. _nc.append('<div class="rs-fullvideo-cover"></div>')
  2041. });
  2042. swapSlideProgress(defimg,container)
  2043. });
  2044. }
  2045. //////////////////////////////////////
  2046. // - PROGRESS SWAP THE SLIDES - //
  2047. /////////////////////////////////////
  2048. var swapSlideProgress = function(defimg,container) {
  2049. var actli = container.find('.active-revslide'),
  2050. nextli = container.find('.processing-revslide'),
  2051. actsh = actli.find('.slotholder'),
  2052. nextsh = nextli.find('.slotholder'),
  2053. opt = container[0].opt;
  2054. opt.tonpause=false;
  2055. opt.cd=0;
  2056. clearTimeout(opt.loadertimer);
  2057. if (opt.loader!==undefined) opt.loader.css({display:"none"});
  2058. // if ( opt.sliderType =="carousel") _R.prepareCarousel(opt);
  2059. _R.setSize(opt);
  2060. _R.slotSize(defimg,opt);
  2061. if (_R.manageNavigation) _R.manageNavigation(opt);
  2062. var data={};
  2063. data.nextslide=nextli;
  2064. data.currentslide=actli;
  2065. container.trigger('revolution.slide.onbeforeswap',data);
  2066. opt.transition = 1;
  2067. opt.videoplaying = false;
  2068. // IF DELAY HAS BEEN SET VIA THE SLIDE, WE TAKE THE NEW VALUE, OTHER WAY THE OLD ONE...
  2069. if (nextli.data('delay')!=undefined) {
  2070. opt.cd=0;
  2071. opt.delay=nextli.data('delay');
  2072. } else
  2073. opt.delay=opt.origcd;
  2074. if (nextli.data('ssop')=="true" || nextli.data('ssop')===true)
  2075. opt.ssop = true
  2076. else
  2077. opt.ssop = false;
  2078. container.trigger('nulltimer');
  2079. var ai = actli.index(),
  2080. ni = nextli.index();
  2081. opt.sdir = ni<ai ? 1 : 0;
  2082. if (opt.sc_indicator=="arrow") {
  2083. if (ai==0 && ni==opt.slideamount-1) opt.sdir = 1;
  2084. if (ai==opt.slideamount-1 && ni==0) opt.sdir = 0;
  2085. }
  2086. opt.lsdir = opt.lsdir === undefined ? opt.sdir : opt.lsdir;
  2087. opt.dirc = opt.lsdir != opt.sdir;
  2088. opt.lsdir = opt.sdir;
  2089. ///////////////////////////
  2090. // REMOVE THE CAPTIONS //
  2091. ///////////////////////////
  2092. if (actli.index() != nextli.index() && opt.firststart!=1)
  2093. if (_R.removeTheCaptions) _R.removeTheCaptions(actli,opt);
  2094. if (!nextli.hasClass('rs-pause-timer-once') && !nextli.hasClass("rs-pause-timer-always"))
  2095. container.trigger('restarttimer');
  2096. else
  2097. opt.videoplaying = true;
  2098. nextli.removeClass("rs-pause-timer-once");
  2099. var nexttrans,
  2100. direction=-1,
  2101. mtl;
  2102. opt.currentSlide = actli.index();
  2103. opt.nextSlide = nextli.index();
  2104. // SELECT SLIDER TYPE
  2105. if ( opt.sliderType =="carousel") {
  2106. mtl = new punchgs.TimelineLite();
  2107. _R.prepareCarousel(opt,mtl);
  2108. letItFree(container,nextsh,actsh,nextli,actli,mtl);
  2109. opt.transition = 0;
  2110. opt.firststart = 0;
  2111. } else {
  2112. mtl = new punchgs.TimelineLite({onComplete:function() {
  2113. letItFree(container,nextsh,actsh,nextli,actli,mtl);
  2114. }});
  2115. mtl.add(punchgs.TweenLite.set(nextsh.find('.defaultimg'),{opacity:0}));
  2116. mtl.pause();
  2117. if (_R.animateTheCaptions)
  2118. _R.animateTheCaptions({slide:nextli,opt:opt,preset:true});
  2119. if (opt.firststart==1) {
  2120. punchgs.TweenLite.set(actli,{autoAlpha:0});
  2121. opt.firststart=0;
  2122. }
  2123. punchgs.TweenLite.set(actli,{zIndex:18});
  2124. punchgs.TweenLite.set(nextli,{autoAlpha:0,zIndex:20});
  2125. // IF THERE IS AN OTHER FIRST SLIDE START HAS BEED SELECTED
  2126. if (nextli.data('differentissplayed') =='prepared') {
  2127. nextli.data('differentissplayed','done');
  2128. nextli.data('transition',nextli.data('savedtransition'));
  2129. nextli.data('slotamount',nextli.data('savedslotamount'));
  2130. nextli.data('masterspeed',nextli.data('savedmasterspeed'));
  2131. }
  2132. if (nextli.data('fstransition') != undefined && nextli.data('differentissplayed') !="done") {
  2133. nextli.data('savedtransition',nextli.data('transition'));
  2134. nextli.data('savedslotamount',nextli.data('slotamount'));
  2135. nextli.data('savedmasterspeed',nextli.data('masterspeed'));
  2136. nextli.data('transition',nextli.data('fstransition'));
  2137. nextli.data('slotamount',nextli.data('fsslotamount'));
  2138. nextli.data('masterspeed',nextli.data('fsmasterspeed'));
  2139. nextli.data('differentissplayed','prepared');
  2140. }
  2141. if (nextli.data('transition')==undefined) nextli.data('transition',"random");
  2142. nexttrans = 0;
  2143. var transtext = nextli.data('transition') !== undefined ? nextli.data('transition').split(",") : "fade",
  2144. curtransid = nextli.data('nexttransid') == undefined ? -1 : nextli.data('nexttransid');
  2145. if (nextli.data('randomtransition')=="on")
  2146. curtransid = Math.round(Math.random()*transtext.length);
  2147. else
  2148. curtransid=curtransid+1;
  2149. if (curtransid==transtext.length) curtransid=0;
  2150. nextli.data('nexttransid',curtransid);
  2151. var comingtransition = transtext[curtransid];
  2152. if (opt.ie) {
  2153. if (comingtransition=="boxfade") comingtransition = "boxslide";
  2154. if (comingtransition=="slotfade-vertical") comingtransition = "slotzoom-vertical";
  2155. if (comingtransition=="slotfade-horizontal") comingtransition = "slotzoom-horizontal";
  2156. }
  2157. if (_R.isIE(8))
  2158. comingtransition = 11;
  2159. mtl = _R.animateSlide(nexttrans, comingtransition, container, nextli, actli, nextsh, actsh, mtl);
  2160. if (nextsh.data('kenburns')=="on") {
  2161. _R.startKenBurn(nextsh,opt);
  2162. mtl.add(punchgs.TweenLite.set(nextsh,{autoAlpha:0}))
  2163. }
  2164. // SHOW FIRST LI && ANIMATE THE CAPTIONS
  2165. mtl.pause();
  2166. }
  2167. if (_R.scrollHandling) {
  2168. _R.scrollHandling(opt, true);
  2169. mtl.eventCallback("onUpdate",function() {
  2170. _R.scrollHandling(opt, true);
  2171. });
  2172. }
  2173. // START PARALLAX IF NEEDED
  2174. if (opt.parallax.type!="off" && opt.parallax.firstgo==undefined && _R.scrollHandling) {
  2175. opt.parallax.firstgo = true;
  2176. opt.lastscrolltop = -999;
  2177. _R.scrollHandling(opt,true);
  2178. setTimeout(function() {
  2179. opt.lastscrolltop = -999;
  2180. _R.scrollHandling(opt,true);
  2181. },210);
  2182. setTimeout(function() {
  2183. opt.lastscrolltop = -999;
  2184. _R.scrollHandling(opt,true);
  2185. },420);
  2186. }
  2187. if (_R.animateTheCaptions) {
  2188. if (opt.sliderType==="carousel" && opt.carousel.showLayersAllTime==="on") {
  2189. // SHOW ALL LAYERS IN ALL SLIDES FOR CAROUSEL
  2190. jQuery.each(opt.li,function(i) {
  2191. if (!opt.carousel.allLayersStarted) {
  2192. if (opt.li[i] === nextli)
  2193. _R.animateTheCaptions({slide:jQuery(opt.li[i]),maintimeline:mtl,opt:opt,startslideanimat:0});
  2194. else
  2195. _R.animateTheCaptions({slide:jQuery(opt.li[i]),opt:opt,startslideanimat:0});
  2196. }
  2197. else
  2198. _R.animateTheCaptions({slide:jQuery(opt.li[i]),opt:opt,recall:true});
  2199. });
  2200. opt.carousel.allLayersStarted = true;
  2201. } else {
  2202. _R.animateTheCaptions({slide:nextli, opt:opt,maintimeline:mtl,startslideanimat:0});
  2203. }
  2204. } else {
  2205. if (mtl != undefined) setTimeout(function() {
  2206. mtl.resume();
  2207. },30);
  2208. }
  2209. punchgs.TweenLite.to(nextli,0.001,{autoAlpha:1});
  2210. //if (_R.callStaticDDDParallax) _R.callStaticDDDParallax(container,opt,nextli);
  2211. }
  2212. //////////////////////////////////////////
  2213. // GIVE FREE THE TRANSITIOSN //
  2214. //////////////////////////////////////////
  2215. var letItFree = function(container,nextsh,actsh,nextli,actli,mtl) {
  2216. var opt = container[0].opt;
  2217. if (opt.sliderType==="carousel") {
  2218. // CAROUSEL SLIDER
  2219. } else {
  2220. opt.removePrepare = 0;
  2221. punchgs.TweenLite.to(nextsh.find('.defaultimg'),0.001,{zIndex:20,autoAlpha:1,onComplete:function() {
  2222. removeSlots(container,opt,nextli,1);
  2223. }});
  2224. if (nextli.index()!=actli.index()) {
  2225. punchgs.TweenLite.to(actli,0.2,{zIndex:18,autoAlpha:0,onComplete:function() {
  2226. removeSlots(container,opt,actli,1);
  2227. }});
  2228. }
  2229. }
  2230. container.find('.active-revslide').removeClass("active-revslide");
  2231. container.find('.processing-revslide').removeClass("processing-revslide").addClass("active-revslide");
  2232. opt.act=nextli.index();
  2233. opt.c.attr('data-slideactive',container.find('.active-revslide').data('index'));
  2234. if (opt.parallax.type=="scroll" || opt.parallax.type=="scroll+mouse" || opt.parallax.type=="mouse+scroll") {
  2235. opt.lastscrolltop = -999;
  2236. _R.scrollHandling(opt);
  2237. }
  2238. mtl.clear();
  2239. if (actsh.data('kbtl')!=undefined) {
  2240. actsh.data('kbtl').reverse();
  2241. actsh.data('kbtl').timeScale(25);
  2242. }
  2243. if (nextsh.data('kenburns')=="on") {
  2244. if (nextsh.data('kbtl')!=undefined) {
  2245. nextsh.data('kbtl').timeScale(1);
  2246. nextsh.data('kbtl').play();
  2247. }
  2248. else
  2249. _R.startKenBurn(nextsh,opt);
  2250. }
  2251. nextli.find('.rs-background-video-layer').each(function(i) {
  2252. if (_ISM) return false;
  2253. var _nc = jQuery(this)
  2254. _R.resetVideo(_nc,opt);
  2255. punchgs.TweenLite.fromTo(_nc,1,{autoAlpha:0},{autoAlpha:1,ease:punchgs.Power3.easeInOut,delay:0.2,onComplete:function() {
  2256. if (_R.animcompleted) _R.animcompleted(_nc,opt);
  2257. }});
  2258. });
  2259. actli.find('.rs-background-video-layer').each(function(i) {
  2260. if (_ISM) return false;
  2261. var _nc = jQuery(this);
  2262. if (_R.stopVideo) {
  2263. _R.resetVideo(_nc,opt);
  2264. _R.stopVideo(_nc,opt);
  2265. }
  2266. punchgs.TweenLite.to(_nc,1,{autoAlpha:0,ease:punchgs.Power3.easeInOut,delay:0.2});
  2267. });
  2268. // TIRGGER THE ON CHANGE EVENTS
  2269. var data={};
  2270. data.slideIndex=nextli.index()+1;
  2271. data.slideLIIndex=nextli.index();
  2272. data.slide = nextli;
  2273. data.currentslide=nextli;
  2274. data.prevslide = actli;
  2275. opt.last_shown_slide = actli.index();
  2276. container.trigger('revolution.slide.onchange',data);
  2277. container.trigger('revolution.slide.onafterswap',data);
  2278. opt.duringslidechange = false;
  2279. var lastSlideLoop = actli.data('slide_on_focus_amount'),
  2280. lastSlideMaxLoop = actli.data('hideafterloop');
  2281. if (lastSlideMaxLoop!=0 && lastSlideMaxLoop<=lastSlideLoop) opt.c.revremoveslide(actli.index());
  2282. var _actli = opt.nextSlide === -1 || opt.nextSlide===undefined ? 0 : opt.nextSlide;
  2283. _actli = _actli>opt.rowzones.length ? opt.rowzones.length : _actli;
  2284. if (opt.rowzones!=undefined && opt.rowzones.length>0 && opt.rowzones[_actli]!=undefined && _actli>=0 && _actli<=opt.rowzones.length && opt.rowzones[_actli].length>0) _R.setSize(opt);
  2285. //if (_R.callStaticDDDParallax) _R.callStaticDDDParallax(container,opt,nextli);
  2286. }
  2287. ///////////////////////////
  2288. // REMOVE THE LISTENERS //
  2289. ///////////////////////////
  2290. var removeAllListeners = function(container,opt) {
  2291. container.children().each(function() {
  2292. try{ jQuery(this).die('click'); } catch(e) {}
  2293. try{ jQuery(this).die('mouseenter');} catch(e) {}
  2294. try{ jQuery(this).die('mouseleave');} catch(e) {}
  2295. try{ jQuery(this).unbind('hover');} catch(e) {}
  2296. })
  2297. try{ container.die('click','mouseenter','mouseleave');} catch(e) {}
  2298. clearInterval(opt.cdint);
  2299. container=null;
  2300. }
  2301. ///////////////////////////
  2302. // - countDown - //
  2303. /////////////////////////
  2304. var countDown = function(container,opt) {
  2305. opt.cd=0;
  2306. opt.loop=0;
  2307. if (opt.stopAfterLoops!=undefined && opt.stopAfterLoops>-1)
  2308. opt.looptogo=opt.stopAfterLoops;
  2309. else
  2310. opt.looptogo=9999999;
  2311. if (opt.stopAtSlide!=undefined && opt.stopAtSlide>-1)
  2312. opt.lastslidetoshow=opt.stopAtSlide;
  2313. else
  2314. opt.lastslidetoshow=999;
  2315. opt.stopLoop="off";
  2316. if (opt.looptogo==0) opt.stopLoop="on";
  2317. var bt=container.find('.tp-bannertimer');
  2318. // LISTENERS //container.trigger('stoptimer');
  2319. container.on('stoptimer',function() {
  2320. var bt = jQuery(this).find('.tp-bannertimer');
  2321. bt[0].tween.pause();
  2322. if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
  2323. opt.sliderstatus = "paused";
  2324. _R.unToggleState(opt.slidertoggledby);
  2325. });
  2326. container.on('starttimer',function() {
  2327. if (opt.forcepause_viatoggle) return;
  2328. if (opt.conthover!=1 && opt.videoplaying!=true && opt.width>opt.hideSliderAtLimit && opt.tonpause != true && opt.overnav !=true && opt.ssop!=true)
  2329. if (opt.noloopanymore !== 1 && (!opt.viewPort.enable || opt.inviewport)) {
  2330. bt.css({visibility:"visible"});
  2331. bt[0].tween.resume();
  2332. opt.sliderstatus = "playing";
  2333. }
  2334. if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
  2335. _R.toggleState(opt.slidertoggledby);
  2336. });
  2337. container.on('restarttimer',function() {
  2338. if (opt.forcepause_viatoggle) return;
  2339. var bt = jQuery(this).find('.tp-bannertimer');
  2340. if (opt.mouseoncontainer && opt.navigation.onHoverStop=="on" && (!_ISM)) return false;
  2341. if (opt.noloopanymore !== 1 && (!opt.viewPort.enable || opt.inviewport) && opt.ssop!=true) {
  2342. bt.css({visibility:"visible"});
  2343. bt[0].tween.kill();
  2344. bt[0].tween=punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1});
  2345. opt.sliderstatus = "playing";
  2346. }
  2347. if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
  2348. _R.toggleState(opt.slidertoggledby);
  2349. });
  2350. container.on('nulltimer',function() {
  2351. bt[0].tween.kill();
  2352. bt[0].tween=punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1});
  2353. bt[0].tween.pause(0);
  2354. if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
  2355. opt.sliderstatus = "paused";
  2356. });
  2357. var countDownNext = function() {
  2358. if (jQuery('body').find(container).length==0) {
  2359. removeAllListeners(container,opt);
  2360. clearInterval(opt.cdint);
  2361. }
  2362. container.trigger("revolution.slide.slideatend");
  2363. //STATE OF API CHANGED -> MOVE TO AIP BETTER
  2364. if (container.data('conthover-changed') == 1) {
  2365. opt.conthover= container.data('conthover');
  2366. container.data('conthover-changed',0);
  2367. }
  2368. _R.callingNewSlide(container,1);
  2369. }
  2370. bt[0].tween=punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1});
  2371. if (opt.slideamount >1 && !(opt.stopAfterLoops==0 && opt.stopAtSlide==1)) {
  2372. container.trigger("starttimer");
  2373. }
  2374. else {
  2375. opt.noloopanymore = 1;
  2376. container.trigger("nulltimer");
  2377. }
  2378. container.on('tp-mouseenter',function() {
  2379. opt.mouseoncontainer = true;
  2380. if (opt.navigation.onHoverStop=="on" && (!_ISM)) {
  2381. container.trigger('stoptimer');
  2382. container.trigger('revolution.slide.onpause');
  2383. }
  2384. });
  2385. container.on('tp-mouseleft',function() {
  2386. opt.mouseoncontainer = false;
  2387. if (container.data('conthover')!=1 && opt.navigation.onHoverStop=="on" && ((opt.viewPort.enable==true && opt.inviewport) || opt.viewPort.enable==false)) {
  2388. container.trigger('revolution.slide.onresume');
  2389. container.trigger('starttimer');
  2390. }
  2391. });
  2392. }
  2393. //////////////////////////////////////////////////////
  2394. // * Revolution Slider - NEEDFULL FUNCTIONS
  2395. // * @version: 1.0 (30.10.2014)
  2396. // * @author ThemePunch
  2397. //////////////////////////////////////////////////////
  2398. // - BLUR / FOXUS FUNCTIONS ON BROWSER
  2399. var vis = (function(){
  2400. var stateKey,
  2401. eventKey,
  2402. keys = {
  2403. hidden: "visibilitychange",
  2404. webkitHidden: "webkitvisibilitychange",
  2405. mozHidden: "mozvisibilitychange",
  2406. msHidden: "msvisibilitychange"
  2407. };
  2408. for (stateKey in keys) {
  2409. if (stateKey in document) {
  2410. eventKey = keys[stateKey];
  2411. break;
  2412. }
  2413. }
  2414. return function(c) {
  2415. if (c) document.addEventListener(eventKey, c,{pasive:true});
  2416. return !document[stateKey];
  2417. }
  2418. })();
  2419. var restartOnFocus = function(opt) {
  2420. if (opt==undefined || opt.c==undefined) return false;
  2421. if (opt.windowfocused!=true) {
  2422. opt.windowfocused = true;
  2423. punchgs.TweenLite.delayedCall(0.3,function(){
  2424. // TAB IS ACTIVE, WE CAN START ANY PART OF THE SLIDER
  2425. if (opt.fallbacks.nextSlideOnWindowFocus=="on") opt.c.revnext();
  2426. opt.c.revredraw();
  2427. if (opt.lastsliderstatus=="playing")
  2428. opt.c.revresume();
  2429. });
  2430. }
  2431. }
  2432. var lastStatBlur = function(opt) {
  2433. opt.windowfocused = false;
  2434. opt.lastsliderstatus = opt.sliderstatus;
  2435. opt.c.revpause();
  2436. var actsh = opt.c.find('.active-revslide .slotholder'),
  2437. nextsh = opt.c.find('.processing-revslide .slotholder');
  2438. if (nextsh.data('kenburns')=="on")
  2439. _R.stopKenBurn(nextsh,opt);
  2440. if (actsh.data('kenburns')=="on")
  2441. _R.stopKenBurn(actsh,opt);
  2442. }
  2443. var tabBlurringCheck = function(container,opt) {
  2444. var notIE = (document.documentMode === undefined),
  2445. isChromium = window.chrome;
  2446. if (notIE && !isChromium) {
  2447. // checks for Firefox and other NON IE Chrome versions
  2448. jQuery(window).on("focusin", function () {
  2449. restartOnFocus(opt);
  2450. }).on("focusout", function () {
  2451. lastStatBlur(opt);
  2452. });
  2453. } else {
  2454. // checks for IE and Chromium versions
  2455. if (window.addEventListener) {
  2456. // bind focus event
  2457. window.addEventListener("focus", function (event) {
  2458. restartOnFocus(opt);
  2459. }, {capture:false,passive:true});
  2460. // bind blur event
  2461. window.addEventListener("blur", function (event) {
  2462. lastStatBlur(opt);
  2463. }, {capture:false,passive:true});
  2464. } else {
  2465. // bind focus event
  2466. window.attachEvent("focus", function (event) {
  2467. restartOnFocus(opt);
  2468. });
  2469. // bind focus event
  2470. window.attachEvent("blur", function (event) {
  2471. lastStatBlur(opt);
  2472. });
  2473. }
  2474. }
  2475. }
  2476. // - GET THE URL PARAMETER //
  2477. var getUrlVars = function (hashdivider){
  2478. var vars = [], hash;
  2479. var hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_');
  2480. for(var i = 0; i < hashes.length; i++)
  2481. {
  2482. hashes[i] = hashes[i].replace('%3D',"=");
  2483. hash = hashes[i].split('=');
  2484. vars.push(hash[0]);
  2485. vars[hash[0]] = hash[1];
  2486. }
  2487. return vars;
  2488. }
  2489. })(jQuery);