window.getId = null window.mainFolder = "https://www.212warriors.com/darkonyx"; if(typeof waPlayer == "undefined") var waPlayer = []; if(typeof waPlayersArray == "undefined"){ var waPlayersArrayNum = 0; var waPlayersArray = []; } if(typeof wa_num == "undefined") var wa_num = 0; else wa_num++; wa_i = wa_num; if(typeof playerID != "undefined") wa_playerID = playerID; if(typeof wa_playerID != "undefined" && waPlayer[wa_playerID]) wa_playerID = -1; if(typeof wa_playerID != "undefined" && wa_playerID != -1) var wa_i = wa_playerID; waPlayersArray[waPlayersArrayNum] = wa_i; waPlayersArrayNum++; waPlayer[wa_i] = {}; waPlayer[wa_i].mainFolder = window.mainFolder if (window.getId) waPlayer[wa_i].getID = window.getId; else { if (typeof videoID != "undefined" && videoID != null && typeof videoQueue == "undefined") { waPlayer[wa_i].getID = videoID; videoID = null; } else waPlayer[wa_i].getID = -1; } if (typeof playerWidth == "undefined" || playerWidth == null) { if (wa_width < 250) wa_width = 250; waPlayer[wa_i].width = wa_width } else { if (playerWidth < 250) playerWidth = 250; waPlayer[wa_i].width = playerWidth; playerWidth = null } if (typeof playerHeight == "undefined" || playerHeight == null) { if (wa_height < 150) wa_height = 150; waPlayer[wa_i].height = wa_height } else { if (playerHeight < 150) playerHeight = 150; waPlayer[wa_i].height = playerHeight; playerHeight = null } waPlayer[wa_i].waControls = true; if (typeof waPlaylist != "undefined" || typeof wa_playlist != "undefined") if (typeof waPlaylist == "undefined") waPlayer[wa_i].playlist = wa_playlist; else waPlayer[wa_i].playlist = waPlaylist; waPlayer[wa_i].datafeedXML = null; waPlayer[wa_i].datafeedXMLString = ''; waPlayer[wa_i].advertXMLString = ''; waPlayer[wa_i].loadXML = function(d, f, g, j) { var h = this.id; var k = d.split('?')[0]; var l = ''; var m = d.substr(d.length - 3); if (m != 'xml') l = waPlayer[h].mainFolder + '/players/' + d; else l = waPlayer[h].mainFolder + '/panel/system/json/Reader.json.php?url=' + d; $.ajax({ url: l, dataType: 'jsonp', success: function(a) { var b = waPlayer[h].parseXML(a.d); if (b != null) { if (k == 'requests/darkonyx_datafeed.php') waPlayer[h].datafeedXMLString = a.d; else if (k == 'requests/add_advertfeed.php') waPlayer[h].advertXMLString = a.d; if (!g) f(b, h); else f(b, h, g, j) } else { waPlayer[h].hideLoader(); var c; if (k == 'requests/darkonyx_datafeed.php') c = 'A06'; else if (k == 'requests/add_videofeed.php') c = 'C03'; else if (k == 'requests/add_advertfeed.php') c = 'D03'; else c = 'A09'; waPlayer[h].showError('Error [' + c + ']') } }, error: function(a) { waPlayer[h].hideLoader(); var b; if (k == 'requests/darkonyx_datafeed.php') b = 'A04'; else if (k == 'requests/add_videofeed.php') b = 'C01'; else if (k == 'requests/add_advertfeed.php') b = 'D01'; else b = 'A07'; waPlayer[h].showError('Error [' + b + ']') } }) }; waPlayer[wa_i].parseXML = function(a) { var b = this.id; try { var c = $.parseXML(a), d = $(c) } catch (e) { return null } return d }; waPlayer[wa_i].parsePlayerData = function(b, c) { waPlayer[c].datafeedXML = b; if (!isMobile()) waPlayer[c].playerData.mode = b.find('darkOnyx').attr('playerMode'); else waPlayer[c].playerData.mode = 'auto'; waPlayer[c].playerData.state = b.find('darkOnyx').attr('state'); waPlayer[c].playerData.general.key = b.find('general').attr('key'); waPlayer[c].playerData.general.serial = b.find('general').attr('serial'); waPlayer[c].playerData.general.domain = b.find('general').find('domain').text(); waPlayer[c].playerData.general.folder = b.find('general').find('folder').text(); waPlayer[c].playerData.website.websiteURL = b.find('website').find('websiteURL').text(); waPlayer[c].playerData.website.websiteTitle = b.find('website').find('websiteTitle').text(); waPlayer[c].playerData.videos.buferTime = b.find('videos').attr('buferTime'); waPlayer[c].playerData.languages = new Object(); waPlayer[c].playerData.languages.defaultLang = b.find('languages').attr('default'); waPlayer[c].playerData.languages.languageArray = new Array(); b.find('languages').find('language').each(function(a) { waPlayer[c].playerData.languages.languageArray[a] = new Object(); waPlayer[c].playerData.languages.languageArray[a].label = $(this).attr('label'); waPlayer[c].playerData.languages.languageArray[a].short = $(this).attr('short'); waPlayer[c].playerData.languages.languageArray[a].url = $(this).text() }); waPlayer[wa_i].parseInterfaceData(b, c); if (waPlayer[c].getID != -1) waPlayer[c].parseVideosData(b, c); waPlayer[c].loadXML('languages/' + waPlayer[c].getDefaultLanguageUrl(), waPlayer[c].parseLanguageData) }; waPlayer[wa_i].parseInterfaceData = function(a, b) { waPlayer[b].playerData.videos.autoStart = a.find('settings').attr('autoStart'); waPlayer[b].playerData.videos.defaultQuality = a.find('settings').attr('defaultQuality'); waPlayer[b].playerData.interface.autoHide = a.find('interface').attr('autoHide'); waPlayer[b].playerData.interface.hideAfter = a.find('interface').attr('hideAfter'); waPlayer[b].playerData.interface.showTitle = a.find('interface').attr('showTitle'); waPlayer[b].playerData.interface.showTimes = a.find('interface').attr('showTimes'); waPlayer[b].playerData.interface.tipCloud = a.find('interface').attr('tipCloud'); waPlayer[b].playerData.interface.staticElements.bgColor = waPlayer[b].hexToRGB(a.find('staticElements').attr('bgColor')); waPlayer[b].playerData.interface.staticElements.progressColor = waPlayer[b].hexToRGB(a.find('staticElements').attr('progressColor')); waPlayer[b].playerData.interface.staticElements.toolbarColor = waPlayer[b].hexToRGB(a.find('staticElements').attr('toolbarColor')); waPlayer[b].playerData.interface.staticElements.toolbarAlpha = a.find('staticElements').attr('toolbarAlpha'); waPlayer[b].playerData.interface.activeElements.rollOverColor = waPlayer[b].hexToRGB(a.find('activeElements').attr('rollOverColor')); waPlayer[b].playerData.interface.activeElements.rollOverAlpha = a.find('activeElements').attr('rollOverAlpha'); waPlayer[b].playerData.interface.activeElements.rollOutColor = waPlayer[b].hexToRGB(a.find('activeElements').attr('rollOutColor')); waPlayer[b].playerData.interface.activeElements.rollOutAlpha = a.find('activeElements').attr('rollOutAlpha'); waPlayer[b].playerData.interface.watermark = a.find('interface').find('watermark').text(); waPlayer[b].playerData.interface.progressColor = a.find('interface').find('branding').attr('progressColor'); waPlayer[b].playerData.interface.volumeColor = a.find('interface').find('branding').attr('volumeColor'); waPlayer[b].playerData.interface.captions = a.find('interface').find('buttons').attr('captions'); waPlayer[b].playerData.interface.volume = a.find('interface').find('buttons').attr('volume'); waPlayer[b].playerData.interface.qualitySwitch = a.find('interface').find('buttons').attr('qualitySwitch'); waPlayer[b].playerData.interface.fullScreen = a.find('interface').find('buttons').attr('fullScreen'); waPlayer[b].playerData.interface.bigPlay = a.find('interface').find('buttons').attr('bigPlay'); waPlayer[b].playerData.interface.home = a.find('interface').find('screenIcons').attr('home'); waPlayer[b].playerData.interface.info = a.find('interface').find('screenIcons').attr('info'); waPlayer[b].playerData.interface.link = a.find('interface').find('screenIcons').attr('link'); waPlayer[b].playerData.interface.mail = a.find('interface').find('screenIcons').attr('mail'); waPlayer[b].playerData.interface.embed = a.find('interface').find('screenIcons').attr('embed'); waPlayer[b].playerData.interface.facebook = a.find('interface').find('screenIcons').attr('facebook'); waPlayer[b].playerData.interface.twitter = a.find('interface').find('screenIcons').attr('twitter') }; waPlayer[wa_i].setDefaultConfig = function() { var a = this.id; waPlayer[a].playerData = new Object(); waPlayer[a].playerData.mode = "auto"; waPlayer[a].playerData.state = "ok"; waPlayer[a].playerData.general = new Object(); waPlayer[a].playerData.general.key = "xxx"; waPlayer[a].playerData.general.serial = "xxx"; waPlayer[a].playerData.general.domain = "domain.com"; waPlayer[a].playerData.general.folder = "dafolder"; waPlayer[a].playerData.website = new Object(); waPlayer[a].playerData.website.websiteURL = "https://domain.com"; waPlayer[a].playerData.website.websiteTitle = "Title"; waPlayer[a].playerData.interface = new Object(); waPlayer[a].playerData.interface.autoHide = 1; waPlayer[a].playerData.interface.hideAfter = 5; waPlayer[a].playerData.interface.showTitle = 1; waPlayer[a].playerData.interface.showTimes = 1; waPlayer[a].playerData.interface.tipCloud = 1; waPlayer[a].playerData.interface.watermark = ''; waPlayer[a].playerData.interface.staticElements = new Object(); waPlayer[a].playerData.interface.staticElements.bgColor = waPlayer[a].hexToRGB('000000'); waPlayer[a].playerData.interface.staticElements.progressColor = waPlayer[a].hexToRGB('FF0000'); waPlayer[a].playerData.interface.staticElements.toolbarColor = waPlayer[a].hexToRGB('000000'); waPlayer[a].playerData.interface.staticElements.toolbarAlpha = 100; waPlayer[a].playerData.interface.activeElements = new Object(); waPlayer[a].playerData.interface.activeElements.rollOverColor = waPlayer[a].hexToRGB('FF0000'); waPlayer[a].playerData.interface.activeElements.rollOverAlpha = 100; waPlayer[a].playerData.interface.activeElements.rollOutColor = waPlayer[a].hexToRGB('000000'); waPlayer[a].playerData.interface.activeElements.rollOutAlpha = 100; waPlayer[a].playerData.interface.captions = 1; waPlayer[a].playerData.interface.volume = 1; waPlayer[a].playerData.interface.qualitySwitch = 1; waPlayer[a].playerData.interface.fullScreen = 1; waPlayer[a].playerData.interface.home = 1; waPlayer[a].playerData.interface.info = 1; waPlayer[a].playerData.interface.link = 1; waPlayer[a].playerData.interface.mail = 1; waPlayer[a].playerData.interface.embed = 1; waPlayer[a].playerData.interface.facebook = 1; waPlayer[a].playerData.interface.twitter = 1; waPlayer[a].playerData.interface.bigPlay = 1; waPlayer[a].playerData.videos = new Object(); waPlayer[a].playerData.videos.buferTime = 5; waPlayer[a].playerData.videos.autoStart = 0; waPlayer[a].playerData.videos.defaultQuality = "sd" }; waPlayer[wa_i].setConfig = function() { var a = this.id; waPlayer[a].xmlLoaded = true; if (waPlayer[a].waControls) { waPlayer[a].setLogo(); if (waPlayer[a].playerData.interface.showTitle == 1) waPlayer[a].videoNameObject.style.display = 'block'; else waPlayer[a].videoNameObject.style.display = 'none'; if (waPlayer[a].playerData.interface.bigPlay == 1 && !waPlayer[a].playing) waPlayer[a].showBigPlay(); else waPlayer[a].hideBigPlay(); waPlayer[a].setHub(); waPlayer[a].mainBar.style.backgroundColor = 'rgba(' + waPlayer[a].playerData.interface.staticElements.toolbarColor + ',' + (waPlayer[a].playerData.interface.staticElements.toolbarAlpha / 100) + ')'; waPlayer[a].playBig.style.backgroundColor = 'rgba(' + waPlayer[a].playerData.interface.staticElements.toolbarColor + ',' + (waPlayer[a].playerData.interface.staticElements.toolbarAlpha / 100) + ')'; waPlayer[a].buffer.style.backgroundColor = 'rgba(' + waPlayer[a].playerData.interface.staticElements.toolbarColor + ',' + (waPlayer[a].playerData.interface.staticElements.toolbarAlpha / 100) + ')'; waPlayer[a].mainBarPlayed.style.backgroundColor = 'rgb(' + waPlayer[a].playerData.interface.staticElements.progressColor + ')'; waPlayer[a].soundBarGradient.style.backgroundColor = 'rgb(' + waPlayer[a].playerData.interface.staticElements.progressColor + ')'; waPlayer[a].soundBar.style.backgroundColor = 'rgba(' + waPlayer[a].playerData.interface.staticElements.toolbarColor + ',' + (waPlayer[a].playerData.interface.staticElements.toolbarAlpha / 100) + ')'; waPlayer[a].qualityBar.style.backgroundColor = 'rgba(' + waPlayer[a].playerData.interface.staticElements.toolbarColor + ',' + (waPlayer[a].playerData.interface.staticElements.toolbarAlpha / 100) + ')'; waPlayer[a].fullScreenMode = true; waPlayer[a].goFullScreen() } if (waPlayer[a].getID == -1) { if (typeof waPlayer[a].clonedVideoObject != 'undefined') { waPlayer[a].fromJsObject = true; var c = waPlayer[a].prepareVideoObject(waPlayer[a].clonedVideoObject); waPlayer[a].addVideo(c); waPlayer[a].setVideo(c.id, waPlayer[a].playerData.videos.autoStart) } else if (waPlayer[a].videoQueue) { waPlayer[a].assignVideoQueue() } else waPlayer[a].showError('Error [C09]') } else waPlayer[a].setVideo(waPlayer[a].getID, waPlayer[a].playerData.videos.autoStart); if (waPlayer[a].playlist && typeof wap != "undefined" && typeof wap.keyword != "undefined") { wap.keyword.value = waPlayer[a].getLang('general', 'searchMovie'); wap.setColors(a); setTimeout("waPlayer[" + a + "].hideLoader()", 300) } else waPlayer[a].hideLoader() }; waPlayer[wa_i].parseLanguageData = function(a, b) { waPlayer[b].langXML = a; waPlayer[b].loadStatus++; if (waPlayer[b].loadStatus == 2) waPlayer[b].setConfig() }; waPlayer[wa_i].getLang = function(b, c, d, f) { var g = this.id; if (waPlayer[g].xmlLoaded) { var j = ''; if (d != null) j = waPlayer[g].langXML.find(b).find(c).find(d).text(); else if (c != null) j = waPlayer[g].langXML.find(b).find(c).text(); else j = waPlayer[g].langXML.find(b).text(); if (f) { var h; for (var k = 0; k < f.length; k++) { h = f[k].split('=>'); j = j.replace(new RegExp('{' + h[0] + '}', 'g'), h[1]) } } if (j.search(/{color\:([A-Za-z0-9#]+)}/i) != -1) { j = j.replace(/{color\:([A-Za-z0-9#]+)}/i, function(a) { a = a.replace('{color:', ''); a = a.replace('}', ''); a = a.replace('{/color}', ''); return '' }); j = j.replace('{/color}', '<\/span>') } } else var j = 'No data'; return j }; waPlayer[wa_i].getDefaultLanguageUrl = function() { var a = this.id; for (var b = 0; b < waPlayer[a].playerData.languages.languageArray.length; b++) { if (waPlayer[a].playerData.languages.languageArray[b].short == waPlayer[a].playerData.languages.defaultLang) return waPlayer[a].playerData.languages.languageArray[b].url } }; waPlayer[wa_i].currentSequenceObj = null; waPlayer[wa_i].availableQualities = new Array('sd', 'hd'); waPlayer[wa_i].prepareVideoObject = function(a) { var b = this.id; if (typeof a.id == "undefined") { var c = waPlayer[b].videosData.length; a.id = c } if (typeof a.sources != "undefined") for (var d = 0; d < a.sources.length; d++) { if (typeof a.sources[d] != "undefined") { a.sources[d].mode = waPlayer[b].support(a.sources[d].url, a.sources[d].method) } } return a }; waPlayer[wa_i].parseVideosData = function(c, d, f, g, j) { var h; if (!f) var f = 'videos'; c.find(f).find('video').each(function(b) { h = new Object(); h.id = $(this).attr('id'); h.channels = $(this).attr('channels'); h.duration = $(this).attr('duration'); h.state = $(this).attr('state'); h.title = $(this).find('title').text(); h.description = $(this).find('description').text(); h.tags = $(this).find('tags').text(); h.added = $(this).find('added').text(); h.minAge = $(this).find('minAge').text(); h.ageVerified = false; h.author = $(this).find('author').text(); h.poster = $(this).find('poster').text(); h.thumbnail = $(this).find('thumbnail').text(); h.link = $(this).find('link').text(); h.captions = new Array(); $(this).find('caption').each(function(a) { h.captions[a] = new Object(); h.captions[a].lang = $(this).attr('lang'); h.captions[a].url = $(this).text() }); h.sources = new Array(); $(this).find('sources').find('source').each(function(a) { h.sources[a] = new Object(); h.sources[a].type = $(this).attr('type').toLowerCase(); h.sources[a].method = $(this).attr('method').toLowerCase(); h.sources[a].url = $(this).text(); h.sources[a].mode = waPlayer[d].support(h.sources[a].url, h.sources[a].method) }); waPlayer[d].addVideo(h) }); waPlayer[d].mountedVideoContent = h; waPlayer[d].videoPrepared('video') }; waPlayer[wa_i].checkVideoErrors = function(a) { var b = this.id; if (typeof a.sources == 'undefined' || typeof a.sources[0] == 'undefined' || typeof a.sources.length == 0) { waPlayer[b].showError(waPlayer[b].getLang('messages', 'errors', 'videoID', new Array('videoID=>' + a.id))); return true } waPlayer[b].imageExists(a.poster); waPlayer[b].imageExists(a.thumbnail); return false }; waPlayer[wa_i].sequenceAutostart = 0; waPlayer[wa_i].setVideo = function(c, d, f) { var g = this.id; waPlayer[g].sequenceAdvertsReady = false; waPlayer[g].sequenceVideoReady = false; waPlayer[g].currentSequenceObj = false; if (typeof waPlayer[g].mountedVideo != "undefined" && waPlayer[g].mountedVideo.id == c) f = true; if (!f && !isMobile()) { var j = new Date().getTime(); waPlayer[g].loadXML('requests/add_advertfeed.php?rand=' + j + '&url=' + waPlayer[g].currentURL + waPlayer[g].campaignIDstring, function(a, b) { waPlayer[b].parseAdvertData(a, b) }) } else waPlayer[g].sequenceAdvertsReady = true; waPlayer[g].sequenceAutostart = d; var h = waPlayer[g].getVideo(c); if (h) { waPlayer[g].mountedVideoContent = h; waPlayer[g].videoPrepared('video') } else waPlayer[g].loadXML('requests/add_videofeed.php?videoID=' + c + ',&url=' + waPlayer[g].currentURL, waPlayer[g].parseVideosData, 'videoFeed') }; waPlayer[wa_i].sequenceAdvertsReady = false; waPlayer[wa_i].sequenceVideoReady = false; waPlayer[wa_i].videoPrepared = function(a) { var b = this.id; var c = waPlayer[b].sequenceAutostart; if (a == 'video') waPlayer[b].sequenceVideoReady = true; if (a == 'advert') waPlayer[b].sequenceAdvertsReady = true; if (!waPlayer[b].sequenceVideoReady || !waPlayer[b].sequenceAdvertsReady) return; waPlayer[b].runVideo(waPlayer[b].mountedVideoContent, c) }; waPlayer[wa_i].runVideo = function(a, b, c) { var d = this.id; if (waPlayer[d].checkVideoErrors(a)) return if (waPlayer[d].mountedVideo == a) return createCookie('wa_v_' + a.id); if (waPlayer[d].mountedVideo != a && !waPlayer[d].advertMode) { var f = waPlayer[d].getDefaultQualityBySources(waPlayer[d].playerData.videos.defaultQuality, a); waPlayer[d].setQualityMode(f) } waPlayer[d].mountedVideo = a; if (!c) var g = waPlayer[d].choosePlayerMode(waPlayer[d].currentQuality); else var g = c; if (a.state == 'denied') { var j = '' + a.link + ''; var h = waPlayer[d].getLang('messages', 'info', 'domainDenied', new Array('websiteName=>' + j)); waPlayer[d].showError(h, 10); return } waPlayer[d].setPlayerMode(g); if (g == 'html5') { waPlayer[d].videoPlayed = false; waPlayer[d].forceHideSubtitles = false; waPlayer[d].forceHideQualitySwitch = waPlayer[d].haveOneQuality(); if (waPlayer[d].waControls) { waPlayer[d].hideAgeVerificator(); waPlayer[d].hideAllMenuPanels(true); if (typeof waPlayer[d].mountedVideo.poster != "undefined" && waPlayer[d].mountedVideo.poster != '') { waPlayer[d].bigThumb.style.display = 'block'; waPlayer[d].bigThumbImg.src = waPlayer[d].mountedVideo.poster } else waPlayer[d].bigThumb.style.display = 'none'; waPlayer[d].resetVideoName(); if (waPlayer[d].mountedVideo.minAge > 0) { var k = readCookie('wa_age'); if (k == null) { b = 0; waPlayer[d].showAgeVerificator() } else if (waPlayer[d].mountedVideo.minAge > parseInt(k)) { b = 0; waPlayer[d].showAgeVerificator() } } if (waPlayer[d].playerData.interface.captions == 1) { waPlayer[d].subtitlesStop(); if (typeof waPlayer[d].mountedVideo.captions != 'undefined') { if (waPlayer[d].mountedVideo.captions[0].url != '') waPlayer[d].loadSubtitles(waPlayer[d].mountedVideo.captions[0].url); else waPlayer[d].forceHideSubtitles = true } else waPlayer[d].forceHideSubtitles = true } waPlayer[d].mainBarPlayed.style.width = '0px'; waPlayer[d].reMainBarElements(waPlayer[d].fullScreenMode); if ($.browser.chrome) { waPlayer[d].hideMainBar(); setTimeout(function() { waPlayer[d].PLAYERover() }, 50) } else waPlayer[d].PLAYERover() } else {} var l = waPlayer[d].getVideoSources(g, waPlayer[d].currentQuality); waPlayer[d].video.innerHTML = ''; for (var m = 0; m < l.length; m++) { if ($.browser.msie && jQuery.browser.version == '9.0') { if (waPlayer[d].IsExtension('mp4', l[m]) || waPlayer[d].IsExtension('mov', l[m])) waPlayer[d].video.setAttribute("src", l[m]) } else waPlayer[d].video.innerHTML += '' } if (b == 1) { if (waPlayer[d].waControls) { waPlayer[d].play() } else waPlayer[d].video.play() } } }; waPlayer[wa_i].haveOneQuality = function() { var a = this.id; var b = waPlayer[a].mountedVideo.sources[0].type; for (var c = 1; c < waPlayer[a].mountedVideo.sources.length; c++) { if (b != waPlayer[a].mountedVideo.sources[c].type) return false } return true }; waPlayer[wa_i].addVideo = function(a) { var b = this.id; if (a.id == 'preroll' || a.id == 'postroll') { var c = waPlayer[b].getVideoKey(a.id); if (c != -1) waPlayer[b].videosData[c] = a; else { var d = waPlayer[b].videosData.length; waPlayer[b].videosData[d] = a } } else if (!waPlayer[b].getVideo(a.id)) { var d = waPlayer[b].videosData.length; waPlayer[b].videosData[d] = a } }; waPlayer[wa_i].getVideoKey = function(a) { var b = this.id; for (var c = 0; c < waPlayer[b].videosData.length; c++) { if (waPlayer[b].videosData[c].id == a) return c } return -1 }; waPlayer[wa_i].getVideo = function(a) { var b = this.id; for (var c = 0; c < waPlayer[b].videosData.length; c++) { if (waPlayer[b].videosData[c].id == a) return waPlayer[b].videosData[c] } return false }; waPlayer[wa_i].assignVideoQueue = function() { var a = this.id; waPlayer[a].videoQueueON = true; waPlayer[a].currQueueID = waPlayer[a].videoQueue[0]; waPlayer[a].setVideo(waPlayer[a].videoQueue[0], waPlayer[a].playerData.videos.autoStart); waPlayer[a].addEventListener('videoSequenceStop', waPlayer[a].queueNextVideo) }; waPlayer[wa_i].stopVideoQueue = function() { var a = this.id; waPlayer[a].videoQueueON = false; waPlayer[a].removeEventListener('videoSequenceStop', waPlayer[a].queueNextVideo) }; waPlayer[wa_i].queueNextVideo = function(a, b) { var b = a.playerID; var c = a.videoID; if (waPlayer[b].videoQueueON) { var d = false; var f = -1; for (var g = 0; g < waPlayer[b].videoQueue.length; g++) { if (d) { f = waPlayer[b].videoQueue[g]; break } if (waPlayer[b].videoQueue[g] == waPlayer[b].currQueueID) { if (g != waPlayer[b].videoQueue.length - 1) d = true; else f = waPlayer[b].videoQueue[0] } } waPlayer[b].currQueueID = f; setTimeout(function() { waPlayer[b].currentSequenceObj = false; waPlayer[b].setVideo(f, 1) }, 300) } }; waPlayer[wa_i].getVideoSources = function(a, b) { var c = this.id; var d = 0; var f = new Array(); for (var g = 0; g < waPlayer[c].mountedVideo.sources.length; g++) { if (waPlayer[c].mountedVideo.sources[g].type == b) { if (waPlayer[c].playerData.mode == 'auto' && waPlayer[c].mountedVideo.sources[g].mode == a) { f[d] = waPlayer[c].mountedVideo.sources[g].url; d++ } else if (waPlayer[c].playerData.mode == 'html5') { f[d] = waPlayer[c].mountedVideo.sources[g].url; d++ } } } return f }; waPlayer[wa_i].getDefaultQualityBySources = function(a, b) { var c = this.id; var d = false; for (var f = 0; f < b.sources.length; f++) { if (b.sources[f].type == a) { return a } } for (var g = 0; g < waPlayer[c].availableQualities.length; g++) { for (var f = 0; f < b.sources.length; f++) { if (b.sources[f].type == waPlayer[c].availableQualities[g]) { return waPlayer[c].availableQualities[g] } } } return a }; waPlayer[wa_i].supportFlashFormats = function(a, b) { return false }; waPlayer[wa_i].support = function(a, b) { return 'html5'; }; waPlayer[wa_i].IsExtension = function(a, b) { var c = b.substr(b.length - 3); if (c == a) return true; return false }; waPlayer[wa_i].currentSequenceObj = false; var userAgent = navigator.userAgent.toLowerCase(); jQuery.browser = { version: (userAgent.match(/.+(?:rv|it|ra|ie|me)[\/: ]([\d.]+)/) || [])[1], chrome: /chrome/.test(userAgent), safari: /webkit/.test(userAgent) && !/chrome/.test(userAgent), opera: /opera/.test(userAgent), msie: /msie/.test(userAgent) && !/opera/.test(userAgent), mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent) }; var context_id; if (typeof videoObject != "undefined") waPlayer[wa_i].clonedVideoObject = jQuery.extend({}, videoObject); waPlayer[wa_i].playLocked = false; waPlayer[wa_i].currentURL; waPlayer[wa_i].errorDisplayed = false; waPlayer[wa_i].currentQuality; waPlayer[wa_i].xmlLoaded = false; waPlayer[wa_i].langXML; waPlayer[wa_i].loadStatus = 0; waPlayer[wa_i].playerData; waPlayer[wa_i].mountedVideo; waPlayer[wa_i].mountedVideoContent; waPlayer[wa_i].videosData = [] waPlayer[wa_i].advertMode = false; windowOverflow = document.body.style.overflow; waPlayer[wa_i].fullScreenMode = false; waPlayer[wa_i].wasFullScreenMode = false; waPlayer[wa_i].barDisplayed = true; waPlayer[wa_i].thumbDisplayed = false; waPlayer[wa_i].playing = false; waPlayer[wa_i].id = wa_i; waPlayer[wa_i].lastBarLeftElement = 13; waPlayer[wa_i].lastBarRightElement = 13; waPlayer[wa_i].elementsSpace = 8; waPlayer[wa_i].seekingBarMaxWidth; waPlayer[wa_i].barIndicatorMove = false; waPlayer[wa_i].soundBarIndicatorMove = false; waPlayer[wa_i].soundBarDisplayed = false; waPlayer[wa_i].mouseOver = false; waPlayer[wa_i].runVideoTag = true; waPlayer[wa_i].timeoutevent = true; waPlayer[wa_i].waiting = false; waPlayer[wa_i].volumeRollOver = false; waPlayer[wa_i].barSeekMove = false; waPlayer[wa_i].seekTo = 0; waPlayer[wa_i].seekBarStartX = 0; waPlayer[wa_i].soundBarIndicatorIMove = false; waPlayer[wa_i].tipOn = false; waPlayer[wa_i].timer; waPlayer[wa_i].videoPlayed = false; waPlayer[wa_i].currentVolume = 100; waPlayer[wa_i].fromJsObject = false; waPlayer[wa_i].canplayErrorTimer; waPlayer[wa_i].hubShareTimer; waPlayer[wa_i].hubShareTimerArrayNum = 0; waPlayer[wa_i].hubShareTimerArray = [] waPlayer[wa_i].hubShareObjects = [] waPlayer[wa_i].subtitlesStartSec = -1; waPlayer[wa_i].subtitlesClearSec = -1; waPlayer[wa_i].subtitlesStatus = 0; waPlayer[wa_i].subtitlesActShowId = -1; waPlayer[wa_i].subtitlesPrevSec = -1; waPlayer[wa_i].subtitlesTimer; waPlayer[wa_i].showSubtitles = false; waPlayer[wa_i].subtitles = [] waPlayer[wa_i].loaded = 0; waPlayer[wa_i].total = 0; waPlayer[wa_i].videoDuration; waPlayer[wa_i].waMouseX = 0; waPlayer[wa_i].waMouseY = 0; waPlayer[wa_i].currQueueID = -1; waPlayer[wa_i].videoQueueON = false; waPlayer[wa_i].videoQueue = false; waPlayer[wa_i].volumeTimer; waPlayer[wa_i].qualityTimer; waPlayer[wa_i].currentAge = 0; waPlayer[wa_i].interfaceLocked = false; var TimeToFade = 500; if (typeof videoQueue != 'undefined') { waPlayer[wa_i].videoQueue = videoQueue; videoQueue = undefined } if (typeof wa_wasPlaylist == "undefined") var wa_wasPlaylist = false; waPlayer[wa_i].runExternalPlaylist = false; if (typeof waPlaylist != "undefined" && waPlaylist && !wa_wasPlaylist) { waPlayer[wa_i].runIntegratedPlaylist = true; waPlaylist = undefined } else waPlayer[wa_i].runIntegratedPlaylist = false; if (typeof autoMode == "undefined") waPlayer[wa_i].autoMode = 1; else { waPlayer[wa_i].autoMode = autoMode; autoMode = undefined } if (typeof windowMode == "undefined") waPlayer[wa_i].windowMode = "window"; else { waPlayer[wa_i].windowMode = windowMode; windowMode = undefined } if (typeof bgColor == "undefined") waPlayer[wa_i].bgColor = "#000000"; else { waPlayer[wa_i].bgColor = bgColor; bgColor = undefined } waPlayer[wa_i].start = function() { var a = this.id; var b = waPlayer[a].width; var c = ''; document.write(c); if (waPlayer[a].runIntegratedPlaylist) b += 301; document.write('
'); var d = document.createElement('video'); if (!d.play) { waPlayer[a].runVideoTag = false; waPlayer[a].waControls = false } waPlayer[a].setDefaultConfig(); waPlayer[a].init(); var f = window.location.toString(); f = f.replace('https://', ''); f = f.replace('https://', ''); waPlayer[a].currentURL = f.replace('www.', ''); waPlayer[a].currentURL = escape(waPlayer[a].currentURL); var g = ''; if (typeof styleName != "undefined") g = '&styleName=' + styleName; styleName = undefined; waPlayer[a].loadXML('requests/darkonyx_datafeed.php?videoID=' + waPlayer[a].getID + ',&url=' + waPlayer[a].currentURL + g, waPlayer[a].parsePlayerData); waPlayer[a].advertInit(); if (typeof wap != "undefined" && typeof wap.setInitData != "undefined" && wap.playerID == a) wap.setInitData(); if (waPlayer[a].runIntegratedPlaylist) { var c = '
'; c += ''; waPlayer[a].write(c); waPlaylist = undefined } waPlayer[a].write('
'); waPlayer[a].loadStatus++; if (waPlayer[a].loadStatus == 2) waPlayer[a].setConfig() }; waPlayer[wa_i].setPlayerMode = function(a) { var b = this.id; document.getElementById('wa_mPlayer_' + b).style.visibility = 'visible'; document.getElementById('wa_mPlayer_' + b).style.display = 'block'; document.getElementById('wa_fPlayer_' + b).style.display = 'none'; waPlayer[b].currentSequenceObj = false }; waPlayer[wa_i].choosePlayerMode = function(a) { return 'html5' }; function waFilter(a) { a = a.replace(/&/g, "#"); a = a.replace(/=/g, "$"); a = a.replace(/£/g, "#"); a = a.replace(/¥/g, "#"); return a }; var waIsMobile = ''; function isMobile() { if (waIsMobile != '') { if (waIsMobile == 'yes') return true; else return false } var a = navigator.userAgent.toLowerCase(); var b = (a.indexOf('iphone') != -1); var c = (a.indexOf('ipad') != -1); var d = (a.indexOf('ipod') != -1); var f = (a.indexOf('android') != -1); var g = (a.indexOf('deviceWinMob') != -1); if (b || c || d || f || g) { waIsMobile = 'yes'; return true } waIsMobile = 'no'; return false }; waPlayer[wa_i].init = function(a) { var b = this.id; var c = ''; if (isMobile()) waPlayer[b].waControls = false; var d = ''; if (!waPlayer[b].waControls) c = 'controls'; var f = '
'; f += ''; waPlayer[b].addTip(); waPlayer[b].write(f); waPlayer[b].addLoader(); f = '
'); var g = document.getElementById('wa_mPlayer_' + b); for (i = 0; i < g.childNodes.length; i++) { g.childNodes[i].onmouseover = function() { waPlayer[b].PLAYERover() }; g.childNodes[i].onmouseout = function() { waPlayer[b].PLAYERout() }; g.childNodes[i].oncontextmenu = waPlayer[b].openContextMenu } document.onkeydown = escapePressed } else waPlayer[b].write('
'); waPlayer[b].runContextMenu(); waPlayer[b].addEventListeners() }; waPlayer[wa_i].setVariables = function() { var a = this.id; waPlayer[a].nativeWidth = waPlayer[a].width; waPlayer[a].nativeHeight = waPlayer[a].height; waPlayer[a].video = document.getElementById('wa_video_' + a); waPlayer[a].mainDiv = document.getElementById('wa_player_' + a); waPlayer[a].lastBarRightElement = waPlayer[a].width - waPlayer[a].lastBarRightElement; waPlayer[a].lastBarLeftElement = waPlayer[a].lastBarLeftElement; var b = document.getElementById('wa_player_' + a); waPlayer[a].preloadImages() }; waPlayer[wa_i].preloadImages = function() { var a = this.id; waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/bufferIcon.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/play.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/play2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/pause.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/pause2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/soundBG.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/soundIndicator.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/soundGradient.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/volumeBarOFF.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/volumeBarOFF2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/volumeBarON.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/volumeBarON2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/indicator.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/fullScreenOFF.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/fullScreenOFF2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/fullScreenON.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/fullScreenON2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/hd.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/hd2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/sd.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/sd2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/qualityswitch.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/left_arrow.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/timeCloud1.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/timeCloud2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/timeCloud3.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/timeCloud4.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/subtitles.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/subtitles2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/subtitlesoff.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/subtitlesoff2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/hub_i.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/hub_embed.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/hub_home.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/hub_link.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/hub_facebook.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/hub_twitter.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/hub_share.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/hub_mail.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/menu_return.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/menu_return2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/tip_top_arrow.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/tip_bot_arrow.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/tip_left.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/tip_right.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/tip_center.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/x.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/x2.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/reAdvert.png'); waPlayer[a].preloadImagesExe(waPlayer[a].mainFolder + '/players/images/reAdvert2.png') }; waPlayer[wa_i].preloadImagesExe = function(a) { var b = new Image(); b.src = a }; waPlayer[wa_i].imageMouseOver = function(a, b, c) { if (!b) var b = 2; if (!c) { if (a.style.backgroundImage.search(b + ".png") == -1) a.style.backgroundImage = a.style.backgroundImage.replace(".png", b + ".png") } else { if (a.src.search(b + ".png") == -1) a.src = a.src.replace(".png", b + ".png") } }; waPlayer[wa_i].imageMouseOut = function(a, b, c) { if (!b) var b = 2; if (!c) { if (a.style.backgroundImage.search(b + ".png") != -1) a.style.backgroundImage = a.style.backgroundImage.replace(b + ".png", ".png") } else { if (a.src.search(b + ".png") != -1) a.src = a.src.replace(b + ".png", ".png") } }; waPlayer[wa_i].mouseOverStyle = function(a) { var b = this.id; a.style.backgroundColor = 'rgba(' + waPlayer[b].playerData.interface.activeElements.rollOverColor + ',' + (waPlayer[b].playerData.interface.activeElements.rollOverAlpha / 100) + ')' }; waPlayer[wa_i].mouseOutStyle = function(a, b) { var c = this.id; if (!b) a.style.backgroundColor = 'rgba(' + waPlayer[c].playerData.interface.activeElements.rollOutColor + ',' + (waPlayer[c].playerData.interface.activeElements.rollOutAlpha / 100) + ')'; else a.style.backgroundColor = 'rgba(' + waPlayer[c].playerData.interface.staticElements.toolbarColor + ',' + (waPlayer[c].playerData.interface.staticElements.toolbarAlpha / 100) + ')' }; waPlayer[wa_i].hexToRGB = function(a, b) { a = '0x' + a; var c = (a & 0xff0000) >> 16; var d = (a & 0x00ff00) >> 8; var f = a & 0x0000ff; if (b) return { R: c, G: d, B: f }; else return c + ',' + d + ',' + f }; waPlayer[wa_i].setOpacity = function(a, b) { if (window.ActiveXObject) { a.style.filter = "alpha(opacity=" + b * 100 + ")" } else { a.style.opacity = b } }; waPlayer[wa_i].imageExists = function(a) { var b = this.id; if (typeof a != "undefined" && a != '') { var c = new Image(); c.src = a; c.onerror = function() { waPlayer[b].showError(waPlayer[b].getLang('messages', 'errors', 'imageIO', new Array('imageURL=>' + a))) } } }; waPlayer[wa_i].htmlspecialchars = function(a) { a = a.replace(/&/g, '&'); a = a.replace(//g, '>'); a = a.replace(/"/g, '"'); a = a.replace(/'/g, '''); return a }; function createCookie(a, b, c) { if (c) { var d = new Date(); d.setTime(d.getTime() + (c * 1000)); var f = "; expires=" + d.toGMTString() } else var f = ""; document.cookie = a + "=" + b + f + "; path=/" }; function readCookie(a) { var b = a + "="; var c = document.cookie.split(';'); for (var d = 0; d < c.length; d++) { var f = c[d]; while (f.charAt(0) == ' ') f = f.substring(1, f.length); if (f.indexOf(b) == 0) return f.substring(b.length, f.length) } return null }; if (!document.getElementById && document.all) { document.getElementById = function(a) { return document.all[a] } } waPlayer[wa_i].waGetTime = function() { var a = this.id; return waPlayer[a].video.currentTime }; waPlayer[wa_i].waGetDuration = function() { var a = this.id; if (isNaN(waPlayer[a].video.duration)) return 0; return waPlayer[a].video.duration }; waPlayer[wa_i].waGetVolume = function() { var a = this.id; return waPlayer[a].currentVolume }; waPlayer[wa_i].waGetPlayerWidth = function() { var a = this.id; return waPlayer[a].width }; waPlayer[wa_i].waGetPlayerHeight = function() { var a = this.id; return waPlayer[a].height }; waPlayer[wa_i].waGetVideoQuality = function() { var a = this.id; return waPlayer[a].currentQuality }; waPlayer[wa_i].waPlayVideoID = function(a, b, c) { var d = this.id; if (waPlayer[d].advertMode) return; if (c) var f = 1; else var f = 0; if (b) waPlayer[d].stopVideoQueue(); waPlayer[d].currentSequenceObj = false; waPlayer[d].setVideo(a, f) }; waPlayer[wa_i].waPlayVideoObject = function(a, b, c) { var d = this.id; if (waPlayer[d].advertMode) return; if (c) var f = 1; else var f = 0; if (b) waPlayer[d].stopVideoQueue(); if (typeof a.id == "undefined") { var g = new Date(); a.id = g.getTime() } for (var j = 0; j < a.sources.length; j++) { a.sources[j].mode = waPlayer[d].support(a.sources[j].url, a.sources[j].method) } waPlayer[d].addVideo(a); waPlayer[d].setVideo(a.id, f) }; waPlayer[wa_i].waPause = function() { var a = this.id; waPlayer[a].pause() }; waPlayer[wa_i].waResume = function() { var a = this.id; waPlayer[a].play() }; waPlayer[wa_i].waSeek = function(a) { var b = this.id; try { waPlayer[b].seekTo = a; waPlayer[b].video.currentTime = a; waPlayer[b].playbackSeekEvent(a); waPlayer[b].updateSeekingBarPlayed() } catch (e) {} }; waPlayer[wa_i].waSetVolume = function(a) { var b = this.id; waPlayer[b].setVolume(a); if (waPlayer[b].waControls) { waPlayer[b].soundBarIndicator.style.bottom = (39 * (a / 100)) + 'px'; waPlayer[b].soundBarGradient.style.height = (39 * (a / 100)) + 'px' } }; waPlayer[wa_i].waSetSize = function(a, b) { var c = this.id; waPlayer[c].width = a; waPlayer[c].height = b; waPlayer[c].nativeWidth = a; waPlayer[c].nativeHeight = b; document.getElementById('wa_mPlayer_' + c).style.width = waPlayer[c].width + 'px'; document.getElementById('wa_mPlayer_' + c).style.height = waPlayer[c].height + 'px'; document.getElementById('wa_fPlayer_' + c).style.width = waPlayer[c].width + 'px'; document.getElementById('wa_fPlayer_' + c).style.height = waPlayer[c].height + 'px'; document.getElementById('wa_mainDiv_' + c).style.width = waPlayer[c].width + 'px'; document.getElementById('wa_mainDiv_' + c).style.height = waPlayer[c].height + 'px'; divWidth = waPlayer[c].width; if (waPlayer[c].runIntegratedPlaylist) { divWidth += 301; playlistHeight = waPlayer[c].height; document.getElementById('wap').style.height = playlistHeight + 'px'; wap.setAreaSize(); wap.renderVideos() } document.getElementById('wa_fPlayer_frame_' + c).style.width = divWidth + 'px'; waPlayer[c].fullScreenMode = true; waPlayer[c].goFullScreen() }; waPlayer[wa_i].waAddVideoToQueue = function(a) { var b = this.id; var c = waPlayer[b].videoQueue.length; waPlayer[b].videoQueue[c] = a; if (!waPlayer[b].videoQueueON) { waPlayer[b].videoQueue = new Array(); waPlayer[b].videoQueue[0] = waPlayer[b].mountedVideo.id; waPlayer[b].videoQueue[1] = a; waPlayer[b].assignVideoQueue() } }; waPlayer[wa_i].runContextMenu = function() { var a = this.id; if ($.browser.msie && parseInt($.browser.version) == 8) return; if (!document.getElementById('wa_context')) waPlayer[a].write(''); var b = document.getElementById('wa_context'); document.body.appendChild(b); document.body.onclick = function() { document.getElementById('wa_context').style.display = 'none' } }; waPlayer[wa_i].openContextMenu = function(a) { var b = this.id; var c; var d; if (document.layers) { c = a.pageX; d = a.pageY } else if (document.all) { c = window.event.x + document.body.scrollLeft; d = window.event.y + document.body.scrollTop } else if (document.getElementById) { c = a.pageX; d = a.pageY } document.getElementById('wa_context').style.display = 'block'; document.getElementById('wa_context').style.left = c + 'px'; document.getElementById('wa_context').style.top = d + 'px'; return false }; waPlayer[wa_i].addLoader = function() { var a = this.id; var b = waPlayer[a].width; if (waPlayer[a].runIntegratedPlaylist) b += 301; var c = '
'; c += '
'; c += '
'; waPlayer[a].write(c); waPlayer[a].loader = document.getElementById('wa_loader_' + a); waPlayer[a].loaderCenter = document.getElementById('wa_loader_cent_' + a); var d = 104; var f = 103; waPlayer[a].loaderCenter.style.width = d + 'px'; waPlayer[a].loaderCenter.style.height = f + 'px'; var g = Math.round((b / 2) - (d / 2)); var j = Math.round((waPlayer[a].height / 2) - (f / 2)); waPlayer[a].loaderCenter.style.marginLeft = g + 'px'; waPlayer[a].loaderCenter.style.marginTop = j + 'px'; $('#wa_loader_cent_' + a).animate({ opacity: 1 }, 1000) }; waPlayer[wa_i].hideLoader = function() { var a = this.id; waPlayer[a].loader.style.display = 'none'; waPlayer[a].playerLoadedEvent() }; waPlayer[wa_i].addError = function() { var a = this.id; var b = ''; waPlayer[a].write(b); waPlayer[a].error = document.getElementById('wa_error_' + a); waPlayer[a].errorContent = document.getElementById('wa_error_content_' + a); waPlayer[a].reAddError(false) }; waPlayer[wa_i].reAddErrorContent = function(a) { var b = this.id; if (waPlayer[b].width >= 320) var c = 345; else var c = 220; waPlayer[b].errorContent.style.width = c + 'px'; var d = waPlayer[b].errorContent.clientHeight; var f = (waPlayer[b].width / 2) - (c / 2) - 10; var g = (waPlayer[b].height / 2) - (d / 2); waPlayer[b].errorContent.style.marginTop = Math.round(g) - 10 + 'px'; waPlayer[b].errorContent.style.marginLeft = Math.round(f) + 'px'; if (!a) { waPlayer[b].errorContent.style.zIndex = 51 } else { waPlayer[b].errorContent.style.zIndex = 900051 } }; waPlayer[wa_i].reAddError = function(a) { var b = this.id; waPlayer[b].error.style.marginLeft = '0px'; if (!a) { waPlayer[b].error.style.width = waPlayer[b].width + 'px'; waPlayer[b].error.style.height = waPlayer[b].height + 'px'; var c = '-' + waPlayer[b].error.style.height; waPlayer[b].error.style.marginTop = c; waPlayer[b].error.style.left = 'auto'; waPlayer[b].error.style.top = 'auto' } else { waPlayer[b].error.style.marginTop = '0px'; waPlayer[b].error.style.left = '0px'; waPlayer[b].error.style.top = '0px'; waPlayer[b].error.style.width = '100%'; waPlayer[b].error.style.height = '100%' } if (!a) waPlayer[b].error.style.zIndex = 50; else waPlayer[b].error.style.zIndex = 900050; waPlayer[b].reAddErrorContent(a) }; waPlayer[wa_i].addLogo = function() { var a = this.id; waPlayer[a].write('
'); waPlayer[a].logo = document.getElementById('wa_logo_' + a); waPlayer[a].readdLogo(false) }; waPlayer[wa_i].setLogo = function() { var a = this.id; var b = waPlayer[a].playerData.interface.watermark; waPlayer[a].logo.innerHTML = ''; waPlayer[a].imageExists(waPlayer[a].playerData.interface.watermark) }; waPlayer[wa_i].readdLogo = function(a) { var b = this.id; if (waPlayer[b].logo) { waPlayer[b].logo.style.left = '5px'; if (waPlayer[b].playerData.interface.autoHide == 1) { if (waPlayer[b].barDisplayed || !waPlayer[b].playing) waPlayer[b].logo.style.bottom = '33px'; else waPlayer[b].logo.style.bottom = '5px' } else waPlayer[b].logo.style.bottom = '33px'; waPlayer[b].logo.style.zIndex = 20 } }; waPlayer[wa_i].addVideoName = function() { var a = this.id; waPlayer[a].write('
'); waPlayer[a].videoNameObject = document.getElementById('wa_player_vn_' + a); waPlayer[a].reVideoName(false) }; waPlayer[wa_i].resetVideoName = function() { var a = this.id; if ((typeof waPlayer[a].mountedVideo.title == 'undefined' && typeof waPlayer[a].mountedVideo.description == 'undefined') || (waPlayer[a].mountedVideo.title == '' && waPlayer[a].mountedVideo.description == '')) { waPlayer[a].videoNameObject.style.display = 'none'; waPlayer[a].readdHub(waPlayer[a].fullScreenMode) } else if (waPlayer[a].playerData.interface.showTitle == 1) { if (typeof waPlayer[a].mountedVideo.title != 'undefined' && waPlayer[a].mountedVideo.title != '') waPlayer[a].videoNameObject.innerHTML = '
' + waPlayer[a].mountedVideo.title + '
'; if (typeof waPlayer[a].mountedVideo.description != 'undefined' && waPlayer[a].mountedVideo.description != '') waPlayer[a].videoNameObject.innerHTML += '
' + waPlayer[a].mountedVideo.description + '
'; waPlayer[a].videoNameObject.style.display = 'block'; waPlayer[a].readdHub(waPlayer[a].fullScreenMode) } }; waPlayer[wa_i].reVideoName = function(a) { var b = this.id; if (waPlayer[b].videoNameObject) { waPlayer[b].videoNameObject.style.width = (waPlayer[b].width - 18) + 'px'; if (!a) { var c = -waPlayer[b].height; waPlayer[b].videoNameObject.style.marginLeft = '0px'; waPlayer[b].videoNameObject.style.marginTop = c + 'px'; waPlayer[b].videoNameObject.style.left = 'auto'; waPlayer[b].videoNameObject.style.top = 'auto'; waPlayer[b].videoNameObject.style.zIndex = 27 } else { waPlayer[b].videoNameObject.style.marginLeft = '0px'; waPlayer[b].videoNameObject.style.marginTop = '0px'; waPlayer[b].videoNameObject.style.left = '0px'; waPlayer[b].videoNameObject.style.top = '0px'; waPlayer[b].videoNameObject.style.zIndex = 900027 } } }; waPlayer[wa_i].addBuffer = function() { var a = this.id; waPlayer[a].write(''); waPlayer[a].buffer = document.getElementById('wa_player_buffer_' + a); waPlayer[a].readdBuffer() }; waPlayer[wa_i].readdBuffer = function(a) { var b = this.id; var c = 74; var d = 74; var f = (waPlayer[b].width / 2) - (c / 2); waPlayer[b].buffer.style.width = c + 'px'; waPlayer[b].buffer.style.height = d + 'px'; if (!a) { var g = -(waPlayer[b].height / 2) - (d / 2); waPlayer[b].buffer.style.marginTop = Math.round(g) - 10 + 'px'; waPlayer[b].buffer.style.marginLeft = Math.round(f) + 'px'; waPlayer[b].buffer.style.top = 'auto'; waPlayer[b].buffer.style.left = 'auto' } else { var g = (waPlayer[b].height / 2) - (d / 2); waPlayer[b].buffer.style.marginTop = '0px'; waPlayer[b].buffer.style.marginLeft = '0px'; waPlayer[b].buffer.style.top = Math.round(g) - 10 + 'px'; waPlayer[b].buffer.style.left = Math.round(f) + 'px' } if (!a) waPlayer[b].buffer.style.zIndex = 24; else waPlayer[b].buffer.style.zIndex = 900024 }; waPlayer[wa_i].addBigPlayButton = function() { var a = this.id; waPlayer[a].write('
'); waPlayer[a].playBig = document.getElementById('wa_player_play_' + a); waPlayer[a].rePlayBig() }; waPlayer[wa_i].rePlayBig = function(a) { var b = this.id; if (waPlayer[b].width > 400 && waPlayer[b].height > 250) { var c = 110; var d = 110; waPlayer[b].playBig.style.background = 'url(' + waPlayer[b].mainFolder + '/players/images/playMain.png)' } else { var c = 85; var d = 85; waPlayer[b].playBig.style.background = 'url(' + waPlayer[b].mainFolder + '/players/images/playMain_small.png)' } waPlayer[b].mouseOutStyle(waPlayer[b].playBig, true); waPlayer[b].playBig.style.width = c + 'px'; waPlayer[b].playBig.style.height = d + 'px'; var f = (waPlayer[b].width / 2) - (c / 2); if (!a) { var g = -(waPlayer[b].height / 2) - (d / 2); waPlayer[b].playBig.style.marginTop = Math.round(g) - 10 + 'px'; waPlayer[b].playBig.style.marginLeft = Math.round(f) + 'px'; waPlayer[b].playBig.style.top = 'auto'; waPlayer[b].playBig.style.left = 'auto' } else { var g = (waPlayer[b].height / 2) - (d / 2); waPlayer[b].playBig.style.marginTop = '0px'; waPlayer[b].playBig.style.marginLeft = '0px'; waPlayer[b].playBig.style.top = Math.round(g) - 10 + 'px'; waPlayer[b].playBig.style.left = Math.round(f) + 'px' } if (!a) waPlayer[b].playBig.style.zIndex = 25; else waPlayer[b].playBig.style.zIndex = 900025; if (waPlayer[b].playerData.interface.bigPlay == 1 && !waPlayer[b].playing) waPlayer[b].showBigPlay(); else waPlayer[b].hideBigPlay() }; waPlayer[wa_i].addBigThumb = function() { var a = this.id; var b = ''; if (waPlayer[a].mountedVideo) b = waPlayer[a].mountedVideo.poster; waPlayer[a].write('
'); waPlayer[a].bigThumb = document.getElementById('wa_bigThumb_' + a); waPlayer[a].bigThumbImg = document.getElementById('wa_bigThumb_img_' + a); waPlayer[a].thumbDisplayed = true; waPlayer[a].reBigThumb(false) }; waPlayer[wa_i].reBigThumb = function(a) { var b = this.id; if (waPlayer[b].bigThumb) { waPlayer[b].bigThumb.style.marginLeft = '0px'; if (!a) { waPlayer[b].bigThumb.style.width = waPlayer[b].width + 'px'; waPlayer[b].bigThumb.style.height = waPlayer[b].height + 'px'; var c = '-' + waPlayer[b].bigThumb.style.height; waPlayer[b].bigThumb.style.marginTop = c; waPlayer[b].bigThumb.style.left = 'auto'; waPlayer[b].bigThumb.style.top = 'auto' } else { waPlayer[b].bigThumb.style.marginTop = '0px'; waPlayer[b].bigThumb.style.left = '0px'; waPlayer[b].bigThumb.style.top = '0px'; waPlayer[b].bigThumb.style.width = '100%'; waPlayer[b].bigThumb.style.height = '100%' } waPlayer[b].bigThumbImg.width = waPlayer[b].width; waPlayer[b].bigThumbImg.height = waPlayer[b].height; if (!a) waPlayer[b].bigThumb.style.zIndex = 20; else waPlayer[b].bigThumb.style.zIndex = 900020 } }; waPlayer[wa_i].addTipMsgLength = 0; waPlayer[wa_i].addTip = function() { var a = this.id; var b = ''; waPlayer[a].write(b); waPlayer[a].tip = document.getElementById('wa_tip_' + a); waPlayer[a].tipContent = document.getElementById('wa_tip_content_' + a); waPlayer[a].tipTop = document.getElementById('wa_tip_up_' + a); waPlayer[a].tipBot = document.getElementById('wa_tip_down_' + a) }; waPlayer[wa_i].showTip = function(a, b, c, d) { var f = this.id; if (waPlayer[f].playerData.interface.tipCloud == 1 && waPlayer[f].waControls) { var g = waPlayer[f].getLang(a, b, c, d); waPlayer[f].tipContent.innerHTML = ''; waPlayer[f].addTipMsgLength = g.length; waPlayer[f].tipOn = true; waPlayer[f].timer = setTimeout("waPlayer[" + f + "].showTipStart('" + g + "')", 1000) } }; waPlayer[wa_i].showTipStart = function(a) { var b = this.id; waPlayer[b].tip.style.display = 'block'; waPlayer[b].tipContent.innerHTML = a; waPlayer[b].reAddTip() }; waPlayer[wa_i].hideTip = function() { var a = this.id; clearTimeout(waPlayer[a].timer); waPlayer[a].tip.style.display = 'none'; waPlayer[a].tipOn = false }; waPlayer[wa_i].reAddTip = function() { var a = this.id; var b = waPlayer[a].width / 2; var c = waPlayer[a].height / 2; var d = waPlayer[a].waMouseX - waPlayer[a].getOffsetX(document.getElementById("wa_player_" + a)); var f = waPlayer[a].waMouseY - waPlayer[a].getOffsetY(document.getElementById("wa_player_" + a)); waPlayer[a].tipTop.style.display = 'none'; waPlayer[a].tipBot.style.display = 'none'; var g; if (waPlayer[a].fullScreenMode) { g = waPlayer[a].addTipMsgLength * 6.5; waPlayer[a].tipContent.style.width = g + 'px' } else { g = waPlayer[a].tipContent.offsetWidth; waPlayer[a].tipContent.style.width = 'auto' } var j = 0; var h = 0; if (navigator.appName == "Microsoft Internet Explorer") { j = window.pageYOffset; h = window.pageXOffset } if (d < b && f < c) { waPlayer[a].tip.style.top = (waPlayer[a].waMouseY + j + 12) + 'px'; waPlayer[a].tip.style.left = (waPlayer[a].waMouseX + h - 8) + 'px'; waPlayer[a].tipTop.style.display = 'block'; waPlayer[a].tipTop.style.marginLeft = '7px' } else if (d > b && f < c) { waPlayer[a].tip.style.top = (waPlayer[a].waMouseY + 12) + 'px'; waPlayer[a].tip.style.left = (waPlayer[a].waMouseX - g + 13) + 'px'; waPlayer[a].tipTop.style.display = 'block'; waPlayer[a].tipTop.style.marginLeft = (g - 20) + 'px' } else if (d < b && f > c) { waPlayer[a].tip.style.top = (waPlayer[a].waMouseY - 48) + 'px'; waPlayer[a].tip.style.left = (waPlayer[a].waMouseX - 11) + 'px'; waPlayer[a].tipBot.style.display = 'block'; waPlayer[a].tipBot.style.marginLeft = '7px' } else if (d > b && f > c) { if (waPlayer[a].fullScreenMode) var k = 5; else var k = -5; waPlayer[a].tip.style.top = (waPlayer[a].waMouseY - 48) + 'px'; waPlayer[a].tip.style.left = (waPlayer[a].waMouseX - g - 5 - k) + 'px'; waPlayer[a].tipBot.style.display = 'block'; waPlayer[a].tipBot.style.marginLeft = (g + k) + 'px' } }; waPlayer[wa_i].addAgeVerificator = function() { var a = this.id; var b = ''; waPlayer[a].write(b); waPlayer[a].ageVerivicator = document.getElementById('wa_agev_' + a); waPlayer[a].ageVerivicatorTitle = document.getElementById('wa_agev_title_' + a); waPlayer[a].ageVerivicatorInputs = document.getElementById('wa_agev_inputs_' + a); waPlayer[a].ageVerivicatorPlay = document.getElementById('wa_agev_play_' + a); waPlayer[a].reAddAgeVerificator(false) }; waPlayer[wa_i].reAddAgeVerificator = function(a) { var b = this.id; if (waPlayer[b].width >= 320) { var c = 320; var d = 55; document.getElementById('wa_agev_inputs_a_' + b).style.margin = '0' } else { var c = 230; var d = 82; document.getElementById('wa_agev_inputs_a_' + b).style.margin = '5px 0 0 65px' } var f = (waPlayer[b].width / 2) - (c / 2) - 5; waPlayer[b].ageVerivicator.style.width = c + 'px'; waPlayer[b].ageVerivicator.style.height = d + 'px'; if (!a) { var g = -(waPlayer[b].height / 2) - (d / 2); waPlayer[b].ageVerivicator.style.marginTop = Math.round(g) - 10 + 'px'; waPlayer[b].ageVerivicator.style.marginLeft = Math.round(f) + 'px'; waPlayer[b].ageVerivicator.style.top = 'auto'; waPlayer[b].ageVerivicator.style.left = 'auto' } else { var g = (waPlayer[b].height / 2) - (d / 2); waPlayer[b].ageVerivicator.style.marginTop = '0px'; waPlayer[b].ageVerivicator.style.marginLeft = '0px'; waPlayer[b].ageVerivicator.style.top = Math.round(g) - 10 + 'px'; waPlayer[b].ageVerivicator.style.left = Math.round(f) + 'px' } if (!a) waPlayer[b].ageVerivicator.style.zIndex = 32; else waPlayer[b].ageVerivicator.style.zIndex = 900032 }; waPlayer[wa_i].showErrorPriority = 0; waPlayer[wa_i].showError = function(a, b) { var c = this.id; if (!b) b = 0; if (b >= waPlayer[c].showErrorPriority) { waPlayer[c].setPlayerMode('html5'); waPlayer[c].showErrorPriority = b; waPlayer[c].error.style.display = 'block'; waPlayer[c].errorContent.innerHTML = a; waPlayer[c].reAddErrorContent(waPlayer[c].fullScreenMode); waPlayer[c].errorDisplayed = true } }; waPlayer[wa_i].hideError = function(a) { var b = this.id; if (!a) a = 0; if (a >= waPlayer[b].showErrorPriority) { waPlayer[b].error.style.display = 'none'; waPlayer[b].errorDisplayed = false; waPlayer[b].showErrorPriority = 0 } }; waPlayer[wa_i].showMainBar = function() { var a = this.id; waPlayer[a].mainBar.style.display = 'block'; waPlayer[a].barDisplayed = true; waPlayer[a].readdAdvertOverlayTxt(waPlayer[a].fullScreenMode); waPlayer[a].readdAdvertOverlayBanner(waPlayer[a].fullScreenMode); waPlayer[a].readdLogo(waPlayer[a].fullScreenMode); waPlayer[a].reMainBarSubtitlesBar(waPlayer[a].fullScreenMode, true) }; waPlayer[wa_i].hideMainBar = function() { var a = this.id; waPlayer[a].mainBar.style.display = 'none'; waPlayer[a].qualityBar.style.display = 'none'; waPlayer[a].barDisplayed = false; waPlayer[a].readdAdvertOverlayTxt(waPlayer[a].fullScreenMode); waPlayer[a].readdAdvertOverlayBanner(waPlayer[a].fullScreenMode); waPlayer[a].readdLogo(waPlayer[a].fullScreenMode); waPlayer[a].reMainBarSubtitlesBar(waPlayer[a].fullScreenMode, true) }; waPlayer[wa_i].lockInterface = function() { var a = this.id; waPlayer[a].interfaceLocked = true; waPlayer[a].setOpacity(waPlayer[a].hub, 0.5); waPlayer[a].lockPlay(); var b = waPlayer[a].mainBar; for (var c = 0; c < b.childNodes.length; c++) { if (b.childNodes[c].id != 'wa_bar_allSeek_' + a) waPlayer[a].setOpacity(b.childNodes[c], 0.5) } }; waPlayer[wa_i].unlockInterface = function() { var a = this.id; if (waPlayer[a].interfaceLocked) { waPlayer[a].interfaceLocked = false; waPlayer[a].setOpacity(waPlayer[a].hub, 1); waPlayer[a].unlockPlay(); var b = waPlayer[a].mainBar; for (var c = 0; c < b.childNodes.length; c++) { if (b.childNodes[c].id != 'wa_bar_allSeek_' + a) waPlayer[a].setOpacity(b.childNodes[c], 1) } } }; waPlayer[wa_i].play = function() { var b = this.id; if (waPlayer[b].errorDisplayed) return new Promise() waPlayer[b].video.load() return waPlayer[b].video.play() .then(_ => { if (!waPlayer[b].advertMode) { if (!waPlayer[b].videoPlayed) waPlayer[b].videoStartEvent(waPlayer[b].mountedVideo.id); else waPlayer[b].playbackStatusEvent(waPlayer[b].video.currentTime, 'resume') } waPlayer[b].prevTime = -1; waPlayer[b].seekTo = 0; if (waPlayer[b].waControls) { if (waPlayer[b].playerData.interface.showTitle == 1 && waPlayer[b].videoNameObject) waPlayer[b].videoNameObject.style.display = 'none'; if (waPlayer[b].thumbDisplayed) waPlayer[b].bigThumb.style.display = 'none'; waPlayer[b].playBig.style.display = 'none'; waPlayer[b].changePlayButton(); waPlayer[b].readdHub(waPlayer[b].fullScreenMode) } waPlayer[b].playing = true; waPlayer[b].videoPlayed = true; if (Math.round(waPlayer[b].video.currentTime) == Math.round(waPlayer[b].videoDuration)) waPlayer[b].video.currentTime = 0 }) }; waPlayer[wa_i].changePlayButton = function(a) { var b = this.id; if (!a) if (waPlayer[b].mainBarPlay.style.backgroundImage.search("2.png") == -1) waPlayer[b].mainBarPlay.style.background = 'url(' + waPlayer[b].mainFolder + '/players/images/pause.png)'; else waPlayer[b].mainBarPlay.style.background = 'url(' + waPlayer[b].mainFolder + '/players/images/pause2.png)'; else if (waPlayer[b].mainBarPlay.style.backgroundImage.search("2.png") == -1) waPlayer[b].mainBarPlay.style.background = 'url(' + waPlayer[b].mainFolder + '/players/images/play.png)'; else waPlayer[b].mainBarPlay.style.background = 'url(' + waPlayer[b].mainFolder + '/players/images/play2.png)' }; waPlayer[wa_i].lockPlay = function() { var a = this.id; waPlayer[a].playLocked = true; waPlayer[a].setOpacity(waPlayer[a].mainBarPlay, 0.5) }; waPlayer[wa_i].unlockPlay = function() { var a = this.id; waPlayer[a].playLocked = false; waPlayer[a].setOpacity(waPlayer[a].mainBarPlay, 1) }; waPlayer[wa_i].pause = function(a) { var b = this.id; waPlayer[b].play().then( _ => { if (!a) waPlayer[b].playbackStatusEvent(waPlayer[b].video.currentTime, 'pause'); if (waPlayer[b].waControls) { if (!waPlayer[b].advertMode && waPlayer[b].playerData.interface.showTitle == 1 && waPlayer[b].videoNameObject && waPlayer[b].videoNameObject.innerHTML != '') waPlayer[b].videoNameObject.style.display = 'block'; if (waPlayer[b].playerData.interface.bigPlay == 1) waPlayer[b].showBigPlay(); waPlayer[b].readdHub(waPlayer[b].fullScreenMode); waPlayer[b].changePlayButton(true) } waPlayer[b].playing = false; waPlayer[b].video.pause() } ) }; waPlayer[wa_i].setQualityMode = function(a) { var b = this.id; waPlayer[b].currentQuality = a; waPlayer[b].qualityChangeEvent(a); if (waPlayer[b].waControls) { switch (a) { case 'sd': document.getElementById('wa_qbar_imgsd_' + b).style.display = "block"; document.getElementById('wa_qbar_imghd_' + b).style.display = "none"; waPlayer[b].mainBarHDimg.src = waPlayer[b].mainFolder + '/players/images/sd.png'; break; case 'hd': document.getElementById('wa_qbar_imgsd_' + b).style.display = "none"; document.getElementById('wa_qbar_imghd_' + b).style.display = "block"; waPlayer[b].mainBarHDimg.src = waPlayer[b].mainFolder + '/players/images/hd.png'; break; default: break } } }; waPlayer[wa_i].showQualityBar = function() { var a = this.id; if (!waPlayer[a].interfaceLocked) waPlayer[a].qualityBar.style.display = 'block' }; waPlayer[wa_i].hideQualityBar = function() { var a = this.id; waPlayer[a].qualityBar.style.display = 'none' }; waPlayer[wa_i].analyseQualityOptions = function() { var a = this.id; if (waPlayer[a].videoHD1 == '' || waPlayer[a].videoHD1 == 'https://') waPlayer[a].qualitySwitchStatus(false); else waPlayer[a].qualitySwitchStatus(true) }; waPlayer[wa_i].qualitySwitchStatus = function(a) { var b = this.id; waPlayer[b].playerData.interface.qualitySwitch = a; waPlayer[b].fullScreenMode = !waPlayer[b].fullScreenMode; waPlayer[b].goFullScreen() }; waPlayer[wa_i].qualityHideSequence = function(a) { var b = this.id; if (a) waPlayer[b].qualityTimer = setTimeout("waPlayer[" + b + "].hideQualityBar();", 1000); else clearTimeout(waPlayer[b].qualityTimer) }; waPlayer[wa_i].updateSeekingBarPlayed = function(a) { var b = this.id; if (!waPlayer[b].barSeekMove && (a || (waPlayer[b].seekTo <= waPlayer[b].video.currentTime && !waPlayer[b].waiting))) { var c = waPlayer[b].video.currentTime; var d = Math.round((c * waPlayer[b].seekingBarMaxWidth) / waPlayer[b].videoDuration); waPlayer[b].mainBarPlayed.style.width = d + 'px' } }; waPlayer[wa_i].updateSeekingBarBuffered = function(a) { var b = this.id; if (waPlayer[b].mainBarBuffered && a) waPlayer[b].mainBarBuffered.style.width = Math.round(a * waPlayer[b].seekingBarMaxWidth) + 'px' }; waPlayer[wa_i].goFullScreen = function(a) { var b = this.id; waPlayer[b].lastBarLeftElement = 13; waPlayer[b].lastBarRightElement = 13; var c = waPlayer[b].video.currentTime; if (!waPlayer[b].fullScreenMode) { waPlayer[b].viewModeChangeEvent('fullscreen'); if (a) self.scrollTo(0, 0); var d = document.getElementById('wa_mPlayer_' + b); document.body.appendChild(d); document.body.style.overflow = 'hidden'; waPlayer[b].width = window.innerWidth; waPlayer[b].lastBarRightElement = waPlayer[b].width - waPlayer[b].lastBarRightElement; waPlayer[b].height = window.innerHeight; waPlayer[b].mainDiv.style.position = 'absolute'; waPlayer[b].mainDiv.style.left = 0; waPlayer[b].mainDiv.style.top = 0; waPlayer[b].mainDiv.style.zIndex = 900000; waPlayer[b].mainDiv.style.width = waPlayer[b].width + 'px'; waPlayer[b].mainDiv.style.height = window.innerHeight + 'px'; waPlayer[b].video.style.position = 'absolute'; waPlayer[b].video.style.left = 0; waPlayer[b].video.style.top = 0; waPlayer[b].video.style.zIndex = 900001; waPlayer[b].video.style.width = waPlayer[b].width + 'px'; waPlayer[b].video.style.height = window.innerHeight + 'px'; if (waPlayer[b].waControls) { waPlayer[b].mainBarFullScreen.style.background = 'url(' + waPlayer[b].mainFolder + '/players/images/fullScreenOFF.png)'; waPlayer[b].reAddError(true); waPlayer[b].reAddAdvertInfo(true); if (waPlayer[b].buffer) waPlayer[b].readdBuffer(true); waPlayer[b].readdAdvertOverlayTxt(true); waPlayer[b].readdAdvertOverlayBanner(true); waPlayer[b].readdLogo(true); waPlayer[b].readdAdvertOverlayImg(true); waPlayer[b].reVideoName(true); waPlayer[b].readdHub(true); waPlayer[b].rePlayBig(true); waPlayer[b].reBigThumb(true); waPlayer[b].reAddMenu(true); waPlayer[b].reMainBar(true); waPlayer[b].reAddTimeCloud(true); waPlayer[b].reMainBarSubtitlesBar(true); waPlayer[b].reAddAgeVerificator(true); waPlayer[b].reMainBarPlay(true); waPlayer[b].reMainBarHD(true); waPlayer[b].reMainBarVB(true); waPlayer[b].reMainBarFC(true); waPlayer[b].reMainBarSubtitles(true); waPlayer[b].readdMainBarTotalTime(true); waPlayer[b].readdMainBarCurrentTime(true); waPlayer[b].readdMainBarSeek(true) } waPlayer[b].fullScreenMode = true; waPlayer[b].wasFullScreenMode = true } else { waPlayer[b].viewModeChangeEvent('normal'); if (a) document.getElementById('wa_mainDiv_' + b).scrollIntoView(true); var d = document.getElementById('wa_mPlayer_' + b); document.getElementById('wa_mainDiv_' + b).appendChild(d); document.body.style.overflow = windowOverflow; waPlayer[b].width = waPlayer[b].nativeWidth; waPlayer[b].height = waPlayer[b].nativeHeight; waPlayer[b].lastBarRightElement = waPlayer[b].width - waPlayer[b].lastBarRightElement; waPlayer[b].mainDiv.style.position = 'static'; waPlayer[b].mainDiv.style.zIndex = 9; waPlayer[b].mainDiv.style.left = 'auto'; waPlayer[b].mainDiv.style.top = 'auto'; waPlayer[b].mainDiv.style.width = waPlayer[b].width + 'px'; waPlayer[b].mainDiv.style.height = waPlayer[b].height + 'px'; waPlayer[b].video.style.position = 'static'; waPlayer[b].video.style.zIndex = 10; waPlayer[b].video.style.left = 'auto'; waPlayer[b].video.style.top = 'auto'; waPlayer[b].video.style.width = waPlayer[b].width + 'px'; waPlayer[b].video.style.height = waPlayer[b].height + 'px'; if (waPlayer[b].waControls) { waPlayer[b].mainBarFullScreen.style.background = 'url(' + waPlayer[b].mainFolder + '/players/images/fullScreenON.png)'; waPlayer[b].reAddError(false); waPlayer[b].reAddAdvertInfo(false); if (waPlayer[b].buffer) waPlayer[b].readdBuffer(false); waPlayer[b].readdAdvertOverlayTxt(false); waPlayer[b].readdAdvertOverlayBanner(false); waPlayer[b].readdLogo(false); waPlayer[b].reVideoName(false); waPlayer[b].readdHub(false); waPlayer[b].rePlayBig(false); waPlayer[b].reBigThumb(false); waPlayer[b].reAddMenu(false); waPlayer[b].reMainBar(false); waPlayer[b].readdAdvertOverlayImg(false); waPlayer[b].reAddTimeCloud(false); waPlayer[b].reMainBarSubtitlesBar(false); waPlayer[b].reAddAgeVerificator(false); waPlayer[b].reMainBarPlay(false); waPlayer[b].reMainBarHD(false); waPlayer[b].reMainBarVB(false); waPlayer[b].reMainBarFC(false); waPlayer[b].reMainBarSubtitles(false); waPlayer[b].readdMainBarTotalTime(false); waPlayer[b].readdMainBarCurrentTime(false); waPlayer[b].readdMainBarSeek(false) } waPlayer[b].fullScreenMode = false; waPlayer[b].checkSize() } if (waPlayer[b].playing) { if ($.browser.chrome || $.browser.safari) { try { waPlayer[b].video.load(); setTimeout(function() { waPlayer[b].video.currentTime = c; waPlayer[b].video.play() }, 300) } catch (e) {} } else { waPlayer[b].video.play() } } else { if ($.browser.chrome || $.browser.safari) { try { waPlayer[b].video.load(); setTimeout(function() { waPlayer[b].video.currentTime = c; waPlayer[b].updateSeekingBarPlayed() }, 300) } catch (e) {} } } if (waPlayer[b].waControls) { waPlayer[b].hideTip(); waPlayer[b].updateSeekingBarPlayed(true); waPlayer[b].updateSeekingBarPlayed(); waPlayer[b].updateSeekingBarBuffered(waPlayer[b].loaded, waPlayer[b].total) } }; waPlayer[wa_i].setVolume = function(a) { var b = this.id; waPlayer[b].currentVolume = a; waPlayer[b].volumeChangeEvent(a); if (a < 5) { if (waPlayer[b].waControls) waPlayer[b].mainBarVolumeBar.style.background = 'url(' + waPlayer[b].mainFolder + '/players/images/volumeBarOFF.png)'; waPlayer[b].video.volume = 0 } else { if (waPlayer[b].waControls) waPlayer[b].mainBarVolumeBar.style.background = 'url(' + waPlayer[b].mainFolder + '/players/images/volumeBarON.png)'; waPlayer[b].video.volume = Math.round(((a / 100) * 100)) / 100 } createCookie('wa_volume', a, 2419200) }; waPlayer[wa_i].volumeMute = function() { var a = this.id; waPlayer[a].setVolume(0); waPlayer[a].soundBarIndicator.style.bottom = '0px'; waPlayer[a].soundBarGradient.style.height = '0px'; waPlayer[a].mainBarVolumeBar.style.background = 'url(' + waPlayer[a].mainFolder + '/players/images/volumeBarOFF2.png)' }; waPlayer[wa_i].volumeMax = function() { var a = this.id; waPlayer[a].setVolume(100); waPlayer[a].soundBarIndicator.style.bottom = '39px'; waPlayer[a].soundBarGradient.style.height = '39px'; waPlayer[a].mainBarVolumeBar.style.background = 'url(' + waPlayer[a].mainFolder + '/players/images/volumeBarON2.png)' }; waPlayer[wa_i].showVolumeBar = function() { var a = this.id; waPlayer[wa_i].soundBarDisplayed = true; waPlayer[a].soundBar.style.display = 'block' }; waPlayer[wa_i].hideVolumeBar = function() { var a = this.id; waPlayer[a].soundBar.style.display = 'none'; waPlayer[a].soundBarDisplayed = false }; waPlayer[wa_i].volumeHideSequence = function(a) { var b = this.id; if (a) waPlayer[b].volumeTimer = setTimeout("waPlayer[" + b + "].hideVolumeBar();", 1000); else clearTimeout(waPlayer[b].volumeTimer) }; waPlayer[wa_i].timeCloudGetTime = function(a) { var b = this.id; if (waPlayer[b].video.duration) { var c = Math.round((a * waPlayer[b].video.duration) / waPlayer[b].seekingBarMaxWidth); waPlayer[b].timeCloudTime.innerHTML = waPlayer[b].asTime(c) + ' / ' + waPlayer[b].asTime(waPlayer[b].videoDuration) } else waPlayer[b].timeCloudTime.innerHTML = "00:00 / 00:00" }; waPlayer[wa_i].loadSubtitles = function(b) { var c = this.id; waPlayer[c].subtitlesStatus = 0; $.ajax({ url: waPlayer[c].mainFolder + '/panel/system/json/Subtitles.json.php?url=' + b, dataType: 'jsonp', success: function(a) { waPlayer[c].parseSubtitles(a.d) } }); waPlayer[c].subtitlesStart() }; waPlayer[wa_i].subtitlesVideoStopE = function(a) { var b = a.playerID; var c = a.videoID; waPlayer[b].subtitlesStop() }; waPlayer[wa_i].parseSubtitles = function(a) { var b = this.id; var c; var d; var f = 0; var g = a.split("\r\n"); var j; for (var h = 0; h < g.length; h++) { c = g[h]; if (c != "") { if (f == 5) f = 0; if (f == 0) { c = parseFloat(c); waPlayer[b].subtitles[c] = new Object(); waPlayer[b].subtitles[c].id = c; d = c } else if (f == 1) { j = c.split(" --> "); waPlayer[b].subtitles[d].start = waPlayer[b].getSeconds(j[0]); waPlayer[b].subtitles[d].stop = waPlayer[b].getSeconds(j[1]) } else if (f == 2) { waPlayer[b].subtitles[d].line1 = c } else if (f == 3) { waPlayer[b].subtitles[d].line2 = c } f++ } else f = 0 } if (waPlayer[b].subtitlesStatus == 2) waPlayer[b].subtitlesStart(); waPlayer[b].subtitlesStatus = 1 }; waPlayer[wa_i].getSeconds = function(a) { var b = this.id; var c = a.split(","); var d = c[0]; var f = d.split(":"); var g = Math.round(parseFloat(f[2] + ',' + c[1])); g = parseFloat(g + (f[1] * 60)); g = parseFloat(g + (f[0] * 3600)); return g }; waPlayer[wa_i].subtitlesStart = function() { var a = this.id; waPlayer[a].showSubtitles = true; waPlayer[a].addEventListener('videoStop', waPlayer[a].subtitlesVideoStopE, 'html5'); waPlayer[a].addEventListener('playbackProgress', waPlayer[a].subtitlesTimeListener, 'html5'); waPlayer[a].mainBarSubtitlesBar.style.display = 'block'; if (waPlayer[a].waControls) waPlayer[a].mainBarSubtitles.style.background = 'url(' + waPlayer[a].mainFolder + '/players/images/subtitlesoff.png)'; if (waPlayer[a].subtitlesStatus == 0) waPlayer[a].subtitlesStatus = 2 }; waPlayer[wa_i].subtitlesStop = function() { var a = this.id; waPlayer[a].removeEventListener('videoStop', waPlayer[a].subtitlesVideoStopE, 'html5'); waPlayer[a].removeEventListener('playbackProgress', waPlayer[a].subtitlesTimeListener, 'html5'); waPlayer[a].showSubtitles = false; waPlayer[a].subtitlesClear(); if (waPlayer[a].waControls) waPlayer[a].mainBarSubtitles.style.background = 'url(' + waPlayer[a].mainFolder + '/players/images/subtitles.png)'; clearInterval(waPlayer[a].subtitlesTimer); waPlayer[a].mainBarSubtitlesBar.style.display = 'none' }; waPlayer[wa_i].subtitlesClear = function() { var a = this.id; waPlayer[a].mainBarSubtitlesBar.innerHTML = '' }; waPlayer[wa_i].changeSubStatus = function() { var a = this.id; if (!waPlayer[a].showSubtitles) { waPlayer[a].subtitlesStart() } else { waPlayer[a].subtitlesStop() } }; waPlayer[wa_i].subtitlesObjBySec = function(a) { var b = this.id; for (var c = 0; c < waPlayer[b].subtitles.length; c++) { if (waPlayer[b].subtitles[c]) { if (waPlayer[b].subtitles[c].start == a) return waPlayer[b].subtitles[c] } } return false }; waPlayer[wa_i].subtitlesTimeListener = function(a) { var b = a.playerID; var c = a.currentTime; var d = Math.round(waPlayer[b].video.currentTime); if (d >= waPlayer[b].subtitlesClearSec || d < waPlayer[b].subtitlesStartSec) waPlayer[b].subtitlesClear(); if (d != waPlayer[b].subtitlesPrevSec) { var f = waPlayer[b].subtitlesObjBySec(d); if (f && waPlayer[b].subtitlesActShowId != f.id) { waPlayer[b].subtitlesRunObj(f) } } waPlayer[b].subtitlesPrevSec = d }; waPlayer[wa_i].subtitlesRunObj = function(a) { var b = this.id; if (waPlayer[b].mountedVideo.id == 'preroll' || waPlayer[b].mountedVideo.id == 'postroll') { waPlayer[b].subtitlesStop(); return } waPlayer[b].subtitlesClear(); waPlayer[b].subtitlesActShowId = a.id; waPlayer[b].subtitlesStartSec = a.start; waPlayer[b].subtitlesClearSec = a.stop; if (typeof a.line2 == "undefined") a.line2 = ""; waPlayer[b].mainBarSubtitlesBar.innerHTML = a.line1 + '
' + a.line2 }; waPlayer[wa_i].hubShareDisplay = function(a) { var b = this.id; var c = 50; waPlayer[b].hubShareTimerArrayNum = 0; if (a == 'visible') { waPlayer[b].hubShare.style.width = 'auto'; for (var d = 0; d < waPlayer[b].hubShareObjects.length; d++) { if (d == 0) waPlayer[b].hubShareObjects[d].style.visibility = 'visible'; else waPlayer[b].hubShareAddHideTimer(setTimeout("waPlayer[" + b + "].hubShareObjects[" + d + "].style.visibility='visible'", c * d)) } } else { var f = 0; for (var d = (waPlayer[b].hubShareObjects.length - 1); d >= 0; d--) { if (d == (waPlayer[b].hubShareObjects.length - 1)) waPlayer[b].hubShareObjects[d].style.visibility = 'hidden'; else waPlayer[b].hubShareAddHideTimer(setTimeout("waPlayer[" + b + "].hubShareObjects[" + d + "].style.visibility='hidden'", c * f)); f++ } waPlayer[b].hubShareAddHideTimer(setTimeout("waPlayer[" + b + "].hubShare.style.width = '42px';", c * f)) } }; waPlayer[wa_i].hubShareClearTimer = function() { var a = this.id; for (var b = 0; b < waPlayer[a].hubShareTimerArrayNum; b++) { clearTimeout(waPlayer[a].hubShareTimerArray[b]) } }; waPlayer[wa_i].hubShareAddHideTimer = function(a) { var b = this.id; var c = waPlayer[b].hubShareTimerArrayNum; waPlayer[b].hubShareTimerArray[c] = a; waPlayer[b].hubShareTimerArrayNum++ }; waPlayer[wa_i].hubShareOpenWindow = function() { var a = this.id; if (typeof waPlayer[a].mountedVideo.link != 'undefined' && waPlayer[a].mountedVideo.link != '') window.open(waPlayer[a].mountedVideo.link); else window.open(waPlayer[a].playerData.website.websiteURL) }; waPlayer[wa_i].showBigPlay = function() { var a = this.id; if (!waPlayer[a].ageVerDisplayed) waPlayer[a].playBig.style.display = 'block' }; waPlayer[wa_i].hideBigPlay = function() { var a = this.id; waPlayer[a].playBig.style.display = 'none' }; waPlayer[wa_i].ageVerDisplayed = false; waPlayer[wa_i].settedAge = 0; waPlayer[wa_i].showAgeVerificator = function() { var a = this.id; waPlayer[a].ageVerDisplayed = true; waPlayer[a].lockInterface(); waPlayer[a].hideBigPlay(); waPlayer[a].ageVerivicator.style.display = 'block'; waPlayer[a].ageVerivicatorTitle.innerHTML = waPlayer[a].getLang('boards', 'ageGate', 'title'); waPlayer[a].ageVerivicatorInputs.innerHTML = waPlayer[a].ageGenerateInputs(); waPlayer[a].ageVerivicatorPlay.innerHTML = waPlayer[a].getLang('boards', 'ageGate', 'accept'); waPlayer[a].ageVerivicatorAccept() }; waPlayer[wa_i].hideAgeVerificator = function() { var a = this.id; waPlayer[a].ageVerDisplayed = false; waPlayer[a].unlockInterface(); waPlayer[a].ageVerivicator.style.display = 'none' }; waPlayer[wa_i].ageVerificatorPlay = function() { var a = this.id; createCookie('wa_age', waPlayer[a].settedAge, 2419200); waPlayer[a].mountedVideo.ageVerified = true; waPlayer[a].setVideo(waPlayer[a].mountedVideo.id, 1) }; waPlayer[wa_i].ageGenerateInputs = function() { var a = this.id; var b = ''; var c = waPlayer[a].getLang('boards', 'ageGate', 'months'); c = c.split(','); b += ''; b += ''; b += ''; return b }; waPlayer[wa_i].ageVerivicatorAccept = function() { var a = this.id; var b = document.getElementById('wa_day_' + a).value; var c = document.getElementById('wa_month_' + a).value; var d = document.getElementById('wa_year_' + a).value; var f = new Date(d, c - 1, b, 0, 0, 0, 0); var g = new Date(); var j = Math.round((g.getTime() - f.getTime()) / 1000 / 60 / 60 / 24 / 366); waPlayer[a].settedAge = j; if (waPlayer[a].mountedVideo.minAge <= j) { waPlayer[a].ageVerivicatorUnBlock() } else waPlayer[a].ageVerivicatorBlock() }; waPlayer[wa_i].ageVerivicatorUnBlock = function() { var a = this.id; waPlayer[a].ageVerivicatorPlay.onclick = function() { waPlayer[a].hideAgeVerificator(); waPlayer[a].ageVerificatorPlay() }; waPlayer[a].setOpacity(document.getElementById('wa_agev_inputs_a_' + a), 1) }; waPlayer[wa_i].ageVerivicatorBlock = function() { var a = this.id; waPlayer[a].ageVerivicatorPlay.onclick = null; waPlayer[a].setOpacity(document.getElementById('wa_agev_inputs_a_' + a), 0.5) }; waPlayer[wa_i].hideAllMenuPanels = function(a) { var b = this.id; if (a) waPlayer[b].menu.style.display = 'none'; waPlayer[b].hideMenuLink(); waPlayer[b].hideMenuEmbed(); waPlayer[b].hideMenuEmail(); waPlayer[b].hideMenuInfo() }; waPlayer[wa_i].showMenu = function(a) { var b = this.id; if (!waPlayer[b].interfaceLocked) { waPlayer[b].menu.style.display = 'block'; waPlayer[b].hideAllMenuPanels(false); switch (a) { case "link": waPlayer[b].showMenuLink(); break; case "embed": waPlayer[b].showMenuEmbed(); break; case "email": waPlayer[b].showMenuEmail(); break; case "info": waPlayer[b].showMenuInfo(); break; default: break } if (waPlayer[b].showSubtitles) { waPlayer[b].mainBarSubtitlesBar.style.display = 'none' } if (waPlayer[b].overlaytxtObj.showButtonDisplayed) waPlayer[b].overlaytxtObj.show.style.display = 'none'; if (waPlayer[b].overlaybannerObj.showButtonDisplayed) waPlayer[b].overlaybannerObj.show.style.display = 'none' } }; waPlayer[wa_i].hideMenu = function() { var a = this.id; waPlayer[a].menu.style.display = 'none'; if (waPlayer[a].showSubtitles) waPlayer[a].mainBarSubtitlesBar.style.display = 'block'; if (waPlayer[a].overlaytxtObj.showButtonDisplayed) waPlayer[a].overlaytxtObj.show.style.display = 'block' }; waPlayer[wa_i].menuLinkUpdateData = function() { var a = this.id; waPlayer[a].menuLinkImg.src = waPlayer[a].mountedVideo.thumbnail; var b = waPlayer[a].mountedVideo.link; if (b == '') b = waPlayer[a].playerData.website.websiteURL; waPlayer[a].menuLinkUrl.value = b; document.getElementById('wa_menu_link_1_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareLink', 'title'); document.getElementById('wa_menu_link_2_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareLink', 'text1'); document.getElementById('wa_menu_link_3_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareLink', 'description') }; waPlayer[wa_i].hideMenuLink = function() { var a = this.id; waPlayer[a].menuLink.style.display = 'none' }; waPlayer[wa_i].showMenuLink = function() { var a = this.id; waPlayer[a].menuLink.style.display = 'block'; waPlayer[a].menuLinkUpdateData() }; waPlayer[wa_i].menuEmbedUpdateData = function() { var a = this.id; waPlayer[a].menuEmbedImg.src = waPlayer[a].mountedVideo.thumbnail; var b = ''; waPlayer[a].menuEmbedCode.value = b; document.getElementById('wa_menu_embed_1_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmbed', 'title'); document.getElementById('wa_menu_embed_2_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmbed', 'description'); document.getElementById('wa_menu_embed_3_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmbed', 'text1'); document.getElementById('wa_menu_embed_4_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmbed', 'text2'); document.getElementById('wa_menu_embed_5_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmbed', 'text3'); document.getElementById('wa_menu_embed_6_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmbed', 'text4') }; waPlayer[wa_i].hideMenuEmbed = function() { var a = this.id; waPlayer[a].menuEmbed.style.display = 'none' }; waPlayer[wa_i].showMenuEmbed = function() { var a = this.id; waPlayer[a].menuEmbed.style.display = 'block'; waPlayer[a].menuEmbedUpdateData() }; waPlayer[wa_i].menuEmailUpdateData = function() { var a = this.id; waPlayer[a].menuEmailImg.src = waPlayer[a].mountedVideo.thumbnail; document.getElementById('wa_menu_email_1_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmail', 'title'); document.getElementById('wa_menu_email_2_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmail', 'description'); document.getElementById('wa_menu_email_3_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmail', 'text1'); document.getElementById('wa_menu_email_4_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmail', 'text2'); document.getElementById('wa_menu_email_5_' + a).innerHTML = waPlayer[a].getLang('boards', 'shareEmail', 'text3'); waPlayer[a].sendEmailUnBlockSend() }; waPlayer[wa_i].hideMenuEmail = function() { var a = this.id; waPlayer[a].menuEmail.style.display = 'none' }; waPlayer[wa_i].showMenuEmail = function() { var a = this.id; waPlayer[a].menuEmail.style.display = 'block'; waPlayer[a].menuEmailUpdateData() }; waPlayer[wa_i].sendEmailBlockSend = function() { var a = this.id; waPlayer[a].menuEmailSend.innerHTML = '' + waPlayer[a].getLang('buttons', 'send') + '' }; waPlayer[wa_i].sendEmailUnBlockSend = function() { var a = this.id; waPlayer[a].menuEmailSend.innerHTML = '' + waPlayer[a].getLang('buttons', 'send') + '' }; waPlayer[wa_i].sendEmail = function() { var a = this.id; var b = false; if (waPlayer[a].menuEmailFrom.value == '' || !waPlayer[a].validEmail(waPlayer[a].menuEmailFrom.value)) { waPlayer[a].menuEmailFrom.style.border = '1px solid red'; b = true } else waPlayer[a].menuEmailFrom.style.border = '1px solid grey'; if (waPlayer[a].menuEmailTo.value == '' || !waPlayer[a].validEmail(waPlayer[a].menuEmailTo.value)) { waPlayer[a].menuEmailTo.style.border = '1px solid red'; b = true } else waPlayer[a].menuEmailTo.style.border = '1px solid grey'; if (waPlayer[a].menuEmailCom.value == '') { waPlayer[a].menuEmailCom.style.border = '1px solid red'; b = true } else waPlayer[a].menuEmailCom.style.border = '1px solid grey'; if (b) return; var c = waPlayer[a].playerData.website.websiteTitle; if (typeof waPlayer[a].mountedVideo.title != 'undefined' && waPlayer[a].mountedVideo.title != '') c = waPlayer[a].mountedVideo.title; var d = 'https://' + waPlayer[a].playerData.general.domain; if (typeof waPlayer[a].mountedVideo.link != 'undefined' && waPlayer[a].mountedVideo.link != '') d = waPlayer[a].mountedVideo.link; var f = waPlayer[a].menuEmailTo.value; var g = waPlayer[a].menuEmailFrom.value; var j = waPlayer[a].menuEmailCom.value; var h = new Object(); h.to = f; h.from = g; h.subject = waPlayer[a].getLang('boards', 'shareEmail', 'emailTitle', new Array('videoTitle=>' + c)); h.message = waPlayer[a].getLang('boards', 'shareEmail', 'emailMessage', new Array('viewerEmail=>' + g, 'viewerMessage=>' + j, 'videoTitle=>' + c, 'videoLink=>' + d)); $.ajax({ url: 'https://' + waPlayer[a].playerData.general.domain + '/' + waPlayer[a].playerData.general.folder + '/panel/system/json/Email.json.php', type: 'POST', data: h, dataType: 'jsonp' }); waPlayer[a].sendEmailBlockSend() }; waPlayer[wa_i].validEmail = function(a) { var b = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/; return b.test(a) }; waPlayer[wa_i].menuInfoUpdateData = function() { var a = this.id; document.getElementById('wa_menu_info_1_' + a).innerHTML = waPlayer[a].mountedVideo.title; document.getElementById('wa_menu_info_2_' + a).innerHTML = waPlayer[a].mountedVideo.description; waPlayer[a].menuInfoImg.src = waPlayer[a].mountedVideo.thumbnail; if (waPlayer[a].mountedVideo.tags != '' && typeof waPlayer[a].mountedVideo.tags != "undefined") { document.getElementById('wa_menu_info_3_' + a).style.display = 'block'; document.getElementById('wa_menu_info_3_' + a).innerHTML = waPlayer[a].getLang('general', 'tags') + ': ' + waPlayer[a].mountedVideo.tags + '' } else { document.getElementById('wa_menu_info_3_' + a).style.display = 'none' } if (waPlayer[a].mountedVideo.author != '' && typeof waPlayer[a].mountedVideo.author != "undefined") { document.getElementById('wa_menu_info_4_' + a).style.display = 'block'; document.getElementById('wa_menu_info_4_' + a).innerHTML = waPlayer[a].getLang('general', 'author') + ': ' + waPlayer[a].mountedVideo.author + '' } else { document.getElementById('wa_menu_info_4_' + a).style.display = 'none' } if (waPlayer[a].mountedVideo.added != '' && typeof waPlayer[a].mountedVideo.added != "undefined") { document.getElementById('wa_menu_info_5_' + a).style.display = 'block'; var b = new Date(); b.setTime(waPlayer[a].mountedVideo.added * 1000); document.getElementById('wa_menu_info_5_' + a).innerHTML = waPlayer[a].getLang('general', 'added') + ': ' + (b.getHours() + ((b.getMinutes() < 10) ? ":0" : ":") + b.getMinutes() + ((b.getSeconds() < 10) ? ":0" : ":") + b.getSeconds()) + ', ' + (((b.getDate() < 10) ? "0" : "") + b.getDate() + (((b.getMonth() + 1) < 10) ? "-0" : "-") + (b.getMonth() + 1) + '-' + b.getFullYear()) + '' } else { document.getElementById('wa_menu_info_5_' + a).style.display = 'none' } }; waPlayer[wa_i].hideMenuInfo = function() { var a = this.id; waPlayer[a].menuInfo.style.display = 'none' }; waPlayer[wa_i].showMenuInfo = function() { var a = this.id; waPlayer[a].menuInfo.style.display = 'block'; waPlayer[a].menuInfoUpdateData() }; waPlayer[wa_i].events = new Array(); waPlayer[wa_i].addEventListener = function(a, b, c) { var d = this.id; var f = waPlayer[d].findEventObject(a, c); if (f == -1) waPlayer[d].addEventObject(a, b, c); else waPlayer[d].addFuncToEventObject(f, b, c) }; waPlayer[wa_i].removeEventListener = function(a, b, c) { var d = this.id; var f = waPlayer[d].findEventObject(a, c); if (f != -1) waPlayer[d].removeFuncFromEventObject(f, b, c) }; waPlayer[wa_i].removeFuncFromEventObject = function(a, b, c) { var d = this.id; var f = -1; for (var g = 0; g < waPlayer[d].events[a].functions.length; g++) { if (waPlayer[d].events[a].functions[g][0] == b && waPlayer[d].events[a].functions[g][1] == c) { f = g; break } } if (f != -1) { waPlayer[d].events[a].functions.splice(f, 1) } }; waPlayer[wa_i].addFuncToEventObject = function(a, b, c) { var d = this.id; var f = false; for (var g = 0; g < waPlayer[d].events[a].functions.length; g++) { if (waPlayer[d].events[a].functions[g][0] == b && waPlayer[d].events[a].functions[g][1] == c) { f = true; break } } if (!f) { var j = waPlayer[d].events[a].functions.length; waPlayer[d].events[a].functions[j] = new Array(); waPlayer[d].events[a].functions[j][0] = b; waPlayer[d].events[a].functions[j][1] = c } }; waPlayer[wa_i].addEventObject = function(a, b, c) { var d = this.id; var f = waPlayer[d].events.length; waPlayer[d].events[f] = new Object(); waPlayer[d].events[f].name = a; waPlayer[d].events[f].functions = new Array(); waPlayer[d].events[f].functions[0] = new Array(); waPlayer[d].events[f].functions[0][0] = b; waPlayer[d].events[f].functions[0][1] = c }; waPlayer[wa_i].findEventObject = function(a) { var b = this.id; for (var c = 0; c < waPlayer[b].events.length; c++) { if (waPlayer[b].events[c].name == a) return c } return -1 }; waPlayer[wa_i].runEventFunc = function(a) { var b = this.id; a.playerID = b; for (var c = 0; c < waPlayer[b].events.length; c++) { if (waPlayer[b].events[c].name == a.eventType) { for (var d = 0; d < waPlayer[b].events[c].functions.length; d++) { if (typeof waPlayer[b].events[c].functions[d][1] == "undefined" || waPlayer[b].events[c].functions[d][1] == a.playerMode) { if (typeof(waPlayer[b].events[c].functions[d][0]) == 'string') { var f = waPlayer[b].events[c].functions[d][0]; window[f](a) } else { waPlayer[b].events[c].functions[d][0](a) } } } } } }; waPlayer[wa_i].videoStartEvent = function(a) { var b = this.id; var c = { eventType: 'videoStart', videoID: a, playerMode: 'html5' }; waPlayer[b].runEventFunc(c) }; waPlayer[wa_i].videoStopEvent = function(a) { var b = this.id; var c = { eventType: 'videoStop', videoID: a, playerMode: 'html5' }; waPlayer[b].runEventFunc(c) }; waPlayer[wa_i].advertStartEvent = function(a) { var b = this.id; var c = { eventType: 'advertStart', advertType: a, playerMode: 'html5' }; waPlayer[b].runEventFunc(c) }; waPlayer[wa_i].advertStopEvent = function(a) { var b = this.id; var c = { eventType: 'advertStop', advertType: a, playerMode: 'html5' }; waPlayer[b].runEventFunc(c) }; waPlayer[wa_i].qualityChangeEvent = function(a) { var b = this.id; var c = { eventType: 'qualityChange', quality: a, playerMode: 'html5' }; waPlayer[b].runEventFunc(c) }; waPlayer[wa_i].playbackStatusEvent = function(a, b) { var c = this.id; var d = { eventType: 'playbackStatus', time: a, action: b, playerMode: 'html5' }; waPlayer[c].runEventFunc(d) }; waPlayer[wa_i].viewModeChangeEvent = function(a) { var b = this.id; var c = { eventType: 'viewModeChange', viewMode: a, playerMode: 'html5' }; waPlayer[b].runEventFunc(c) }; waPlayer[wa_i].volumeChangeEvent = function(a) { var b = this.id; var c = { eventType: 'volumeChange', volume: a, playerMode: 'html5' }; waPlayer[b].runEventFunc(c) }; waPlayer[wa_i].videoSeekEvent = function(a) { var b = this.id; var c = { eventType: 'videoSeek', seekTime: a, playerMode: 'html5' }; waPlayer[b].runEventFunc(c) }; waPlayer[wa_i].playerLoadedEvent = function() { var a = this.id; var b = { eventType: 'playerLoaded', playerMode: 'html5' }; waPlayer[a].runEventFunc(b) }; waPlayer[wa_i].playbackProgressEvent = function(a) { var b = this.id; var c = { eventType: 'playbackProgress', time: a, playerMode: 'html5' }; waPlayer[b].runEventFunc(c) }; waPlayer[wa_i].videoSequenceStopEvent = function(a) { var b = this.id; var c = { eventType: 'videoSequenceStop', videoID: a, playerMode: 'html5' }; waPlayer[b].runEventFunc(c) }; if (typeof initFunction != 'undefined') { waPlayer[wa_i].addEventListener('playerLoaded', initFunction); initFunction = undefined } addEvent = (function() { if (document.addEventListener) { return function(a, b, c) { if (a && a.nodeName || a === window) { a.addEventListener(b, c, false) } else if (a && a.length) { for (var d = 0; d < a.length; d++) { addEvent(a[d], b, c) } } } } else { return function(a, b, c) { if (a && a.nodeName || a === window) { a.attachEvent('on' + b, function() { return c.call(a, window.event) }) } else if (a && a.length) { for (var d = 0; d < a.length; d++) { addEvent(a[d], b, c) } } } } })(); waPlayer[wa_i].prevTime = -1; waPlayer[wa_i].addEventListeners = function() { var c = this.id; if (waPlayer[c].waControls) addEvent(waPlayer[c].video, 'click', function() { if (!waPlayer[c].advertMode) { if (!waPlayer[c].playing) waPlayer[c].play(); else waPlayer[c].pause() } else waPlayer[c].advertLinearClick() }); addEvent(waPlayer[c].bigThumb, 'click', function() { if (!waPlayer[c].interfaceLocked) { if (!waPlayer[c].playing) waPlayer[c].play(); else waPlayer[c].pause() } }); addEvent(waPlayer[c].playBig, 'click', function() { waPlayer[c].play() }); addEvent(waPlayer[c].mainBarPlay, 'click', function() { if (!waPlayer[c].playLocked) { if (!waPlayer[c].playing) waPlayer[c].play(); else waPlayer[c].pause() } }); addEvent(waPlayer[c].mainBarFullScreen, 'click', function() { if (!waPlayer[c].interfaceLocked) waPlayer[c].goFullScreen(true) }); addEvent(waPlayer[c].video, 'canplay', function() { clearTimeout(waPlayer[c].canplayErrorTimer) }); addEvent(waPlayer[c].video, 'ended', function() { if (!waPlayer[c].advertMode) { if (waPlayer[c].waControls) { if (typeof waPlayer[c].mountedVideo.poster != "undefined" && waPlayer[c].mountedVideo.poster != '') { waPlayer[c].bigThumb.style.display = 'block'; waPlayer[c].bigThumbImg.src = waPlayer[c].mountedVideo.poster } waPlayer[c].mainBarPlayed.style.width = waPlayer[c].seekingBarMaxWidth + 'px' } waPlayer[c].pause(); waPlayer[c].videoStopEvent(waPlayer[c].mountedVideo.id) } else if (waPlayer[c].advertMode) waPlayer[c].advertLinearStop() }); addEvent(waPlayer[c].video, 'waiting', function() { waPlayer[c].waiting = true; if (waPlayer[c].buffer) waPlayer[c].buffer.style.display = 'block' }); addEvent(waPlayer[c].video, 'playing', function() { waPlayer[c].waiting = false; if (waPlayer[c].buffer) waPlayer[c].buffer.style.display = 'none'; if (!waPlayer[c].timeUpdateSet) setInterval("waPlayer[" + c + "].timeUpdate();", 500) }); waPlayer[c].updateSeekingBarBuffered(); addEvent(waPlayer[c].video, 'durationchange', function() { if (waPlayer[c].waControls) { waPlayer[c].videoDuration = waPlayer[c].video.duration; waPlayer[c].mainBarTT.innerHTML = waPlayer[c].asTime(waPlayer[c].video.duration) } }); addEvent(waPlayer[c].video, 'progress', function(a) { if (waPlayer[c].waControls) { var b = Number(0); if (waPlayer[c].video.bytesTotal !== undefined && waPlayer[c].video.bytesTotal > 0 && waPlayer[c].video.bufferedBytes !== undefined) { b = waPlayer[c].video.bufferedBytes / waPlayer[c].video.bytesTotal } else if (waPlayer[c].video.buffered && waPlayer[c].video.buffered.length > 0 && waPlayer[c].video.buffered.end && waPlayer[c].video.duration) { b = waPlayer[c].video.buffered.end(0) / waPlayer[c].video.duration } waPlayer[c].updateSeekingBarBuffered(b) } }) }; waPlayer[wa_i].soundBarOnMouseUP = function() { var a = this.id; waPlayer[a].soundBarIndicatorMove = false; document.onmouseup = null; if (!waPlayer[a].volumeRollOver) waPlayer[a].volumeHideSequence(true) }; waPlayer[wa_i].soundBarOnMouseDOWN = function() { var b = this.id; waPlayer[b].soundBarIndicatorMove = true; document.onmouseup = function(a) { waPlayer[b].soundBarOnMouseUP() } }; waPlayer[wa_i].soundBarOnMouseCLICK = function() { var a = this.id; pos = waPlayer[a].getOffsetY(waPlayer[a].soundBar) - waPlayer[a].waMouseY + 61; if (pos >= 7 && pos <= 46) { waPlayer[a].soundBarIndicator.style.bottom = (pos + 6) + 'px'; waPlayer[a].soundBarGradient.style.height = (pos - 7) + 'px'; waPlayer[a].setVolume(((pos - 7) * 100) / 39) } }; waPlayer[wa_i].soundBarOnMouseOVER = function() { var a = this.id; waPlayer[a].soundBarIndicatorIMove = true; waPlayer[a].soundBarIndicator.style.display = 'block' }; waPlayer[wa_i].soundBarOnMouseOUT = function() { var a = this.id; if (!waPlayer[a].soundBarIndicatorMove) waPlayer[a].soundBarIndicatorIMove = false; waPlayer[a].soundBarIndicator.style.display = 'none' }; document.onmousemove = function(a) { if (document.layers) { waPlayer[wa_i].waMouseX = a.pageX; waPlayer[wa_i].waMouseY = a.pageY } else if (document.all) { waPlayer[wa_i].waMouseX = window.event.x; waPlayer[wa_i].waMouseY = window.event.y } else if (document.getElementById) { waPlayer[wa_i].waMouseX = a.pageX; waPlayer[wa_i].waMouseY = a.pageY } }; waPlayer[wa_i].PLAYERover = function() { var c = this.id; waPlayer[c].mouseOver = true; if (waPlayer[c].timeoutevent) clearTimeout(waPlayer[c].timeoutevent); document.onmousemove = function(a) { if (document.layers) { waPlayer[c].waMouseX = a.pageX; waPlayer[c].waMouseY = a.pageY } else if (document.all) { waPlayer[c].waMouseX = window.event.x; waPlayer[c].waMouseY = window.event.y } else if (document.getElementById) { waPlayer[c].waMouseX = a.pageX; waPlayer[c].waMouseY = a.pageY } if (waPlayer[c].tipOn) waPlayer[c].reAddTip(); if (waPlayer[c].barIndicatorMove) { pos = waPlayer[c].waMouseX - waPlayer[c].getOffsetX(waPlayer[c].mainBarMain) + 2; if (pos >= 0 && pos <= waPlayer[c].seekingBarMaxWidth) { waPlayer[c].mainBarIndicator.style.left = pos + 'px'; waPlayer[c].timeCloudGetTime(pos); var b = (waPlayer[c].seekBarStartX + pos) - 42; waPlayer[c].timeCloud.style.left = b + 'px'; if (waPlayer[c].barSeekMove) waPlayer[c].mainBarPlayed.style.width = waPlayer[c].mainBarIndicator.style.left } } if (waPlayer[c].soundBarIndicatorIMove) { waPlayer[c].volumeHideSequence(false); pos = waPlayer[c].getOffsetY(waPlayer[c].soundBar) - waPlayer[c].waMouseY + 61; if (pos >= 7 && pos <= 46) { waPlayer[c].soundBarIndicator.style.bottom = (pos + 6) + 'px'; if (waPlayer[c].soundBarIndicatorMove) { waPlayer[c].soundBarGradient.style.height = (pos - 7) + 'px'; waPlayer[c].setVolume(((pos - 7) * 100) / 39) } } } }; if (!waPlayer[c].barDisplayed) waPlayer[c].showMainBar(); if (!waPlayer[c].interfaceLocked && !waPlayer[c].advertMode) { if (typeof waPlayer[c].hub != "undefined") waPlayer[c].hub.style.display = 'block' } }; waPlayer[wa_i].PLAYERout = function() { var a = this.id; waPlayer[a].mouseOver = false; if (waPlayer[a].playing) waPlayer[a].hub.style.display = 'none'; if (!waPlayer[a].soundBarDisplayed) { waPlayer[a].timeoutevent = setTimeout(function() { if (!waPlayer[a].mouseOver && typeof waPlayer[a].menu != "undefined" && waPlayer[a].menu.style.display == 'none') { if (waPlayer[a].playerData.interface.autoHide == 1 && waPlayer[a].barDisplayed && waPlayer[a].playing) waPlayer[a].hideMainBar() } }, waPlayer[a].playerData.interface.hideAfter * 1000) } }; waPlayer[wa_i].timeUpdateSet = false; waPlayer[wa_i].timeUpdate = function() { var a = this.id; waPlayer[a].timeUpdateSet = true; if (!waPlayer[a].waiting && !waPlayer[a].video.paused) { if (waPlayer[a].waControls) { waPlayer[a].prevTime = waPlayer[a].video.currentTime; waPlayer[a].updateSeekingBarPlayed(); waPlayer[a].mainBarCT.innerHTML = waPlayer[a].asTime(waPlayer[a].video.currentTime) } waPlayer[a].playbackProgressEvent(waPlayer[a].video.currentTime) } }; waPlayer[wa_i].onlyPlay = function() { var a = this.id; if (waPlayer[a].buffer) waPlayer[a].buffer.style.display = 'none'; waPlayer[a].video.play() }; waPlayer[wa_i].barOnMouseUp = function(a) { var b = this.id; document.onmouseup = null; waPlayer[b].barSetSeekStatus(a); waPlayer[b].barSeekMove = false }; waPlayer[wa_i].barOnMouseDown = function() { var b = this.id; if (!waPlayer[b].interfaceLocked && !waPlayer[b].advertMode) { waPlayer[b].barIndicatorMove = true; waPlayer[b].barSeekMove = true; document.onmouseup = function(a) { waPlayer[b].barOnMouseUp() } } }; waPlayer[wa_i].barOnMouseOut = function() { var a = this.id; if (!waPlayer[a].interfaceLocked && !waPlayer[a].advertMode) { waPlayer[a].barIndicatorMove = false; waPlayer[a].mainBarIndicator.style.display = 'none'; waPlayer[a].timeCloud.style.display = 'none' } }; waPlayer[wa_i].barOnMouseOver = function() { var a = this.id; var b = 0; if (!waPlayer[a].interfaceLocked && !waPlayer[a].advertMode) { waPlayer[a].mainBarIndicator.style.display = 'block'; waPlayer[a].barIndicatorMove = true; waPlayer[a].timeCloud.style.display = 'block' } }; waPlayer[wa_i].barOnClick = function() { var a = this.id; if (!waPlayer[a].interfaceLocked && !waPlayer[a].advertMode) { waPlayer[a].seekTo = 0; var b = waPlayer[a].waMouseX - waPlayer[a].getOffsetX(waPlayer[a].mainBarMain) + 2; waPlayer[a].barSetSeekStatus(b); if (b >= 0 && b <= waPlayer[a].seekingBarMaxWidth) { waPlayer[a].mainBarIndicator.style.left = b + 'px'; waPlayer[a].mainBarPlayed.style.width = waPlayer[a].mainBarIndicator.style.left } } }; waPlayer[wa_i].barSetSeekStatus = function(a) { var b = this.id; if (!waPlayer[b].interfaceLocked && !waPlayer[b].advertMode) { if (waPlayer[b].video.readyState) { try { if (!a || typeof a == 'undefined') a = waPlayer[b].removePX(waPlayer[b].mainBarIndicator.style.left); var c = Math.round((a * waPlayer[b].video.duration) / waPlayer[b].seekingBarMaxWidth); if (c) { waPlayer[b].videoSeekEvent(c); waPlayer[b].seekTo = c; waPlayer[b].video.currentTime = c; waPlayer[b].playbackSeekEvent(c); waPlayer[b].updateSeekingBarPlayed() } } catch (e) {} } } }; function escapePressed(a) { if (a.keyCode == 27) { for (var b = 0; b <= waPlayersArray.length; b++) { num = waPlayersArray[b]; if (waPlayer[num]) { if (waPlayer[num].fullScreenMode) waPlayer[num].goFullScreen() } } } }; window.onresize = function(a) { for (var b = 0; b <= waPlayersArray.length; b++) { num = waPlayersArray[b]; if (waPlayer[num] && waPlayer[num].fullScreenMode) { waPlayer[num].fullScreenMode = false; waPlayer[num].goFullScreen() } } }; waPlayer[wa_i].hubShareMouseOver = function() { var a = this.id; if (!waPlayer[a].interfaceLocked) { clearTimeout(waPlayer[a].hubShareTimer); waPlayer[a].hubShareClearTimer(); waPlayer[a].hubShareDisplay('visible') } }; waPlayer[wa_i].hubShareMouseOut = function(a) { var b = this.id; if (!a) waPlayer[b].hubShareTimer = setTimeout("waPlayer[" + b + "].hubShareMouseOut(true)", 300); else waPlayer[b].hubShareDisplay('hidden') }; waPlayer[wa_i].addMainBar = function() { var a = this.id; var b = 'none'; b = 'block'; waPlayer[a].write('
'); waPlayer[a].addMainBarPlay(); waPlayer[a].addMainBarHD(); waPlayer[a].addMainBarVolumeBar(); waPlayer[a].addMainBarFullScreen(); waPlayer[a].addMainBarSubtitles(); waPlayer[a].addMainBarSeek(); waPlayer[a].barDisplayed = true; waPlayer[a].readdAdvertOverlayTxt(waPlayer[a].fullScreenMode); document.write('
'); waPlayer[a].mainBar = document.getElementById('wa_mainBar_' + a); waPlayer[a].reMainBar(false); }; waPlayer[wa_i].reMainBar = function(a) { var b = this.id; waPlayer[b].mainDivControls.style.width = waPlayer[b].mainDiv.style.width; if (!a) waPlayer[b].mainDivControls.style.zIndex = 27; else waPlayer[b].mainDivControls.style.zIndex = 900027; waPlayer[b].mainBar.style.width = waPlayer[b].mainDiv.style.width; waPlayer[b].mainBar.style.height = '28px'; if (!a) { waPlayer[b].mainBar.style.zIndex = 30; waPlayer[b].mainDivControls.style.left = 'auto'; waPlayer[b].mainDivControls.style.bottom = 'auto'; } else { waPlayer[b].mainBar.style.zIndex = 900030; waPlayer[b].mainDivControls.style.left = '0px'; waPlayer[b].mainDivControls.style.bottom = '0px'; } }; waPlayer[wa_i].reMainBarElements = function(a) { var b = this.id; waPlayer[b].lastBarLeftElement = 13; waPlayer[b].lastBarRightElement = waPlayer[b].width - 13; waPlayer[b].reMainBarPlay(a); waPlayer[b].reMainBarHD(a); waPlayer[b].reMainBarVB(a); waPlayer[b].reMainBarFC(a); waPlayer[b].reMainBarSubtitles(a); waPlayer[b].readdMainBarTotalTime(a); waPlayer[b].readdMainBarCurrentTime(a); waPlayer[b].readdMainBarSeek(a); }; waPlayer[wa_i].addMainBarPlay = function() { var a = this.id; waPlayer[a].write('
'); waPlayer[a].mainBarPlay = document.getElementById('wa_mainBar_play_' + a); waPlayer[a].reMainBarPlay(false) }; waPlayer[wa_i].reMainBarPlay = function(a) { var b = this.id; var c = 4; var d = 16; waPlayer[b].mainBarPlay.style.top = c + 'px'; waPlayer[b].mainBarPlay.style.left = d + 'px'; if (!a) waPlayer[b].mainBarPlay.style.zIndex = 31; else waPlayer[b].mainBarPlay.style.zIndex = 900031; waPlayer[b].lastBarLeftElement = 25 + d }; waPlayer[wa_i].forceHideQualitySwitch = false; waPlayer[wa_i].addMainBarHD = function() { var a = this.id; if (waPlayer[a].playingSD) button = 'sd'; else button = 'hd'; waPlayer[a].write('
'); waPlayer[a].mainBarHD = document.getElementById('wa_mainBar_hd_' + a); waPlayer[a].mainBarHDimg = document.getElementById('wa_mainBar_hd_b_' + a); waPlayer[a].reMainBarHD(false); waPlayer[a].addMainBarQSwitch() }; waPlayer[wa_i].reMainBarHD = function(a) { var b = this.id; if (!waPlayer[b].forceHideQualitySwitch && waPlayer[b].playerData.interface.qualitySwitch == 1) { waPlayer[b].mainBarHD.style.display = 'block'; var c = 5; var d = waPlayer[b].lastBarLeftElement; waPlayer[b].mainBarHD.style.top = c + 'px'; waPlayer[b].mainBarHD.style.left = d + 'px'; if (!a) waPlayer[b].mainBarHD.style.zIndex = 31; else waPlayer[b].mainBarHD.style.zIndex = 900031; waPlayer[b].lastBarLeftElement = 52 + d } else { waPlayer[b].mainBarHD.style.display = 'none' } }; waPlayer[wa_i].addMainBarQSwitch = function() { var a = this.id; var b = ''; waPlayer[a].write(b); waPlayer[a].qualityBar = document.getElementById('wa_qualityBar_' + a); if (waPlayer[a].playingSD) { document.getElementById('wa_qbar_imgsd_' + a).style.display = "block"; document.getElementById('wa_qbar_imghd_' + a).style.display = "none" } else { document.getElementById('wa_qbar_imgsd_' + a).style.display = "none"; document.getElementById('wa_qbar_imghd_' + a).style.display = "block" } waPlayer[a].reAddMainBarQSwitch() }; waPlayer[wa_i].reAddMainBarQSwitch = function() { var a = this.id; waPlayer[a].qualityBar.style.left = '37px'; waPlayer[a].qualityBar.style.bottom = '32px'; waPlayer[a].qualityBar.style.zIndex = 160 }; waPlayer[wa_i].addMainBarVolumeBar = function() { var a = this.id; waPlayer[a].write('
'); waPlayer[a].mainBarVolumeBar = document.getElementById('wa_mainBar_vb_' + a); waPlayer[a].reMainBarVB(false); waPlayer[a].addSoundBar(); var b = readCookie('wa_volume'); if (b != null) waPlayer[a].waSetVolume(b) }; waPlayer[wa_i].reMainBarVB = function(a) { var b = this.id; if (waPlayer[b].playerData.interface.volume == 1) { waPlayer[b].mainBarVolumeBar.style.display = 'block'; var c = 4; var d = waPlayer[b].lastBarRightElement - 23; waPlayer[b].mainBarVolumeBar.style.top = c + 'px'; waPlayer[b].mainBarVolumeBar.style.left = d + 'px'; if (!a) waPlayer[b].mainBarVolumeBar.style.zIndex = 31; else waPlayer[b].mainBarVolumeBar.style.zIndex = 900031; waPlayer[b].lastBarRightElement = d - 8 } else { waPlayer[b].mainBarVolumeBar.style.display = 'none' } }; waPlayer[wa_i].addSoundBar = function() { var a = this.id; var b = ''; waPlayer[a].write(b); waPlayer[a].soundBar = document.getElementById('wa_volumeBar_' + a); waPlayer[a].soundBarGradient = document.getElementById('wa_volumeBarGradient_' + a); waPlayer[a].soundBarIndicator = document.getElementById('wa_volumeBarIndicator_' + a); waPlayer[a].readdSoundBar(false) }; waPlayer[wa_i].readdSoundBar = function(a) { var b = this.id; waPlayer[b].soundBar.style.right = '11px'; waPlayer[b].soundBar.style.bottom = '34px'; if (!a) waPlayer[b].soundBar.style.zIndex = 180; else waPlayer[b].soundBar.style.zIndex = 900180 }; waPlayer[wa_i].addMainBarFullScreen = function() { var a = this.id; waPlayer[a].write('
'); waPlayer[a].mainBarFullScreen = document.getElementById('wa_mainBar_fc_' + a); waPlayer[a].reMainBarFC(false) }; waPlayer[wa_i].reMainBarFC = function(a) { var b = this.id; if (waPlayer[b].playerData.interface.fullScreen == 1) { waPlayer[b].mainBarFullScreen.style.display = 'block'; var c = 4; var d = waPlayer[b].lastBarRightElement - 16; waPlayer[b].mainBarFullScreen.style.top = c + 'px'; waPlayer[b].mainBarFullScreen.style.left = d + 'px'; if (!a) waPlayer[b].mainBarFullScreen.style.zIndex = 31; else waPlayer[b].mainBarFullScreen.style.zIndex = 900031; waPlayer[b].lastBarRightElement = d - 8 } else { waPlayer[b].mainBarFullScreen.style.display = 'none' } }; waPlayer[wa_i].addMainBarSeek = function() { var a = this.id; waPlayer[a].addMainBarCurrentTime(); waPlayer[a].addMainBarTotalTime(); var b = '
'; b += ''; b += '
'; b += '
'; b += '
'; b += '
'; b += '
'; b += '
'; b += '
'; b += '
'; waPlayer[a].write(b); waPlayer[a].addTimeCloud(); waPlayer[a].mainBarMain = document.getElementById('wa_bar_main_' + a); waPlayer[a].mainBarIndicator = document.getElementById('wa_bar_indicator_' + a); waPlayer[a].mainBarBuffered = document.getElementById('wa_bar_buffered_' + a); waPlayer[a].mainBarPlayed = document.getElementById('wa_bar_played_' + a); waPlayer[a].readdMainBarSeek(false) }; waPlayer[wa_i].readdMainBarSeek = function(a) { var b = this.id; var c = waPlayer[b].lastBarLeftElement + 2; var d = waPlayer[b].lastBarRightElement - c; waPlayer[b].seekingBarMaxWidth = d - 20; document.getElementById('wa_bar_' + b).style.width = d + 'px'; document.getElementById('wa_bar_' + b).style.left = c + 'px'; waPlayer[b].mainBarMain.style.width = waPlayer[b].seekingBarMaxWidth + 'px' }; waPlayer[wa_i].addMainBarCurrentTime = function() { var a = this.id; waPlayer[a].write('
00:00
'); waPlayer[a].mainBarCT = document.getElementById('wa_mainBar_ct_' + a); waPlayer[a].readdMainBarCurrentTime() }; waPlayer[wa_i].readdMainBarCurrentTime = function(a) { var b = this.id; if (!waPlayer[b].forceHideTimes && waPlayer[b].playerData.interface.showTimes == 1 && waPlayer[b].width >= 350) { waPlayer[b].mainBarCT.style.display = 'block'; var c = waPlayer[b].lastBarLeftElement + 5; waPlayer[b].mainBarCT.style.left = c + 'px'; waPlayer[b].lastBarLeftElement = 32 + c + 5 } else { waPlayer[b].mainBarCT.style.display = 'none' } waPlayer[b].seekBarStartX = waPlayer[b].lastBarLeftElement }; waPlayer[wa_i].forceHideTimes = false; waPlayer[wa_i].addMainBarTotalTime = function(a) { var b = this.id; waPlayer[b].write('
00:00
'); waPlayer[b].mainBarTT = document.getElementById('wa_mainBar_tt_' + b); waPlayer[b].readdMainBarTotalTime(false) }; waPlayer[wa_i].readdMainBarTotalTime = function(a) { var b = this.id; if (!waPlayer[b].forceHideTimes && waPlayer[b].playerData.interface.showTimes == 1 && waPlayer[b].width >= 350) { waPlayer[b].mainBarTT.style.display = 'block'; var c = waPlayer[b].lastBarRightElement - 35; waPlayer[b].mainBarTT.style.left = c + 'px'; waPlayer[b].lastBarRightElement = c - 5 } else { waPlayer[b].mainBarTT.style.display = 'none' } }; waPlayer[wa_i].addTimeCloud = function() { var a = this.id; var b = ''; waPlayer[a].write(b); waPlayer[a].timeCloud = document.getElementById('wa_timeCloud_' + a); waPlayer[a].timeCloudTime = document.getElementById('wa_timeCloud_Time_' + a); waPlayer[a].reAddTimeCloud() }; waPlayer[wa_i].reAddTimeCloud = function(a) { var b = this.id; if (!a) waPlayer[b].timeCloud.style.zIndex = 170; else waPlayer[b].timeCloud.style.zIndex = 900170 }; waPlayer[wa_i].forceHideSubtitles = false; waPlayer[wa_i].addMainBarSubtitles = function() { var a = this.id; waPlayer[a].write('
'); waPlayer[a].mainBarSubtitles = document.getElementById('wa_mainBar_st_' + a); waPlayer[a].reMainBarSubtitles(false) }; waPlayer[wa_i].reMainBarSubtitles = function(a) { var b = this.id; if (!waPlayer[b].forceHideSubtitles && waPlayer[b].playerData.interface.captions == 1) { waPlayer[b].mainBarSubtitles.style.display = 'block'; var c = 3; var d = waPlayer[b].lastBarRightElement - 19; waPlayer[b].mainBarSubtitles.style.top = c + 'px'; waPlayer[b].mainBarSubtitles.style.left = d + 'px'; if (!a) waPlayer[b].mainBarSubtitles.style.zIndex = 19; else waPlayer[b].mainBarSubtitles.style.zIndex = 900019; waPlayer[b].lastBarRightElement = d - 5 } else { waPlayer[b].mainBarSubtitles.style.display = 'none' } }; waPlayer[wa_i].addMainBarSubtitlesBar = function() { var a = this.id; waPlayer[a].write(''); waPlayer[a].mainBarSubtitlesBar = document.getElementById('wa_mainBar_stbar_' + a); waPlayer[a].reMainBarSubtitlesBar(false) }; waPlayer[wa_i].reMainBarSubtitlesBar = function(a, b) { var c = this.id; waPlayer[c].mainBarSubtitlesBar.style.position = 'absolute'; if (b) { if (waPlayer[c].barDisplayed || !waPlayer[c].playing) waPlayer[c].mainBarSubtitlesBar.style.bottom = '28px'; else waPlayer[c].mainBarSubtitlesBar.style.bottom = '0px' } else waPlayer[c].mainBarSubtitlesBar.style.width = waPlayer[c].width + 'px' }; waPlayer[wa_i].addHub = function() { var a = this.id; var b = '
'; b += '
'; b += '
'; b += ''; b += ''; b += ''; b += ''; b += ''; b += '
'; b += '
'; b += '
'; b += '
'; b += '
'; b += '
'; b += '
'; b += '
'; waPlayer[a].write(b); waPlayer[a].hub = document.getElementById('wa_hub_' + a); waPlayer[a].hubShare = document.getElementById('wa_hub_share_' + a); waPlayer[a].hubShareMain = document.getElementById('wa_hub_share_main_' + a); waPlayer[a].hubLink = document.getElementById('wa_hub_link_' + a); waPlayer[a].hubMail = document.getElementById('wa_hub_mail_' + a); waPlayer[a].hubEmbed = document.getElementById('wa_hub_embed_' + a); waPlayer[a].hubFacebook = document.getElementById('wa_hub_facebook_' + a); waPlayer[a].hubTwitter = document.getElementById('wa_hub_twitter_' + a); waPlayer[a].hub_home = document.getElementById('wa_hub_home_' + a); waPlayer[a].hub_home_button = document.getElementById('wa_hub_home_b_' + a); waPlayer[a].hub_info = document.getElementById('wa_hub_info_' + a); waPlayer[a].hub_info_button = document.getElementById('wa_hub_info_b_' + a); waPlayer[a].readdHub() }; waPlayer[wa_i].setHub = function(a) { var b = this.id; var c = 0; if (waPlayer[b].playerData.interface.link == 1) { waPlayer[b].hubLink.style.display = 'block'; waPlayer[b].hubShareObjects[c] = waPlayer[b].hubLink; waPlayer[b].mouseOutStyle(waPlayer[b].hubLink); c++ } else { waPlayer[b].hubLink.style.display = 'none' } if (waPlayer[b].playerData.interface.mail == 1) { waPlayer[b].hubMail.style.display = 'block'; waPlayer[b].hubShareObjects[c] = waPlayer[b].hubMail; waPlayer[b].mouseOutStyle(waPlayer[b].hubMail); c++ } else { waPlayer[b].hubMail.style.display = 'none' } if (waPlayer[b].playerData.interface.embed == 1 && !waPlayer[b].fromJsObject) { waPlayer[b].hubEmbed.style.display = 'block'; waPlayer[b].hubShareObjects[c] = waPlayer[b].hubEmbed; waPlayer[b].mouseOutStyle(waPlayer[b].hubEmbed); c++ } else { waPlayer[b].hubEmbed.style.display = 'none' } if (waPlayer[b].playerData.interface.facebook == 1) { waPlayer[b].hubFacebook.style.display = 'block'; waPlayer[b].hubShareObjects[c] = waPlayer[b].hubFacebook; waPlayer[b].mouseOutStyle(waPlayer[b].hubFacebook); c++ } else { waPlayer[b].hubFacebook.style.display = 'none' } if (waPlayer[b].playerData.interface.twitter == 1) { waPlayer[b].hubTwitter.style.display = 'block'; waPlayer[b].hubShareObjects[c] = waPlayer[b].hubTwitter; waPlayer[b].mouseOutStyle(waPlayer[b].hubTwitter); c++ } else { waPlayer[b].hubTwitter.style.display = 'none' } if (c == 0 || waPlayer[b].width < 350 || waPlayer[b].height < 210) waPlayer[b].hubShare.style.display = 'none'; else waPlayer[b].hubShare.style.display = 'block'; waPlayer[b].mouseOutStyle(waPlayer[b].hubShareMain); waPlayer[b].mouseOutStyle(waPlayer[b].hub_home_button); waPlayer[b].mouseOutStyle(waPlayer[b].hub_info_button); if (waPlayer[b].playerData.interface.home == 0) waPlayer[b].hub_home.style.display = 'none'; else waPlayer[b].hub_home.style.display = 'block'; if (waPlayer[b].playerData.interface.info == 0 || waPlayer[b].width < 350 || waPlayer[b].height < 210) waPlayer[b].hub_info.style.display = 'none'; else waPlayer[b].hub_info.style.display = 'block' }; waPlayer[wa_i].readdHub = function(a) { var b = this.id; var c = 14; if (waPlayer[b].playerData.interface.showTitle == 1 && waPlayer[b].videoNameObject && waPlayer[b].videoNameObject.style.display == 'block') c = 50; if (!a) { var d = -waPlayer[b].height + c; waPlayer[b].hub.style.marginTop = d + 'px'; waPlayer[b].hub.style.marginLeft = '14px'; waPlayer[b].hub.style.top = 'auto'; waPlayer[b].hub.style.left = 'auto' } else { waPlayer[b].hub.style.marginTop = '0px'; waPlayer[b].hub.style.marginLeft = '0px'; waPlayer[b].hub.style.top = c + 'px'; waPlayer[b].hub.style.left = '14px' } waPlayer[b].setHub(); if (!a) waPlayer[b].hub.style.zIndex = 31; else waPlayer[b].hub.style.zIndex = 900031 }; waPlayer[wa_i].addMenu = function() { var a = this.id; var b = ''; waPlayer[a].write(b); waPlayer[a].menu = document.getElementById('wa_menu_' + a); waPlayer[a].menuReturn = document.getElementById('wa_menu_return_' + a); waPlayer[a].menuContent = document.getElementById('wa_menu_content_' + a); waPlayer[a].thumbDisplayed = true; waPlayer[a].menuLinkInit(); waPlayer[a].menuEmbedInit(); waPlayer[a].menuEmailInit(); waPlayer[a].menuInfoInit(); waPlayer[a].reAddMenu(false) }; waPlayer[wa_i].reAddMenu = function(a) { var b = this.id; waPlayer[b].menu.style.marginLeft = '0px'; var c = 147; var d = (waPlayer[b].width / 2) - (c / 2); waPlayer[b].menuReturn.style.left = d + 'px'; waPlayer[b].menuReturn.style.bottom = '28px'; if (!a) { waPlayer[b].menu.style.width = waPlayer[b].width + 'px'; waPlayer[b].menu.style.height = waPlayer[b].height + 'px'; var f = '-' + waPlayer[b].menu.style.height; waPlayer[b].menu.style.marginTop = f; waPlayer[b].menu.style.left = 'auto'; waPlayer[b].menu.style.top = 'auto'; if (waPlayer[b].width < 350 || waPlayer[b].height < 210) waPlayer[b].hideMenu() } else { waPlayer[b].menu.style.marginTop = '0px'; waPlayer[b].menu.style.left = '0px'; waPlayer[b].menu.style.top = '0px'; waPlayer[b].menu.style.width = '100%'; waPlayer[b].menu.style.height = '100%' } if (!a) waPlayer[b].menu.style.zIndex = 26; else waPlayer[b].menu.style.zIndex = 900026; waPlayer[b].reAddMenuLink(a); waPlayer[b].reAddMenuEmbed(a); waPlayer[b].reAddMenuEmail(a); waPlayer[b].reAddMenuInfo(a) }; waPlayer[wa_i].addMenuLink = function() { var a = this.id; var b = ''; return b }; waPlayer[wa_i].menuLinkInit = function() { var a = this.id; waPlayer[a].menuLink = document.getElementById('wa_menu_link_' + a); waPlayer[a].menuLinkImg = document.getElementById('wa_menu_link_img_' + a); waPlayer[a].menuLinkUrl = document.getElementById('wa_menu_link_url_' + a) }; waPlayer[wa_i].reAddMenuLink = function(a) { var b = this.id; var c = 345; var d = 122; var f = (waPlayer[b].width / 2) - (c / 2); var g = (waPlayer[b].height / 2) - (d / 2); waPlayer[b].menuLink.style.marginTop = Math.round(g) - 10 + 'px'; waPlayer[b].menuLink.style.marginLeft = Math.round(f) + 'px'; if (!a) { waPlayer[b].menuLink.style.zIndex = 27 } else { waPlayer[b].menuLink.style.zIndex = 900027 } }; waPlayer[wa_i].addMenuEmbed = function() { var a = this.id; var b = ''; return b }; waPlayer[wa_i].menuEmbedInit = function() { var a = this.id; waPlayer[a].menuEmbed = document.getElementById('wa_menu_embed_' + a); waPlayer[a].menuEmbedImg = document.getElementById('wa_menu_embed_img_' + a); waPlayer[a].menuEmbedCode = document.getElementById('wa_menu_embed_code_' + a); waPlayer[a].menuEmbedWidth = document.getElementById('wa_menu_embed_width_' + a); waPlayer[a].menuEmbedHeight = document.getElementById('wa_menu_embed_height_' + a) }; waPlayer[wa_i].reAddMenuEmbed = function(a) { var b = this.id; var c = 345; var d = 138; var f = (waPlayer[b].width / 2) - (c / 2); var g = (waPlayer[b].height / 2) - (d / 2); waPlayer[b].menuEmbed.style.marginTop = Math.round(g) - 10 + 'px'; waPlayer[b].menuEmbed.style.marginLeft = Math.round(f) + 'px'; if (!a) { waPlayer[b].menuEmbed.style.zIndex = 27 } else { waPlayer[b].menuEmbed.style.zIndex = 900027 } }; waPlayer[wa_i].addMenuEmail = function() { var a = this.id; var b = ''; return b }; waPlayer[wa_i].menuEmailInit = function() { var a = this.id; waPlayer[a].menuEmail = document.getElementById('wa_menu_email_' + a); waPlayer[a].menuEmailImg = document.getElementById('wa_menu_email_img_' + a); waPlayer[a].menuEmailFrom = document.getElementById('wa_menu_email_from_' + a); waPlayer[a].menuEmailTo = document.getElementById('wa_menu_email_to_' + a); waPlayer[a].menuEmailCom = document.getElementById('wa_menu_email_com_' + a); waPlayer[a].menuEmailSend = document.getElementById('wa_menu_email_6_' + a) }; waPlayer[wa_i].reAddMenuEmail = function(a) { var b = this.id; var c = 345; var d = 195; var f = (waPlayer[b].width / 2) - (c / 2); var g = (waPlayer[b].height / 2) - (d / 2); waPlayer[b].menuEmail.style.marginTop = Math.round(g) - 10 + 'px'; waPlayer[b].menuEmail.style.marginLeft = Math.round(f) + 'px'; if (!a) { waPlayer[b].menuEmail.style.zIndex = 27 } else { waPlayer[b].menuEmail.style.zIndex = 900027 } }; waPlayer[wa_i].addMenuInfo = function() { var a = this.id; var b = ''; return b }; waPlayer[wa_i].menuInfoInit = function() { var a = this.id; waPlayer[a].menuInfo = document.getElementById('wa_menu_info_' + a); waPlayer[a].menuInfoImg = document.getElementById('wa_menu_info_img_' + a) }; waPlayer[wa_i].reAddMenuInfo = function(a) { var b = this.id; var c = 345; var d = 175; var f = (waPlayer[b].width / 2) - (c / 2); var g = (waPlayer[b].height / 2) - (d / 2); waPlayer[b].menuInfo.style.marginTop = Math.round(g) - 10 + 'px'; waPlayer[b].menuInfo.style.marginLeft = Math.round(f) + 'px'; if (!a) { waPlayer[b].menuInfo.style.zIndex = 27 } else { waPlayer[b].menuInfo.style.zIndex = 900027 } }; waPlayer[wa_i].campaignIDstring = ''; waPlayer[wa_i].advertInit = function() { var a = this.id; if (typeof campaignID != 'undefined') { waPlayer[a].campaignIDstring = '&campaignID=' + campaignID; campaignID = undefined } waPlayer[a].addEventListener('playbackProgress', waPlayer[a].advertListener, 'html5'); waPlayer[a].addEventListener('videoStart', waPlayer[a].advertVideoStartE); waPlayer[a].addEventListener('videoStop', waPlayer[a].advertVideoStopE); waPlayer[a].addEventListener('videoStop', waPlayer[a].runSequenceStopEvent); waPlayer[a].addEventListener('advertStop', waPlayer[a].runSequenceStopEvent); waPlayer[a].addEventListener('advertStop', 'waStopLinear', 'flash'); waPlayer[a].addEventListener('advertStart', 'setAdvertModeOn'); waPlayer[a].addEventListener('advertStop', 'setAdvertModeOff') }; waPlayer[wa_i].advertVideoStartE = function(a) { var b = a.playerID; if (waPlayer[b].preroll.active) waPlayer[b].runPreroll() }; waPlayer[wa_i].advertVideoStopE = function(a) { var b = a.playerID; var c = a.videoID; if (waPlayer[b].postroll.active) waPlayer[b].runPostroll() }; waPlayer[wa_i].advertLinearClick = function() { var a = this.id; if (waPlayer[a].preroll.displayed) waPlayer[a].advertClick(waPlayer[a].preroll); else waPlayer[a].advertClick(waPlayer[a].postroll) }; function waStopLinear(a) { waPlayer[a.playerID].advertLinearStop() } function setAdvertModeOn(a) { waPlayer[a.playerID].setAdvertModeON(); if (a.advertType == 'preroll') waPlayer[a.playerID].preroll.displayed = true; else waPlayer[a.playerID].postroll.displayed = true } function setAdvertModeOff(a) { waPlayer[a.playerID].setAdvertModeOFF() } waPlayer[wa_i].advertLinearStop = function() { var a = this.id; if (waPlayer[a].preroll.displayed) waPlayer[a].prerollEnded(); else if (waPlayer[a].postroll.displayed) waPlayer[a].postrollEnded() }; waPlayer[wa_i].resetAdverts = function() { var a = this.id; waPlayer[a].preroll.active = false; waPlayer[a].postroll.active = false; waPlayer[a].overlayimg.active = false; waPlayer[a].overlaytxt.active = false; waPlayer[a].overlaybanner.active = false }; waPlayer[wa_i].checkSize = function() { var a = this.id; if (waPlayer[a].width < 506 || waPlayer[a].height < 150) { if (waPlayer[a].overlaybanner.displayed) { waPlayer[a].stopOverlayBanner(); waPlayer[a].overlayBannerHideShow() } if (waPlayer[a].overlaytxt.displayed) { waPlayer[a].stopOverlayTxt(); waPlayer[a].overlayTxtHideShow() } } }; waPlayer[wa_i].parseAdvertData = function(c, d) { waPlayer[d].resetAdverts(); var f; waPlayer[d].stopOverlayTxt(); waPlayer[d].stopOverlayImg(); waPlayer[d].stopOverlayBanner(); c.find('linearAdverts').find('advert').each(function(b) { f = new Object(); f.active = true; f.displayed = false; f.impressions = new Array(); $(this).find('impressions').find('impression').each(function(a) { f.impressions[a] = $(this).text() }); f.trackingEvents = new Array(); $(this).find('trackingEvents').find('event').each(function(a) { f.trackingEvents[a] = new Array(); f.trackingEvents[a][0] = $(this).attr('type'); f.trackingEvents[a][1] = $(this).text() }); f.clicks = new Array(); $(this).find('clicks').find('clickThrough').each(function(a) { f.clicks[a] = $(this).text() }); temp = new Object; temp.sources = new Array(); $(this).find('sources').find('source').each(function(a) { temp.sources[a] = new Object(); temp.sources[a].type = 'sd'; temp.sources[a].method = 'http'; temp.sources[a].url = $(this).text(); temp.sources[a].mode = waPlayer[d].support(temp.sources[a].url, temp.sources[a].method) }); if ($(this).attr('type') == 'video_preroll') { temp.id = 'preroll'; waPlayer[d].preroll = f } else if ($(this).attr('type') == 'video_postroll') { temp.id = 'postroll'; waPlayer[d].postroll = f } waPlayer[d].addVideo(temp) }); waPlayer[d].videoPrepared('advert'); c.find('nonLinearAdverts').find('advert').each(function(b) { f = new Object(); f.active = true; f.displayed = false; f.appear = $(this).attr('appear'); f.keepFor = $(this).attr('keepFor'); f.impressions = new Array(); $(this).find('impressions').find('impression').each(function(a) { f.impressions[a] = $(this).text() }); f.trackingEvents = new Array(); $(this).find('trackingEvents').find('event').each(function(a) { f.trackingEvents[a] = new Array(); f.trackingEvents[a][0] = $(this).attr('type'); f.trackingEvents[a][1] = $(this).text() }); f.clicks = new Array(); $(this).find('clicks').find('clickThrough').each(function(a) { f.clicks[a] = $(this).text() }); if ($(this).attr('type') == 'text_box') { f.title = $(this).find('content').find('title').text(); f.description = $(this).find('content').find('description').text(); f.link = $(this).find('content').find('link').text(); waPlayer[d].overlaytxt = f; waPlayer[d].prepareOverlayTxt() } else if ($(this).attr('type') == 'pop_up') { f.link = $(this).find('media').text(); waPlayer[d].overlayimg = f; waPlayer[d].prepareOverlayImg() } else if ($(this).attr('type') == 'banner') { f.link = $(this).find('media').text(); waPlayer[d].overlaybanner = f; waPlayer[d].prepareOverlayBanner() } }) }; waPlayer[wa_i].advertTrackingEvent = function(a, b) { var c = this.id; for (var d = 0; d < a.trackingEvents.length; d++) { if (b == a.trackingEvents[d][0]) { $.ajax({ url: a.trackingEvents[d][1], dataType: 'jsonp' }) } } }; waPlayer[wa_i].advertImpression = function(a) { var b = this.id; for (var c = 0; c < a.impressions.length; c++) { $.ajax({ url: a.impressions[c], dataType: 'jsonp' }) } }; waPlayer[wa_i].advertClick = function(a) { var b = this.id; waPlayer[b].pause(); if (a == waPlayer[b].preroll || a == waPlayer[b].postroll) waPlayer[b].unlockPlay(); else if (a == waPlayer[b].overlaytxt) waPlayer[b].stopOverlayTxt(); else if (a == waPlayer[b].overlayimg) waPlayer[b].stopOverlayImg(); else if (a == waPlayer[b].overlaybanner) waPlayer[b].stopOverlayBanner(); waPlayer[b].advertTrackingEvent(a, 'click'); for (var c = 0; c < a.clicks.length; c++) { window.open(a.clicks[c]) } }; waPlayer[wa_i].advertListener = function(a) { var b = a.playerID; var c = a.time; if (!waPlayer[b].advertMode) { if (waPlayer[b].overlaytxt.active) { if (c >= waPlayer[b].videoDuration * (waPlayer[b].overlaytxt.appear / 100)) { waPlayer[b].startOverlayTxt(); waPlayer[b].overlaytxt.active = false } } if (waPlayer[b].overlayimg.active) { if (c >= waPlayer[b].videoDuration * (waPlayer[b].overlayimg.appear / 100)) { waPlayer[b].startOverlayImg(); waPlayer[b].overlayimg.active = false } } if (waPlayer[b].overlaybanner.active) { if (c >= waPlayer[b].videoDuration * (waPlayer[b].overlaybanner.appear / 100)) { waPlayer[b].startOverlayBanner(); waPlayer[b].overlaybanner.active = false } } } else { if (waPlayer[b].mountedVideo.id == 'preroll' || waPlayer[b].mountedVideo.id == 'postroll') waPlayer[b].updateAdvertInfo(waPlayer[b].videoDuration - c) } }; waPlayer[wa_i].runSequenceStopEvent = function(a) { var b = a.playerID; if ((typeof a.advertType == "undefined" || a.advertType == 'postroll') && !waPlayer[b].postroll.active && (!waPlayer[b].postroll.displayed || a.advertType == 'postroll')) { waPlayer[b].videoSequenceStopEvent(waPlayer[b].mountedVideo.id) } }; waPlayer[wa_i].setAdvertModeON = function() { var a = this.id; waPlayer[a].hub.style.display = 'none'; waPlayer[a].advertMode = true; waPlayer[a].lockPlay(); waPlayer[a].forceHideTimes = true; waPlayer[a].reMainBarElements(waPlayer[a].fullScreenMode) }; waPlayer[wa_i].setAdvertModeOFF = function() { var a = this.id; waPlayer[a].advertMode = false; waPlayer[a].unlockPlay(); waPlayer[a].forceHideTimes = false; waPlayer[a].reMainBarElements(waPlayer[a].fullScreenMode) }; waPlayer[wa_i].addAdvertInfo = function() { var a = this.id; waPlayer[a].write(''); waPlayer[a].advertInfoObj = document.getElementById('wa_player_advi_' + a); waPlayer[a].reAddAdvertInfo(false) }; waPlayer[wa_i].reAddAdvertInfo = function(a) { var b = this.id; if (waPlayer[b].advertInfoObj) { waPlayer[b].advertInfoObj.style.width = (waPlayer[b].width - 18) + 'px'; if (!a) { var c = -waPlayer[b].height; waPlayer[b].advertInfoObj.style.marginLeft = '0px'; waPlayer[b].advertInfoObj.style.marginTop = c + 'px'; waPlayer[b].advertInfoObj.style.left = 'auto'; waPlayer[b].advertInfoObj.style.top = 'auto'; waPlayer[b].advertInfoObj.style.zIndex = 27 } else { waPlayer[b].advertInfoObj.style.marginLeft = '0px'; waPlayer[b].advertInfoObj.style.marginTop = '0px'; waPlayer[b].advertInfoObj.style.left = '0px'; waPlayer[b].advertInfoObj.style.top = '0px'; waPlayer[b].advertInfoObj.style.zIndex = 900027 } } }; waPlayer[wa_i].updateAdvertInfo = function(a) { var b = this.id; a = Math.round(a); waPlayer[b].advertInfoObj.innerHTML = waPlayer[b].getLang('playerStates', 'Adertisement') + ': ' + a }; waPlayer[wa_i].showAdvertInfo = function() { var a = this.id; waPlayer[a].advertInfoObj.style.display = 'block' }; waPlayer[wa_i].hideAdvertInfo = function() { var a = this.id; waPlayer[a].advertInfoObj.style.display = 'none'; waPlayer[a].advertInfoObj.innerHTML = '' }; waPlayer[wa_i].preroll = new Object(); waPlayer[wa_i].preroll.displayed = false; waPlayer[wa_i].preroll.active = false; waPlayer[wa_i].preroll.impressions = new Array(); waPlayer[wa_i].preroll.trackingEvents = new Array(); waPlayer[wa_i].preroll.clicks = new Array(); waPlayer[wa_i].runPreroll = function() { var a = this.id; waPlayer[a].preroll.active = false; waPlayer[a].preroll.displayed = true; waPlayer[a].runVideo(waPlayer[a].getVideo('preroll'), 1); waPlayer[a].advertImpression(waPlayer[a].preroll); waPlayer[a].showAdvertInfo(); waPlayer[a].advertStartEvent('preroll') }; waPlayer[wa_i].prerollEnded = function() { var a = this.id; waPlayer[a].preroll.displayed = false; waPlayer[a].preroll.active = false; waPlayer[a].hideAdvertInfo(); waPlayer[a].advertStopEvent('preroll') waPlayer[a].runVideo(waPlayer[a].mountedVideoContent, 1) }; waPlayer[wa_i].postroll = new Object(); waPlayer[wa_i].postroll.displayed = false; waPlayer[wa_i].postroll.active = false; waPlayer[wa_i].postroll.impressions = new Array(); waPlayer[wa_i].postroll.trackingEvents = new Array(); waPlayer[wa_i].postroll.clicks = new Array(); waPlayer[wa_i].postrollTimeLeft = -1; waPlayer[wa_i].runPostroll = function() { var a = this.id; waPlayer[a].overlayTxtHideShow(); waPlayer[a].overlayBannerHideShow(); waPlayer[a].postroll.active = false; waPlayer[a].postroll.displayed = true; waPlayer[a].runVideo(waPlayer[a].getVideo('postroll'), 1); waPlayer[a].showAdvertInfo(); waPlayer[a].advertImpression(waPlayer[a].postroll); waPlayer[a].advertStartEvent('postroll') }; waPlayer[wa_i].postrollEnded = function() { var a = this.id; waPlayer[a].postroll.displayed = false; waPlayer[a].postroll.active = false; waPlayer[a].advertStopEvent('postroll'); waPlayer[a].hideAdvertInfo() waPlayer[a].runVideo(waPlayer[a].mountedVideoContent, 0) }; waPlayer[wa_i].overlaytxt = new Object(); waPlayer[wa_i].overlaytxt.displayed = false; waPlayer[wa_i].overlaytxt.active = false; waPlayer[wa_i].overlaytxt.impressions = new Array(); waPlayer[wa_i].overlaytxt.trackingEvents = new Array(); waPlayer[wa_i].overlaytxt.clicks = new Array(); waPlayer[wa_i].overlaytxt.title = ''; waPlayer[wa_i].overlaytxt.description = ''; waPlayer[wa_i].overlaytxt.link = ''; waPlayer[wa_i].overlaytxt.appear = 0; waPlayer[wa_i].overlaytxt.keepFor = 0; waPlayer[wa_i].overlaytxtObj = new Object(); waPlayer[wa_i].overlaytxtObj.main; waPlayer[wa_i].overlaytxtObj.title; waPlayer[wa_i].overlaytxtObj.desc; waPlayer[wa_i].overlaytxtObj.link; waPlayer[wa_i].overlaytxtObj.showButtonDisplayed = false; waPlayer[wa_i].addAdvertOverlayTxt = function() { var a = this.id; var b = ''; waPlayer[a].write(b); b = ''; waPlayer[a].write(b); waPlayer[a].overlaytxtObj.main = document.getElementById('wa_player_ot_' + a); waPlayer[a].overlaytxtObj.show = document.getElementById('wa_player_otre_' + a); waPlayer[a].overlaytxtObj.container = document.getElementById('wa_player_otb_' + a); waPlayer[a].overlaytxtObj.title = document.getElementById('wa_player_ot_' + a + '_2'); waPlayer[a].overlaytxtObj.desc = document.getElementById('wa_player_ot_' + a + '_0'); waPlayer[a].overlaytxtObj.link = document.getElementById('wa_player_ot_' + a + '_3'); waPlayer[a].readdAdvertOverlayTxt() }; waPlayer[wa_i].readdAdvertOverlayTxt = function(a) { var b = this.id; if (waPlayer[b].overlaytxtObj.main) { var c = 13; if (waPlayer[b].barDisplayed || !waPlayer[b].playing) c = -15; var d = 25; var f = (waPlayer[b].width / 2) - (d / 2); waPlayer[b].overlaytxtObj.show.style.marginLeft = f + 'px'; waPlayer[b].overlaytxtObj.show.style.marginTop = c + 'px'; if (!a) { var g = -46; if (waPlayer[b].barDisplayed || !waPlayer[b].playing) g -= 28; waPlayer[b].overlaytxtObj.main.style.width = waPlayer[b].width + 'px'; waPlayer[b].overlaytxtObj.main.style.marginTop = g + 'px'; waPlayer[b].overlaytxtObj.main.style.marginLeft = '0px'; waPlayer[b].overlaytxtObj.main.style.left = 'auto'; waPlayer[b].overlaytxtObj.main.style.bottom = 'auto' } else { var j = 0; waPlayer[b].overlaytxtObj.main.style.width = '100%'; if (waPlayer[b].barDisplayed || !waPlayer[b].playing) j = 28; waPlayer[b].overlaytxtObj.main.style.marginTop = '40px'; waPlayer[b].overlaytxtObj.main.style.bottom = j + 'px'; waPlayer[b].overlaytxtObj.main.style.left = '0px' } var h = 392; if (waPlayer[b].width < 392) h = 280; waPlayer[b].overlaytxtObj.container.style.width = h + 'px'; var k = Math.round((waPlayer[b].width / 2) - (h / 2)); waPlayer[b].overlaytxtObj.container.style.marginLeft = k + 'px'; if (!a) { waPlayer[b].overlaytxtObj.main.style.zIndex = 32; waPlayer[b].overlaytxtObj.show.style.zIndex = 20 } else { waPlayer[b].overlaytxtObj.main.style.zIndex = 900032; waPlayer[b].overlaytxtObj.show.style.zIndex = 900020 } } }; waPlayer[wa_i].overlayTxtDisplayShow = function() { var a = this.id; waPlayer[a].overlaytxtObj.show.style.display = 'block'; waPlayer[a].overlaytxtObj.showButtonDisplayed = true }; waPlayer[wa_i].overlayTxtHideShow = function() { var a = this.id; waPlayer[a].overlaytxtObj.show.style.display = 'none'; waPlayer[a].overlaytxtObj.showButtonDisplayed = false }; waPlayer[wa_i].prepareOverlayTxt = function() { var a = this.id; waPlayer[a].overlayTxtHideShow(); waPlayer[a].overlaytxtObj.title.innerHTML = '' + waPlayer[a].overlaytxt.title + ''; waPlayer[a].overlaytxtObj.desc.innerHTML = '' + waPlayer[a].overlaytxt.description + ''; waPlayer[a].overlaytxtObj.link.innerHTML = '' + waPlayer[a].overlaytxt.link + ''; waPlayer[a].addEventListener('videoStop', function() { waPlayer[a].stopOverlayTxt(); waPlayer[a].overlayTxtHideShow() }, 'html5') }; waPlayer[wa_i].startOverlayTxt = function(a) { var b = this.id; if (waPlayer[b].width >= 506 && waPlayer[b].height >= 150) { waPlayer[b].overlayBannerHideShow(); if (!a) waPlayer[b].advertImpression(waPlayer[b].overlaytxt); waPlayer[b].overlaytxtObj.main.style.display = 'block'; waPlayer[b].overlaytxt.displayed = true; if (!a) setTimeout("waPlayer[" + b + "].stopOverlayTxt();", waPlayer[b].overlaytxt.keepFor * 1000) } }; waPlayer[wa_i].stopOverlayTxt = function() { var a = this.id; if (waPlayer[a].overlaytxt.displayed) { waPlayer[a].overlayTxtDisplayShow(); waPlayer[a].overlaytxtObj.main.style.display = 'none'; waPlayer[a].overlaytxt.displayed = false } }; waPlayer[wa_i].overlayimg = new Object(); waPlayer[wa_i].overlayimg.displayed = false; waPlayer[wa_i].overlayimg.active = false; waPlayer[wa_i].overlayimg.impressions = new Array(); waPlayer[wa_i].overlayimg.trackingEvents = new Array(); waPlayer[wa_i].overlayimg.clicks = new Array(); waPlayer[wa_i].overlayimg.link = ''; waPlayer[wa_i].overlayimg.appear = 0; waPlayer[wa_i].overlayimg.keepFor = 0; waPlayer[wa_i].overlayimgObj = new Object(); waPlayer[wa_i].overlayimgObj.main; waPlayer[wa_i].overlayimgObj.img; waPlayer[wa_i].overlayimgObj.link; waPlayer[wa_i].overlayimgObj.width; waPlayer[wa_i].overlayimgObj.height; waPlayer[wa_i].overlayimgObj.changedWidth = false; waPlayer[wa_i].overlayimgObj.changedHeight = false; waPlayer[wa_i].addAdvertOverlayImg = function() { var a = this.id; var b = ''; waPlayer[a].write(b); waPlayer[a].overlayimgObj.bg = document.getElementById('wa_player_oibg_' + a); waPlayer[a].overlayimgObj.close = document.getElementById('wa_player_oi_' + a + '_4'); waPlayer[a].overlayimgObj.main = document.getElementById('wa_player_oi_' + a); waPlayer[a].overlayimgObj.img = document.getElementById('wa_player_oi_' + a + '_6'); waPlayer[a].overlayimgObj.link = document.getElementById('wa_player_oi_' + a + '_5'); waPlayer[a].readdAdvertOverlayImg(false) }; waPlayer[wa_i].readdAdvertOverlayImg = function(a) { var b = this.id; if (waPlayer[b].overlayimg) { if (!waPlayer[b].overlayimgObj.width) waPlayer[b].overlayimgObj.width = waPlayer[b].overlayimgObj.img.width; if (!waPlayer[b].overlayimgObj.height) waPlayer[b].overlayimgObj.height = waPlayer[b].overlayimgObj.img.height; if (waPlayer[b].overlayimgObj.changedWidth) waPlayer[b].overlayimgObj.img.width = waPlayer[b].overlayimgObj.width; if (waPlayer[b].overlayimgObj.changedHeight) waPlayer[b].overlayimgObj.img.height = waPlayer[b].overlayimgObj.height; if (waPlayer[b].overlayimgObj.img.width > (waPlayer[b].width - 50)) { waPlayer[b].overlayimgObj.changedWidth = true; waPlayer[b].overlayimgObj.img.width -= (waPlayer[b].overlayimgObj.img.width - waPlayer[b].width + 70) } if (waPlayer[b].overlayimgObj.img.height > (waPlayer[b].height - 50)) { waPlayer[b].overlayimgObj.changedHeight = true; waPlayer[b].overlayimgObj.img.height -= (waPlayer[b].overlayimgObj.img.height - waPlayer[b].height + 70) } waPlayer[b].overlayimgObj.main.style.width = waPlayer[b].overlayimgObj.img.width + 'px'; if (!a) { waPlayer[b].overlayimgObj.bg.style.width = waPlayer[b].width + 'px'; waPlayer[b].overlayimgObj.bg.style.height = waPlayer[b].height + 'px'; waPlayer[b].overlayimgObj.bg.style.marginTop = '-' + waPlayer[b].overlayimgObj.bg.style.height; waPlayer[b].overlayimgObj.bg.style.left = 'auto'; waPlayer[b].overlayimgObj.bg.style.top = 'auto' } else { waPlayer[b].overlayimgObj.bg.style.marginTop = '0px'; waPlayer[b].overlayimgObj.bg.style.left = '0px'; waPlayer[b].overlayimgObj.bg.style.top = '0px'; waPlayer[b].overlayimgObj.bg.style.width = '100%'; waPlayer[b].overlayimgObj.bg.style.height = '100%' } var c = Math.round(((waPlayer[b].height / 2) - (waPlayer[b].overlayimgObj.img.height / 2)) - 33); var d = Math.round((waPlayer[b].width / 2) - (waPlayer[b].overlayimgObj.img.width / 2)); waPlayer[b].overlayimgObj.main.style.marginTop = c + 'px'; waPlayer[b].overlayimgObj.main.style.marginLeft = d + 'px'; waPlayer[b].overlayimgObj.close.style.marginLeft = (waPlayer[b].overlayimgObj.img.width - 17) + 'px'; if (!a) waPlayer[b].overlayimgObj.bg.style.zIndex = 26; else waPlayer[b].overlayimgObj.bg.style.zIndex = 900026 } }; waPlayer[wa_i].prepareOverlayImg = function() { var a = this.id; waPlayer[a].overlayimgObj.img.src = waPlayer[a].overlayimg.link; waPlayer[a].imageExists(waPlayer[a].overlayimg.link); waPlayer[a].overlayimgObj.img.onclick = function() { waPlayer[a].advertClick(waPlayer[a].overlayimg) }; waPlayer[a].addEventListener('videoStop', function() { waPlayer[a].stopOverlayImg() }, 'html5') }; waPlayer[wa_i].startOverlayImg = function() { var a = this.id; waPlayer[a].advertImpression(waPlayer[a].overlayimg); waPlayer[a].overlayimgObj.bg.style.display = 'block'; waPlayer[a].overlayimgObj.img.style.visibility = "hidden"; waPlayer[a].overlayimg.displayed = true; setTimeout("waPlayer[" + a + "].readdAdvertOverlayImg(" + waPlayer[a].fullScreenMode + ");waPlayer[" + a + "].overlayimgObj.img.style.visibility = 'visible';", 100); setTimeout("waPlayer[" + a + "].stopOverlayImg();", waPlayer[a].overlayimg.keepFor * 1000) }; waPlayer[wa_i].stopOverlayImg = function() { var a = this.id; if (waPlayer[a].overlayimg.displayed) { waPlayer[a].overlayimgObj.bg.style.display = 'none'; waPlayer[a].overlayimg.displayed = false } }; waPlayer[wa_i].overlaybanner = new Object(); waPlayer[wa_i].overlaybanner.displayed = false; waPlayer[wa_i].overlaybanner.active = false; waPlayer[wa_i].overlaybanner.impressions = new Array(); waPlayer[wa_i].overlaybanner.trackingEvents = new Array(); waPlayer[wa_i].overlaybanner.clicks = new Array(); waPlayer[wa_i].overlaybanner.title = ''; waPlayer[wa_i].overlaybanner.link = ''; waPlayer[wa_i].overlaybanner.appear = 0; waPlayer[wa_i].overlaybanner.keepFor = 0; waPlayer[wa_i].overlaybannerObj = new Object(); waPlayer[wa_i].overlaybannerObj.main; waPlayer[wa_i].overlaybannerObj.img; waPlayer[wa_i].overlaybannerObj.showButtonDisplayed = false; waPlayer[wa_i].addAdvertOverlayBanner = function() { var a = this.id; var b = ''; waPlayer[a].write(b); b = ''; waPlayer[a].write(b); waPlayer[a].overlaybannerObj.main = document.getElementById('wa_player_obt_' + a); waPlayer[a].overlaybannerObj.show = document.getElementById('wa_player_obtre_' + a); waPlayer[a].overlaybannerObj.container = document.getElementById('wa_player_obtb_' + a); waPlayer[a].overlaybannerObj.img = document.getElementById('wa_player_obt_' + a + '_0'); waPlayer[a].readdAdvertOverlayBanner(false) }; waPlayer[wa_i].readdAdvertOverlayBanner = function(a) { var b = this.id; if (waPlayer[b].overlaybannerObj.main) { var c = 13; if (waPlayer[b].barDisplayed || !waPlayer[b].playing) c = -15; var d = 25; var f = (waPlayer[b].width / 2) - (d / 2); waPlayer[b].overlaybannerObj.show.style.marginLeft = f + 'px'; waPlayer[b].overlaybannerObj.show.style.marginTop = c + 'px'; if (!a) { var g = -46; if (waPlayer[b].barDisplayed || !waPlayer[b].playing) g -= 28; waPlayer[b].overlaybannerObj.main.style.width = waPlayer[b].width + 'px'; waPlayer[b].overlaybannerObj.main.style.marginTop = g + 'px'; waPlayer[b].overlaybannerObj.main.style.marginLeft = '0px'; waPlayer[b].overlaybannerObj.main.style.left = 'auto'; waPlayer[b].overlaybannerObj.main.style.bottom = 'auto' } else { var j = 0; waPlayer[b].overlaybannerObj.main.style.width = '100%'; if (waPlayer[b].barDisplayed || !waPlayer[b].playing) j = 28; waPlayer[b].overlaybannerObj.main.style.marginTop = '40px'; waPlayer[b].overlaybannerObj.main.style.bottom = j + 'px'; waPlayer[b].overlaybannerObj.main.style.left = '0px' } if (!a) { waPlayer[b].overlaybannerObj.main.style.zIndex = 33; waPlayer[b].overlaybannerObj.show.style.zIndex = 20 } else { waPlayer[b].overlaybannerObj.main.style.zIndex = 900033; waPlayer[b].overlaybannerObj.show.style.zIndex = 900020 } } }; waPlayer[wa_i].overlayBannerDisplayShow = function() { var a = this.id; waPlayer[a].overlaybannerObj.show.style.display = 'block'; waPlayer[a].overlaybannerObj.showButtonDisplayed = true }; waPlayer[wa_i].overlayBannerHideShow = function() { var a = this.id; waPlayer[a].overlaybannerObj.show.style.display = 'none'; waPlayer[a].overlaybannerObj.showButtonDisplayed = false }; waPlayer[wa_i].prepareOverlayBanner = function() { var a = this.id; waPlayer[a].overlayBannerHideShow(); waPlayer[a].overlaybannerObj.img.src = waPlayer[a].overlaybanner.link; waPlayer[a].imageExists(waPlayer[a].overlaybanner.link); waPlayer[a].overlaybannerObj.img.onclick = function() { waPlayer[a].advertClick(waPlayer[a].overlaybanner) }; waPlayer[a].addEventListener('videoStop', function() { waPlayer[a].stopOverlayBanner(); waPlayer[a].overlayBannerHideShow() }, 'html5') }; waPlayer[wa_i].startOverlayBanner = function(a) { var b = this.id; if (waPlayer[b].width >= 506 && waPlayer[b].height >= 150) { waPlayer[b].overlayBannerHideShow(); if (!a) waPlayer[b].advertImpression(waPlayer[b].overlaybanner); waPlayer[b].overlaybannerObj.main.style.display = 'block'; waPlayer[b].overlaybanner.displayed = true; if (!a) setTimeout("waPlayer[" + b + "].stopOverlayBanner();", waPlayer[b].overlaybanner.keepFor * 1000) } }; waPlayer[wa_i].stopOverlayBanner = function() { var a = this.id; if (waPlayer[a].overlaybanner.displayed) { waPlayer[a].overlayBannerDisplayShow(); waPlayer[a].overlaybannerObj.main.style.display = 'none'; waPlayer[a].overlaybanner.displayed = false } }; waPlayer[wa_i].write = function(a) { var b = this.id; document.write(a) }; waPlayer[wa_i].asTime = function(a) { var b = this.id; a = Math.round(a); var c = a % 60; var d = Math.floor(a / 60); return waPlayer[b].addZero(d) + ':' + waPlayer[b].addZero(c) }; waPlayer[wa_i].addZero = function(a) { a += ""; if (a.length < 2) a = "0" + a; return a }; waPlayer[wa_i].removePX = function(a) { return a.replace('px', '') }; waPlayer[wa_i].getOffsetX = function(a) { var b = $("#" + a.id).offset(); return b.left }; waPlayer[wa_i].fade = function(a, b) { var c = this.id; var d = document.getElementById(a); if (d == null) return; if (b) d.style.display = 'block'; else d.style.display = 'none' }; waPlayer[wa_i].getOffsetY = function(a) { var b = $("#" + a.id).offset(); return b.top }; waPlayer[wa_i].start()