(function(){var q=/iPad|iPhone|iPod/,r=/BlackBerry/,k=KV.serverPath+"/posterFrame.gsp",l=KV.serverPath+"/mp4Video.gsp",s=KV.serverPath+"/viewStats.gsp",h=KV.clientPath+"/graphics/spacer.gif",m=KV.clientPath+"/custom-graphics/player/play-icon.png",n=KV.clientPath+"/custom-graphics/player/play-icon-hover.png",t=KV.clientPath+"/custom-graphics/player/loading_background.png",u=KV.clientPath+"/custom-graphics/player/loading_animation.gif",y=function(a){var c=k+"?pguid="+a.pguid,b=a.width||document.body.clientWidth,
d=a.height||document.body.clientHeight,e=['<div id="loadingMessage" style="height: ',d,"px; width: ",b,'px; margin: 0 auto; position: relative; cursor: pointer; background: black;"><img id="thumbnail" src="',c,'" style="position: absolute; display: none;"  /><img id="play-icon" src="',h,'" style="position: absolute; left: ',Math.round((b-72)/2),"px; top: ",Math.round((d-72)/2),'px; width: 72px; height: 72px;"  /><img id="loading-icon" src="',h,'" style="position: absolute; left: ',Math.round((b-72)/
2),"px; top: ",Math.round((d-72)/2),'px; width: 72px; height: 72px; display: none;"  /><img id="loading-animation" src="',u,'" style="position: absolute; left: ',Math.round((b-72)/2),"px; top: ",Math.round((d-72)/2),'px; display: none;"  /></div>'].join("");if(navigator.userAgent.match("/Chrome/"))document.body.style.overflow="hidden";document.body.innerHTML=e;v();w(a);x(c,function(a){var c=0,e=0,g=b,f=d,c=a.height/a.width,f=Math.round(g*c);f>d&&(f=d,g=Math.round(f/c));c=Math.round((b-g)/2);e=Math.round((d-
f)/2);a=document.getElementById("thumbnail");a.style.left=c+"px";a.style.top=e+"px";a.style.width=g+"px";a.style.height=f+"px";a.style.display="block"});KV.lightweight=!0},v=function(){(new Image).src=n;var a=document.getElementById("play-icon");e(a,m);a=document.getElementById("loading-icon");e(a,t)},w=function(a){var c=document.getElementById("play-icon"),b=document.getElementById("loadingMessage");b.onmouseover=function(){e(c,n)};b.onmouseout=function(){e(c,m)};b.onclick=function(){b.onclick=null;
z(a)};window.onbeforeunload=i;window.onunload=i},o=!1,i=function(){if(!o){var a=0,c=100,b=document.getElementById("html5video");if(b)a=b.currentTime,c=b.duration;a=Math.max(0,Math.min(100,Math.round(a/c*100)))||0;a=s+"?pg="+qs.pguid+"&pv="+a+"&cacheKiller="+(new Date).getTime();if(c=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"))c.open("GET",a,!1),c.send(null);o=!0}},z=function(){if(navigator.userAgent.match("/Chrome/"))document.body.style.overflow="auto";navigator.userAgent.match(r)?
window.top.location=l+"?pguid="+qs.pguid:navigator.userAgent.match(q)?A(qs):(window.onbeforeunload=null,window.onunload=null,document.getElementById("play-icon").style.display="none",document.getElementById("loading-icon").style.display="block",document.getElementById("loading-animation").style.display="block",setTimeout(function(){p()},0))},A=function(a){document.body.innerHTML='<video id="html5video" style="width: '+(a.width||document.body.clientWidth)+"px; height: "+(a.height||document.body.clientHeight)+
'px; margin: 0 auto; display: block; background: black;" controls poster="'+(k+"?pguid="+a.pguid)+'" src="'+(l+"?pguid="+a.pguid)+'"></video>';a=document.getElementById("html5video");a.addEventListener("ended",i,!1);a.play()},p=function(){j(KV.preload,function(){j(KV.application,function(){j(KV.properties,function(){if(typeof Application!=="undefined")KV.defer(function(){AppProperties.OmitRootControl=!0;Application.run(new PlayerUI(AppProperties.PlayerControlName))}),window.onunload=function(){typeof Application!==
"undefined"&&Application.cleanup()}})})})},j=function(a,c){var b=document.createElement("script");b.type="text/javascript";b.readyState?b.onreadystatechange=function(){if(b.readyState=="loaded"||b.readyState=="complete")b.onreadystatechange=null,c()}:b.onload=function(){c()};b.src=a;document.getElementsByTagName("head")[0].appendChild(b)},e=function(a,c){/MSIE 6/.test(navigator.userAgent)?(a.src=h,a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c+"',sizingMethod='scale')"):
a.src=c},x=function(a,c){var b=new Image;b.onload=function(){c(b)};b.src=a};qs=function(a){for(var c={},a=a.split("&"),b=0;b<a.length;b++){var d=a[b].split("=");c[d[0]]=d[1]}return c}(location.search.substring(1));if(qs.lightweight==="true")y(qs);else{if(qs.kiosk!=="true")qs.textload?document.getElementById("loadingMessageContent").innerHTML='<span class="message">Loading...</span>':document.getElementById("loadingImage").style.display="inline";p()}})();

