var motionLineCoordinates=null,motionLineDelay=0,timeoutId=null,g_resolution=null; function refreshPosition(){var a=getCurrentTime();if(null!=a&&void 0!=g_Comm&&null!=g_Comm&&null!=motionLineCoordinates&&0<motionLineCoordinates.length){var g=a%1,c=a-g+motionLineDelay,h=c+1,d=a=null;if(motionLineCoordinates.length>c&&0<=c){var e=motionLineCoordinates[c],b=motionLineCoordinates[h],f=g/(h-c),a=(b.lat-e.lat)*f,d=(b.lng-e.lng)*f,f=document.getElementById("speedDiv"),a=e.lat+a,d=e.lng+d;null!=f&&(e=new GLatLng(e.lat,e.lng),b=new GLatLng(b.lat,b.lng),b=e.distanceFrom(b),b=Math.round(3600* (b/1E3)),f.innerHTML=b)}else 0>c&&0<motionLineCoordinates.length&&(b=motionLineCoordinates[0],a=b.lat,d=b.lng,null!=f&&(f.innerHTML="0"));null!=a&&null!=d&&(g_Comm.ShowPositionArrow(a,d),null!=g_GPSVideoOverlay&&null!=g_Comm?g_Comm.PanMapIfPointOutOfSight(a,d,!1,g_GPSVideoOverlay.getBounds()):g_Comm.PanMapIfPointOutOfSight(a,d,!0));500>g_resolution&&11>g_Comm.getZoom()&&g_Comm.setZoom(15)}} function onFlashPlayerClose(){stopGPSPositioning();try{null!=ytplayer&&ytplayer.stopVideo()}catch(a){}try{null!=$f&&($f().stop(),$f().unload())}catch(g){}try{null!=vimeoPlayer&&vimeoPlayer.api_unload()}catch(c){}}function getCurrentTime(){var a=null;try{null!=ytplayer&&(a=ytplayer.getCurrentTime())}catch(g){}if(null==a)try{null!=$f&&(a=$f().getTime())}catch(c){}try{null!=vimeoPlayer&&(a=vimeoPlayer.api_getCurrentTime())}catch(h){}return a} function startGPSPositioning(a){stopGPSPositioning();g_resolution=a;timeoutId=setInterval(refreshPosition,a)}function stopGPSPositioning(){if(null!=timeoutId){clearInterval(timeoutId);try{g_Comm.HidePositionArrow(!0)}catch(a){}}}jQuery(window).unload(function(){clearInterval(timeoutId)});
