function update_cookie(name, value) { var cookie = get_cookie(name); if (cookie === undefined) { document.cookie = name+'='+value+'; path=/'; } else { var values = cookie.split(','); if (values.indexOf(value) 9) ? month : '0'+month; day = (day > 9) ? day : '0'+day; hours = (hours > 9) ? hours : '0'+hours; minutes = (minutes > 9) ? minutes : '0'+minutes; seconds = (seconds > 9) ? seconds : '0'+seconds;
return year+'-'+month+'-'+day+'T'+hours+':'+minutes+':'+seconds+'.'+milliseconds; }, video_event: function(event, value) { var query = 'ev='+event+'&va='+value+'&ai='+this.meta.page_id+'&hid='+this.meta.host_id+'&sid='+this.meta.sponsor_id+'&si='+this.meta.site_id+'&ti='+this.timestamp(); var script;
this.queue.push(query); this.process_queue(); }, process_queue: function() { if (typeof webuser !== 'undefined') { for (var i in this.queue) { script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); script.setAttribute('src', this.url+this.queue[i]+'&u='+webuser.uuid+'&e='+(webuser.email || '')); this.head.appendChild(script); } this.queue = []; } } };
var engagement = { start: 0, cycle: 1000, score: 1, timer: 0, partial: function() { return (((new Date().getTime() - this.start) % this.cycle) / this.cycle) * this.score; } };
if (typeof myPlayer !== 'undefined') {
myPlayer.ready(function() { update_cookie('napvideo', video_data.id); wsd.video_event('impression', 1); });
myPlayer.one('playing', function() { if (myPlayer.mediainfo.duration