var widgetID = "JcPlsjO", showPops = "akla_YES", akla_main_radio_value = "akla_another_page_radio", akla_use_storage = "on", akla_isit = "nothing", cookieName = 'aklaVideoFloatWidget', video_float_akla_alerted = false; var aklaVideoFloatCookie = getCookie(cookieName); if (!this.showPops) { this.showPops = "notset-sp"; } var akla_cookie_check = false; if (akla_use_storage == "on") { var videofloatshow = false; //we are checking cookies! var aklacookieakla = 'all'; if(aklacookieakla == 'new') { if (aklaVideoFloatCookie == null) { akla_cookie_check = true; videofloatshow = true; setItem(cookieName, "old"); } } else { videofloatshow = true; if (aklacookieakla == 'returning') { if (aklaVideoFloatCookie == null) { akla_cookie_check = true; videofloatshow = false; } } setItem(cookieName, "old"); } } else { akla_cookie_check = true; } if (this.showPops == "akla_NO") { this.showPopsFilter = "dontshow"; } else { this.showPopsFilter = "show"; } /** * Determine the mobile operating system. * This function returns one of 'iOS', 'Android', 'Windows Phone', or 'unknown'. * * @returns {String} */ function getOperatingSystem() { var userAgent = navigator.userAgent || navigator.vendor || window.opera; // Windows Phone must come first because its UA also contains "Android" if (/windows phone/i.test(userAgent)) { return "windowsphone"; } if (/android/i.test(userAgent)) { return "android"; } // iOS detection from: http://stackoverflow.com/a/9039885/177710 if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { return "ios"; } return "nonmobile"; } if ("all"!="all" && getOperatingSystem() != "all" ) { video_float_akla_alerted = true; if ("all"=="mobile" && getOperatingSystem()!="nonmobile") { video_float_akla_alerted = false;} } var url = window.location.href; var video_float_show_url_include=true; if ("" != "") { video_float_show_url_include=false; if (url.indexOf("")>= 0) { video_float_show_url_include=true; } } var video_float_show_url_exclude=true; var videofloatexclude = ""; if (videofloatexclude != "") { video_float_show_url_exclude=true; if (url.indexOf(videofloatexclude)>= 0) { video_float_show_url_exclude=false } } var video_float_show_trafficesource = true; if ("all" != 'all') { video_float_show_trafficesource = false; if ("all" == 'adwords') { if (url.indexOf('?gclid')>= 0) { video_float_show_trafficesource=true; } } if ("all" == 'fb') { if (url.indexOf('source=facebook')>= 0) { video_float_show_trafficesource=true; } } if ("all" == 'organic') { if (url.indexOf('')>= 0) { video_float_show_trafficesource=true; } } } var video_float_disable = true; if("landing" == 'disable') { video_float_disable = false; } video_float_akla_alerted = video_float_akla_alerted || !(videofloatshow && video_float_show_trafficesource && video_float_show_url_exclude && video_float_show_url_include && video_float_disable); function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i -1) return hostname; return "." + hostname; } function hasItem (sKey) { if (!sKey) { return false; } return (new RegExp("(?:^|;\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\$&") + "\s*\=")).test(document.cookie); } if(video_float_akla_alerted == false) { var aklaVFstyle = document.createElement("link"); aklaVFstyle.rel = "stylesheet"; aklaVFstyle.href = "https://cdn.aklamator.com/css/videofloat2.css"; aklaVFstyle.type = "text/css"; document.getElementsByTagName("head")[0].appendChild(aklaVFstyle); var akla_video = document.createElement('div'); akla_video.id = 'akla_window'; }if(video_float_akla_alerted == false) { akla_video.innerHTML = '
'; }if(video_float_akla_alerted == false) {document.body.appendChild(akla_video); var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);}if(video_float_akla_alerted == false) {var player; var brojac = 0; var YTConfig = {'host': 'https://www.youtube.com'}; function onYouTubeIframeAPIReady() { brojac =0; player = new YT.Player('video_is_here', { videoId: 'xn2wNABlOl8', playerVars: { 'controls': 0, 'rel': 0, 'playsinline' : 1, 'autoplay': 1 }, events: { 'onReady': onPlayerReady, 'onStateChange' : onPlayerStateChange } }); } var ytloaded = false; function onPlayerStateChange(event) { if (brojac == 0) { ytloaded = true; switch(event.data) { case 0: player.loadPlaylist({ listType: 'playlist', playlist: ['NA_yWJneYkI'], index: 0 }); player.setShuffle(true); player.setLoop(true); brojac =1; break; } } } }if(video_float_akla_alerted == false) { var aklavideostate = 'paused'; function onPlayerReady(event) {event.target.playVideo(); player.mute(); aklavideostate = 'played'; } var pplay = document.getElementById('akla_video_play'); var ppause = document.getElementById('akla_video_pause'); var pmute = document.getElementById('akla_video_mute'); var punmute = document.getElementById('akla_video_unmute'); var pclose = document.getElementById('akla_video_close'); var pminify = document.getElementById('akla_video_minify'); var pexpand = document.getElementById('akla_video_expand'); var popen = document.getElementById('open_video'); var pclosed = document.getElementById('akla_video_closed'); var frontlogo = document.getElementById('front_window'); var backwindow = document.getElementById('back_window'); var pchangesize = document.getElementsByClassName('change_size'); var pchangewindow = document.getElementsByClassName('change_window'); var pchangevideo = document.getElementsByClassName('change_video'); function aklaVFshowhide(show, hide, action) { action; hide.style.display = 'none'; show.style.display = 'inline-flex'; } ppause.addEventListener("click", function(){ player.pauseVideo(); ppause.style.display = 'none'; pplay.style.display = 'inline-flex'; aklavideostate = 'paused'; }, false); pplay.addEventListener("click", function(){ player.playVideo(); pplay.style.display = 'none'; ppause.style.display = 'inline-flex'; aklavideostate = 'played'; }, false); pmute.addEventListener("click", function(){ player.mute(); pmute.style.display = 'none'; punmute.style.display = 'inline-flex'; }, false); punmute.addEventListener("click", function(){ player.unMute(); punmute.style.display = 'none'; pmute.style.display = 'inline-flex'; }, false); pexpand.addEventListener("click", function(){ for (var i=0; i < pchangesize.length; i++){ pchangesize[i].classList.remove("window_size"); pchangesize[i].classList.remove("bottom_right_position_window"); pchangesize[i].classList.add("window_size_big"); pchangesize[i].classList.add("position_big"); } backwindow.classList.add("backwindow_big"); pexpand.style.display = 'none'; pminify.style.display = 'inline-flex'; }, false); pclose.addEventListener("click", function(){ player.pauseVideo(); popen.style.display = 'none'; pclosed.style.display = 'block'; }, false); pclosed.addEventListener("click", function(){ player.playVideo(); player.unMute(); pclosed.style.display = 'none'; popen.style.display = 'block'; pplay.style.display = 'none'; ppause.style.display = 'inline-flex'; punmute.style.display = 'none'; pmute.style.display = 'inline-flex'; },false); pminify.addEventListener("click", function(){ for(var i=0; i < pchangewindow.length; i++){ pchangewindow[i].classList.add("window_size"); } for (var i=0; i < pchangesize.length; i++){ pchangesize[i].classList.add("bottom_right_position_window"); pchangesize[i].classList.remove("window_size_big"); pchangesize[i].classList.remove("position_big"); } backwindow.classList.remove("backwindow_big"); pminify.style.display = 'none'; pexpand.style.display = 'inline-flex'; }, false); }