function inherits(t,e){function i(){}i.prototype=e.prototype,t.superClass_=e.prototype,t.prototype=new i,t.prototype.constructor=t}function MarkerLabel_(t,e,i){this.marker_=t,this.handCursorURL_=t.handCursorURL,this.labelDiv_=document.createElement("div"),this.labelDiv_.style.cssText="position: absolute; overflow: hidden;",this.eventDiv_=document.createElement("div"),this.eventDiv_.style.cssText=this.labelDiv_.style.cssText,this.eventDiv_.setAttribute("onselectstart","return false;"),this.eventDiv_.setAttribute("ondragstart","return false;"),this.crossDiv_=MarkerLabel_.getSharedCross(e)}function MarkerWithLabel(t){(t=t||{}).labelContent=t.labelContent||"",t.labelAnchor=t.labelAnchor||new google.maps.Point(0,0),t.labelClass=t.labelClass||"markerLabels",t.labelStyle=t.labelStyle||{},t.labelInBackground=t.labelInBackground||!1,void 0===t.labelVisible&&(t.labelVisible=!0),void 0===t.raiseOnDrag&&(t.raiseOnDrag=!0),void 0===t.clickable&&(t.clickable=!0),void 0===t.draggable&&(t.draggable=!1),void 0===t.optimized&&(t.optimized=!1),t.crossImage=t.crossImage||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png",t.handCursor=t.handCursor||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur",t.optimized=!1,this.label=new MarkerLabel_(this,t.crossImage,t.handCursor),google.maps.Marker.apply(this,arguments)}function MikaResultsBoard(){}function moveAlongPath(t,e,i){if((i=i||0)a.lng()&&(r="w");var n=google.maps.geometry.spherical.computeOffset(s,e,google.maps.geometry.spherical.computeHeading(s,a));return n.direction=r,n}return moveAlongPath(t,e-o,i+1)}return null}function ClusterIcon(t,e){t.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView),this.cluster_=t,this.className_=t.getMarkerClusterer().getClusterClass(),this.styles_=e,this.center_=null,this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(t.getMap())}function Cluster(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinimumClusterSize(),this.averageCenter_=t.getAverageCenter(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new ClusterIcon(this,t.getStyles())}function MarkerClusterer(t,e,i){this.extend(MarkerClusterer,google.maps.OverlayView),e=e||[],i=i||{},this.markers_=[],this.clusters_=[],this.listeners_=[],this.activeMap_=null,this.ready_=!1,this.gridSize_=i.gridSize||60,this.minClusterSize_=i.minimumClusterSize||2,this.maxZoom_=i.maxZoom||null,this.styles_=i.styles||[],this.title_=i.title||"",this.zoomOnClick_=!0,void 0!==i.zoomOnClick&&(this.zoomOnClick_=i.zoomOnClick),this.averageCenter_=!1,void 0!==i.averageCenter&&(this.averageCenter_=i.averageCenter),this.ignoreHidden_=!1,void 0!==i.ignoreHidden&&(this.ignoreHidden_=i.ignoreHidden),this.enableRetinaIcons_=!1,void 0!==i.enableRetinaIcons&&(this.enableRetinaIcons_=i.enableRetinaIcons),this.imagePath_=i.imagePath||MarkerClusterer.IMAGE_PATH,this.imageExtension_=i.imageExtension||MarkerClusterer.IMAGE_EXTENSION,this.imageSizes_=i.imageSizes||MarkerClusterer.IMAGE_SIZES,this.calculator_=i.calculator||MarkerClusterer.CALCULATOR,this.batchSize_=i.batchSize||MarkerClusterer.BATCH_SIZE,this.batchSizeIE_=i.batchSizeIE||MarkerClusterer.BATCH_SIZE_IE,this.clusterClass_=i.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize_=this.batchSizeIE_),this.setupStyles_(),this.addMarkers(e,!0),this.setMap(t)}function MikaResultsRenderTrigger(){"undefined"!=typeof require&&require(["Mika/Mika"],function(t){(new t).emit("results/board.rendered")})}function MikaSwitchClass(t){t||(t=jQuery("#class-switcher").val());var e=jQuery("body").attr("class").split(/\s+/);jQuery.each(e,function(t,e){"class-switcher-"==e.substr(0,15)&&jQuery("body").removeClass(e)}),document.cookie="results_class_switcher="+t,jQuery("body").addClass("class-switcher-"+t)}function MikaResultsTfd(){}function MikaResultsSearch(){}function setMouse(t){mouseX=t.pointerX(),mouseY=t.pointerY()}function escapeHtml(t){var e=document.createElement("div");return e.appendChild(document.createTextNode(t)),e.innerHTML}function lax(vars,ids,options){if(async=0,"object"==typeof ids&&0!=ids.length||(ids={0:"main-content"}),"object"!=typeof options&&(options={}),"object"!=typeof vars&&(vars={}),options.confirm&&!confirm(options.confirm))return!1;var url="?";for(var key in vars)url+="&"+key+"="+vars[key];for(var i in ids){var str="var callback"+i+" = function(result) { this.jq('"+ids[i]+"').update(result); ";options.popup&&(str+="if (this.jq('"+ids[i]+"').style.display == 'none') {",str+="this.jq('"+ids[i]+"').style.display = 'block';",str+="}",str+="this.jq('"+ids[i]+"').style.width = '"+options.popup_width+"px';",str+="this.jq('"+ids[i]+"').style.height = '"+options.popup_height+"px';",str+="this.jq('"+ids[i]+"').style.top = mouseY+'px';",str+="this.jq('"+ids[i]+"').style.top = mouseY+'px';",(options.popup_align="R")?str+="this.jq('"+ids[i]+"').style.left = (mouseX-"+options.popup_width+") +'px';":str+="this.jq('"+ids[i]+"').style.left = mouseX+'px';",str+=""),options.focus&&(str+="document.getElementById('"+options.focus+"').focus();"),str+="};";var str_url=encodeURI(url+"&ajax="+ids[i]);str_url=str_url.replace(/\'/g,"\\'"),str+="HTML_AJAX.grab('"+str_url+"', callback"+i+");",eval(str)}return!0}function pax(t,e,i,s){if("object"!=typeof i&&(i={0:"main-content"}),"object"!=typeof s&&(s={}),"object"!=typeof e&&(e={}),s.confirm&&!confirm(s.confirm))return!1;var a="?";for(var o in e)a+="&"+o+"="+e[o];for(var r in i){var n=encodeURI(a+"&ajax="+i[r]);document.forms[t].action=n,HTML_AJAX.formSubmit(t,i[r])}return!0}function open_popup(t,e){for(query="",i=0;i>>32-e},i=function(t,e){var i,s,a,o,r;return a=2147483648&t,o=2147483648&e,i=1073741824&t,s=1073741824&e,r=(1073741823&t)+(1073741823&e),i&s?2147483648^r^a^o:i|s?1073741824&r?3221225472^r^a^o:1073741824^r^a^o:r^a^o},s=function(t,s,a,o,r,n,l){return t=i(t,i(i(function(t,e,i){return t&e|~t&i}(s,a,o),r),l)),i(e(t,n),s)},a=function(t,s,a,o,r,n,l){return t=i(t,i(i(function(t,e,i){return t&i|e&~i}(s,a,o),r),l)),i(e(t,n),s)},o=function(t,s,a,o,r,n,l){return t=i(t,i(i(function(t,e,i){return t^e^i}(s,a,o),r),l)),i(e(t,n),s)},r=function(t,s,a,o,r,n,l){return t=i(t,i(i(function(t,e,i){return e^(t|~i)}(s,a,o),r),l)),i(e(t,n),s)},n=function(t){var e,i="",s="";for(e=0;e<=3;e++)i+=(s="0"+(t>>>8*e&255).toString(16)).substr(s.length-2,2);return i};jQuery.extend({md5:function(t){var e,l,d,h,p,c,u,g,m,f=Array();for(f=function(t){for(var e,i=t.length,s=i+8,a=16*((s-s%64)/64+1),o=Array(a-1),r=0,n=0;n>>29,o}(t=function(t){t=t.replace(/\x0d\x0a/g,"\n");for(var e="",i=0;i127&&s<2048?(e+=String.fromCharCode(s>>6|192),e+=String.fromCharCode(63&s|128)):(e+=String.fromCharCode(s>>12|224),e+=String.fromCharCode(s>>6&63|128),e+=String.fromCharCode(63&s|128))}return e}(t)),c=1732584193,u=4023233417,g=2562383102,m=271733878,e=0;e'+s.html()+"")),s.css({width:s.width()+parseInt(s.css("padding-left").replace("px",""))+parseInt(s.css("padding-right").replace("px","")),height:s.height()+parseInt(s.css("padding-top").replace("px",""))+parseInt(s.css("padding-bottom").replace("px",""))}),s.append(''),this.isLoading=!0,s.addClass(e).addClass(i).attr(i,i)):(this.isLoading=!1,s.removeClass(e).removeClass(i).removeAttr(i),s.find(".loading-spinner").remove(),!0===s.data("label-created")&&s.html(s.find("loading-label").html())))},this),0)};var i=t.fn.mikaButton;t.fn.mikaButton=function(i){return this.each(function(){var s=t(this),a=s.data("mika.button"),o="object"==typeof i&&i;a||s.data("mika.button",a=new e(this,o)),i&&a.setState(i)})},t.fn.mikaButton.Constructor=e,t.fn.mikaButton.noConflict=function(){return t.fn.mikaButton=i,this}}(jQuery),function(t){if("function"==typeof define&&define.amd)define(t);else if("object"==typeof exports)module.exports=t();else{var e=window.Cookies,i=window.Cookies=t();i.noConflict=function(){return window.Cookies=e,i}}}(function(){function t(){for(var t=0,e={};t1){if("number"==typeof(o=t({path:"/"},s.defaults,o)).expires){var n=new Date;n.setMilliseconds(n.getMilliseconds()+864e5*o.expires),o.expires=n}try{r=JSON.stringify(a),/^[\{\[]/.test(r)&&(a=r)}catch(t){}return a=i.write?i.write(a,e):encodeURIComponent(String(a)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),e=e.replace(/[\(\)]/g,escape),document.cookie=[e,"=",a,o.expires&&"; expires="+o.expires.toUTCString(),o.path&&"; path="+o.path,o.domain&&"; domain="+o.domain,o.secure?"; secure":""].join("")}e||(r={});for(var l=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,h=0;h0?e.apply(this,arguments):s)&&o._cookie)for(var r in Cookies.get())""!=r&&a.push(r.replace(o._prefix,""));else for(var n in o)o.hasOwnProperty(n)&&a.push(n);return a}function l(e){if(!e||"string"!=typeof e)throw new Error("First parameter must be a string");d?(window.localStorage.getItem(e)||window.localStorage.setItem(e,"{}"),window.sessionStorage.getItem(e)||window.sessionStorage.setItem(e,"{}")):(window.localCookieStorage.getItem(e)||window.localCookieStorage.setItem(e,"{}"),window.sessionCookieStorage.getItem(e)||window.sessionCookieStorage.setItem(e,"{}"));var i={localStorage:t.extend({},t.localStorage,{_ns:e}),sessionStorage:t.extend({},t.sessionStorage,{_ns:e})};return"undefined"!=typeof Cookies&&(window.cookieStorage.getItem(e)||window.cookieStorage.setItem(e,"{}"),i.cookieStorage=t.extend({},t.cookieStorage,{_ns:e})),t.namespaceStorages[e]=i,i}var d=function(t){try{return!!window[t]&&(window[t].setItem("jsapi","jsapi"),window[t].removeItem("jsapi"),!0)}catch(t){return!1}}("localStorage"),h={_type:"",_ns:"",_callMethod:function(t,e){var i=[],s=(e=Array.prototype.slice.call(e))[0];return this._ns&&i.push(this._ns),"string"==typeof s&&-1!==s.indexOf(".")&&(e.shift(),[].unshift.apply(e,s.split("."))),[].push.apply(i,e),t.apply(this,i)},alwaysUseJson:!1,get:function(){return this._callMethod(e,arguments)},set:function(){var e=arguments.length,s=arguments,a=s[0];if(e<1||!t.isPlainObject(a)&&e<2)throw new Error("Minimum 2 arguments must be given or first parameter must be an object");if(t.isPlainObject(a)&&this._ns){for(var o in a)this._callMethod(i,[o,a[o]]);return a}var r=this._callMethod(i,s);return this._ns?r[a.split(".")[0]]:r},remove:function(){if(arguments.length<1)throw new Error("Minimum 1 argument must be given");return this._callMethod(s,arguments)},removeAll:function(t){return this._ns?(this._callMethod(i,[{}]),!0):this._callMethod(a,[t])},isEmpty:function(){return this._callMethod(o,arguments)},isSet:function(){if(arguments.length<1)throw new Error("Minimum 1 argument must be given");return this._callMethod(r,arguments)},keys:function(){return this._callMethod(n,arguments)}};if("undefined"!=typeof Cookies){window.name||(window.name=Math.floor(1e8*Math.random()));var p={_cookie:!0,_prefix:"",_expires:null,_path:null,_domain:null,setItem:function(t,e){Cookies.set(this._prefix+t,e,{expires:this._expires,path:this._path,domain:this._domain})},getItem:function(t){return Cookies.get(this._prefix+t)},removeItem:function(t){return Cookies.remove(this._prefix+t,{path:this._path})},clear:function(){for(var t in Cookies.get())""!=t&&(!this._prefix&&-1===t.indexOf("ls_")&&-1===t.indexOf("ss_")||this._prefix&&0===t.indexOf(this._prefix))&&Cookies.remove(t)},setExpires:function(t){return this._expires=t,this},setPath:function(t){return this._path=t,this},setDomain:function(t){return this._domain=t,this},setConf:function(t){return t.path&&(this._path=t.path),t.domain&&(this._domain=t.domain),t.expires&&(this._expires=t.expires),this},setDefaultConf:function(){this._path=this._domain=this._expires=null}};d||(window.localCookieStorage=t.extend({},p,{_prefix:"ls_",_expires:3650}),window.sessionCookieStorage=t.extend({},p,{_prefix:"ss_"+window.name+"_"})),window.cookieStorage=t.extend({},p),t.cookieStorage=t.extend({},h,{_type:"cookieStorage",setExpires:function(t){return window.cookieStorage.setExpires(t),this},setPath:function(t){return window.cookieStorage.setPath(t),this},setDomain:function(t){return window.cookieStorage.setDomain(t),this},setConf:function(t){return window.cookieStorage.setConf(t),this},setDefaultConf:function(){return window.cookieStorage.setDefaultConf(),this}})}t.initNamespaceStorage=function(t){return l(t)},d?(t.localStorage=t.extend({},h,{_type:"localStorage"}),t.sessionStorage=t.extend({},h,{_type:"sessionStorage"})):(t.localStorage=t.extend({},h,{_type:"localCookieStorage"}),t.sessionStorage=t.extend({},h,{_type:"sessionCookieStorage"})),t.namespaceStorages={},t.removeAllStorages=function(e){t.localStorage.removeAll(e),t.sessionStorage.removeAll(e),t.cookieStorage&&t.cookieStorage.removeAll(e),e||(t.namespaceStorages={})},t.alwaysUseJsonInStorage=function(e){h.alwaysUseJson=e,t.localStorage.alwaysUseJson=e,t.sessionStorage.alwaysUseJson=e,t.cookieStorage&&(t.cookieStorage.alwaysUseJson=e)}}),"object"==typeof google&&(inherits(MarkerLabel_,google.maps.OverlayView),MarkerLabel_.getSharedCross=function(t){var e;return void 0===MarkerLabel_.getSharedCross.crossDiv&&((e=document.createElement("img")).style.cssText="position: absolute; z-index: 1000002; display: none;",e.style.marginLeft="-8px",e.style.marginTop="-9px",e.src=t,MarkerLabel_.getSharedCross.crossDiv=e),MarkerLabel_.getSharedCross.crossDiv},MarkerLabel_.prototype.onAdd=function(){var t,e,i,s,a,o,r,n=this,l=!1,d=!1,h="url("+this.handCursorURL_+")",p=function(t){t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()},c=function(){n.marker_.setAnimation(null)};this.getPanes().markerLayer.appendChild(this.labelDiv_),this.getPanes().overlayMouseTarget.appendChild(this.eventDiv_),void 0===MarkerLabel_.getSharedCross.processed&&(this.getPanes().overlayImage.appendChild(this.crossDiv_),MarkerLabel_.getSharedCross.processed=!0),this.listeners_=[google.maps.event.addDomListener(this.eventDiv_,"mouseover",function(t){(n.marker_.getDraggable()||n.marker_.getClickable())&&(this.style.cursor="pointer",google.maps.event.trigger(n.marker_,"mouseover",t))}),google.maps.event.addDomListener(this.eventDiv_,"mouseout",function(t){!n.marker_.getDraggable()&&!n.marker_.getClickable()||d||(this.style.cursor=n.marker_.getCursor(),google.maps.event.trigger(n.marker_,"mouseout",t))}),google.maps.event.addDomListener(this.eventDiv_,"mousedown",function(t){d=!1,n.marker_.getDraggable()&&(l=!0,this.style.cursor=h),(n.marker_.getDraggable()||n.marker_.getClickable())&&(google.maps.event.trigger(n.marker_,"mousedown",t),p(t))}),google.maps.event.addDomListener(document,"mouseup",function(e){var i;if(l&&(l=!1,n.eventDiv_.style.cursor="pointer",google.maps.event.trigger(n.marker_,"mouseup",e)),d){if(a){(i=n.getProjection().fromLatLngToDivPixel(n.marker_.getPosition())).y+=20,n.marker_.setPosition(n.getProjection().fromDivPixelToLatLng(i));try{n.marker_.setAnimation(google.maps.Animation.BOUNCE),setTimeout(c,1406)}catch(t){}}n.crossDiv_.style.display="none",n.marker_.setZIndex(t),s=!0,d=!1,e.latLng=n.marker_.getPosition(),google.maps.event.trigger(n.marker_,"dragend",e)}}),google.maps.event.addListener(n.marker_.getMap(),"mousemove",function(s){var h;l&&(d?(s.latLng=new google.maps.LatLng(s.latLng.lat()-e,s.latLng.lng()-i),h=n.getProjection().fromLatLngToDivPixel(s.latLng),a&&(n.crossDiv_.style.left=h.x+"px",n.crossDiv_.style.top=h.y+"px",n.crossDiv_.style.display="",h.y-=20),n.marker_.setPosition(n.getProjection().fromDivPixelToLatLng(h)),a&&(n.eventDiv_.style.top=h.y+20+"px"),google.maps.event.trigger(n.marker_,"drag",s)):(e=s.latLng.lat()-n.marker_.getPosition().lat(),i=s.latLng.lng()-n.marker_.getPosition().lng(),t=n.marker_.getZIndex(),o=n.marker_.getPosition(),r=n.marker_.getMap().getCenter(),a=n.marker_.get("raiseOnDrag"),d=!0,n.marker_.setZIndex(1e6),s.latLng=n.marker_.getPosition(),google.maps.event.trigger(n.marker_,"dragstart",s)))}),google.maps.event.addDomListener(document,"keydown",function(t){d&&27===t.keyCode&&(a=!1,n.marker_.setPosition(o),n.marker_.getMap().setCenter(r),google.maps.event.trigger(document,"mouseup",t))}),google.maps.event.addDomListener(this.eventDiv_,"click",function(t){(n.marker_.getDraggable()||n.marker_.getClickable())&&(s?s=!1:(google.maps.event.trigger(n.marker_,"click",t),p(t)))}),google.maps.event.addDomListener(this.eventDiv_,"dblclick",function(t){(n.marker_.getDraggable()||n.marker_.getClickable())&&(google.maps.event.trigger(n.marker_,"dblclick",t),p(t))}),google.maps.event.addListener(this.marker_,"dragstart",function(t){d||(a=this.get("raiseOnDrag"))}),google.maps.event.addListener(this.marker_,"drag",function(t){d||a&&(n.setPosition(20),n.labelDiv_.style.zIndex=1e6+(this.get("labelInBackground")?-1:1))}),google.maps.event.addListener(this.marker_,"dragend",function(t){d||a&&n.setPosition(0)}),google.maps.event.addListener(this.marker_,"position_changed",function(){n.setPosition()}),google.maps.event.addListener(this.marker_,"zindex_changed",function(){n.setZIndex()}),google.maps.event.addListener(this.marker_,"visible_changed",function(){n.setVisible()}),google.maps.event.addListener(this.marker_,"labelvisible_changed",function(){n.setVisible()}),google.maps.event.addListener(this.marker_,"title_changed",function(){n.setTitle()}),google.maps.event.addListener(this.marker_,"labelcontent_changed",function(){n.setContent()}),google.maps.event.addListener(this.marker_,"labelanchor_changed",function(){n.setAnchor()}),google.maps.event.addListener(this.marker_,"labelclass_changed",function(){n.setStyles()}),google.maps.event.addListener(this.marker_,"labelstyle_changed",function(){n.setStyles()})]},MarkerLabel_.prototype.onRemove=function(){var t;for(this.labelDiv_.parentNode.removeChild(this.labelDiv_),this.eventDiv_.parentNode.removeChild(this.eventDiv_),t=0;t=1?o-=60*(a=Math.floor(a)):a=0,s>=1?a-=60*(s=Math.floor(s)):s=0,i>=1?s-=24*(i=Math.floor(i)):i=0,s<10&&(s="0"+s),a<10&&(a="0"+a),o<10&&(o="0"+o),i?e+i+s+":"+a+":"+o:e+s+":"+a+":"+o},load:function(){this.log("load...","info"),this.log(this.options_submit,"debug"),this.options_submit.lang=this.options.lang,this.options_submit.pid=this.options.pid,this.options_submit.client_seconds=this.getClientSeconds(),this.options.event_default&&!this.options_submit.option_bar.event&&(this.options_submit.option_bar.event=this.options.event_default),this.options.addFavorite&&-1==this.favorites.indexOf(this.options.addFavorite)&&(this.favorites.push(this.options.addFavorite),this.options_submit.command={name:"addFavorite",id:this.options.addFavorite});var t=this.options.globalObjectName;this.makeRequest("getLeaderboard",this.options_submit,function(e){window[t].setData(e)})},addToRenderQueue:function(t){-1==this.renderQueue.indexOf(t)&&this.renderQueue.push(t)},clearRenderQueue:function(){this.renderQueue=[]},registerEvents:function(){var t;for(var e in this.eventsDelete)if(this.eventsDelete.hasOwnProperty(e))for(t in this.eventsDelete[e])this.eventsDelete[e].hasOwnProperty(t)&&jQuery(this.eventsDelete[e][t].selector).off(e);for(var e in this.events)if(this.events.hasOwnProperty(e)){if("click"==e)for(t in this.events[e])this.events[e].hasOwnProperty(t)&&(void 0!==this.events[e][t].data?jQuery(this.events[e][t].selector).click(this.events[e][t].data,this.events[e][t].func):jQuery(this.events[e][t].selector).click(this.events[e][t].func));if("mouseover"==e)for(t in this.events[e])this.events[e].hasOwnProperty(t)&&jQuery(this.events[e][t].selector).mouseover(this.events[e][t].func);if("mouseout"==e)for(t in this.events[e])this.events[e].hasOwnProperty(t)&&jQuery(this.events[e][t].selector).mouseout(this.events[e][t].func)}if(this.events.click=[],this.events.mouseover=[],this.events.mouseout=[],this.eventsDelete.click=[],this.eventsDelete.mouseover=[],this.eventsDelete.mouseout=[],this.data.global.options.shortcuts&&!this.shortcuts_registred){var i=this.options.globalObjectName;jQuery(document).keyup(function(t){16===t.keyCode&&(window[i].shift_pressed=!1),17===t.keyCode&&(window[i].ctrl_pressed=!1)}),jQuery(document).keydown(function(t){16===t.keyCode&&(window[i].shift_pressed=!0),17===t.keyCode&&(window[i].ctrl_pressed=!0),72===t.keyCode&&(window[i].shift_pressed?window[i].trigger("switchControlsExtended",{}):window[i].trigger("switchControls",{})),"88"===t.keyCode&&window[i].trigger("switchFullscreen")}),this.shortcuts_registred=!0}},setData:function(t){this.log("function: setData","info");var e,i=!1;void 0===this.data.settings&&(i=!0);var s=!1;if("object"==typeof this.data.settings&&this.data.settings.global_event&&this.data.settings.global_event!=t.settings.global_event&&(s=!0),this.data.settings=t.settings,this.data.lastUpdateTs=t.lastUpdateTs,void 0!==t.settings&&void 0!==t.settings.time_offset&&"function"==typeof require&&require(["Mika/Timer"],function(t){}),this.options_submit.command={},t.settings.favorites){this.favorites=[];for(e in t.settings.favorites)t.settings.favorites.hasOwnProperty(e)&&this.favorites.push(t.settings.favorites[e])}void 0===this.data.global&&(this.data.global={},this.data.global.meta={},this.options_submit.globalData={});for(e in t.globalData)t.globalData.hasOwnProperty(e)&&("ok"==t.globalData[e].state?(this.data.global[e]=t.globalData[e].data,this.data.global.meta[e]={},this.data.global.meta[e].state=t.globalData[e].state,this.data.global.meta[e].hash=t.globalData[e].hash):"nothing_changed"==t.globalData[e].state&&(this.data.global.meta[e].state="nothing_changed"),this.options_submit.globalData[e]={},this.options_submit.globalData[e].hash=t.globalData[e].hash);for(e in this.data.global)this.data.global.hasOwnProperty(e)&&"meta"!=e&&void 0===t.globalData[e]&&delete this.data.global[e];if(i||"object"!=typeof this.data.containers)this.data.containers=t.containers;else{for(e in t.containers)if(t.containers.hasOwnProperty(e))if("ok"==t.containers[e].state){if(this.data.containers[e]=t.containers[e],!s)switch(t.containers[e].type){case"favorites":this.addToRenderQueue("favorites"),this.addToRenderQueue("list");break;case"list":this.addToRenderQueue("list");break;case"map":this.addToRenderQueue("map");break;case"overlays":this.addToRenderQueue("overlays")}}else"nothing_changed"==t.containers[e].state&&(this.data.containers[e].state="nothing_changed");for(e in this.data.containers)this.data.containers.hasOwnProperty(e)&&void 0===t.containers[e]&&delete this.data.containers[e];s||this.renderFromQueue()}this.options_submit.containers={};for(e in this.data.containers)this.data.containers.hasOwnProperty(e)&&(this.options_submit.containers[e]={},this.options_submit.containers[e].hash=this.data.containers[e].hash);this.strings=this.data.global.strings,jQuery(".resultsboard-"+this.options.globalObjectName+" .lb-containers").length?(s&&(this.clearCols(),this.renderContainers()),"nothing_changed"!=this.data.global.meta.global_option_bar.state&&this.renderOptionBar(!0)):this.render(),this.refresh(),this.data.global.options.replay_mode&&this.mapInitSliders(),this.data.global.options.refresh&&(window.clearTimeout(this.timer.load),this.timer.load=window.setTimeout(this.options.globalObjectName+".load()",1e3*this.data.global.options.refresh)),"jqm"==this.options.theme&&(jQuery(".lb-containers").trigger("create"),applySizes()),i||void 0!==this.data.global.global_option_bar.options.show_last_update&&!0===this.data.global.global_option_bar.options.show_last_update&&(void 0!==this.data.global.global_option_bar.options.last_update_count_up&&!0===this.data.global.global_option_bar.options.last_update_count_up?jQuery(".resultsboard-"+this.options.globalObjectName+' [data-type="lastupdatetimestamp"]').html(''):jQuery(".resultsboard-"+this.options.globalObjectName+' [data-type="lastupdatetimestamp"]').html(this.formatTime(new Date))),MikaResultsRenderTrigger()},formatTime:function(t){var e=t.getHours(),i=t.getMinutes(),s=t.getSeconds();return i<10&&(i="0"+i),s<10&&(s="0"+s),e+":"+i+":"+s},microtime:function(){return(new Date).getTime()},getClientSeconds:function(){var t=new Date,e=3600*t.getHours();return e+=60*t.getMinutes(),e+=t.getSeconds()},refresh:function(){this.log("function: refresh","info",!0),this.refresh_counter||(this.refresh_counter=0),this.refresh_counter++;var t,e,i,s,a,o,r=0,n=0,l=0,d=this.getContainerByType("favorites");if(d.data){var h={},p={},c={},u={},g=0,m=0;for(var f in d.data.rows)if(d.data.rows.hasOwnProperty(f)){var _=d.data.rows[f];_.split_groups[_.global_info.active_group_key];void 0===_.is_in_replay&&("F"==_.global_info.race_status&&this.data.global.options.replay_mode?_.is_in_replay=!0:_.is_in_replay=!1),e=!1,i=!1,k=!1,_.starttime_net_ms&&(_.starttime_net_ms=parseInt(_.starttime_net_ms),g||(g=_.starttime_net_ms),g=Math.min(g,_.starttime_net_ms));for(t in _.splits)_.splits.hasOwnProperty(t)&&(s=_.splits[t],_.is_in_replay?(m=this.data.global.options.replay_daytime?_.starttime_net_ms-g:0,this.replay_time&&s.time_ms&&s.time_ms+m<=this.replay_time&&(e=s,void 0!==_.splits[parseInt(t)+1]?i=_.splits[parseInt(t)+1]:(i=e,k=!0)),s.time_ms&&(this.data.global.options.replay_daytime?this.replay_time_max=Math.max(this.replay_time_max,s.time_ms+m):this.replay_time_max=Math.max(this.replay_time_max,s.time_ms))):s.time_ms&&"-"!=s.time_ms&&(e=s,i=!1));if(!e&&_.is_in_replay){for(t in _.splits)if(_.splits.hasOwnProperty(t)){i=_.splits[t];break}e=i}if(i){for(a in _.split_groups)if(_.split_groups.hasOwnProperty(a))if(a==e.group)if(void 0===p[a]&&(p[a]={}),void 0===h[a]&&(h[a]={}),_.is_in_replay&&this.data.global.options.replay_mode){_.split_groups[a].active=!0,_.global_info.active_group_key=a,n=0,this.data.global.options.replay_daytime?(l=(this.replay_time-m-e.time_ms)/i.ms_km_estimate,l+=e.km-_.split_groups[a].first_km):(l=(this.replay_time-e.time_ms)/i.ms_km_estimate,l+=e.km-_.split_groups[a].first_km),(isNaN(l)||l<0)&&(l=0),_.split_groups[a].estimated_pos=l;var v=this.replay_time-m;_.race_time=v>0&&!k?this.ms2time(v):k?e.time:"00:00:00",_.split_groups[a].estimated_pos_string=l.toFixed(2),p[a][_.id]=l,_.split_groups[a].state="started",k&&(_.split_groups[a].estimated_pos="finished",_.split_groups[a].state="finished")}else isNaN(_.split_groups[a].estimated_pos)?h[a][_.id]=0:h[a][_.id]=_.split_groups[a].estimated_pos;else _.is_in_replay&&this.data.global.options.replay_mode&&(_.split_groups[a].active=!1)}else{if(!e)for(a in _.split_groups)if(_.split_groups.hasOwnProperty(a)){"S"==_.global_info.race_status?(_.split_groups[a].estimated_pos="not_started",_.split_groups[a].estimated_pos_string="not_started"):(_.split_groups[a].estimated_pos="started",_.split_groups[a].estimated_pos_string="started");break}var y=(1e3*(this.getClientSeconds()+this.data.settings.time_offset)-_.position_data.daytime_last_change)/1e3*(_.position_data.speed_kmh/3.6),b=((1e3*_.position_data.pos_km+y)/1e3).toFixed(2);b<_.position_data.pos_km&&(b=_.position_data.pos_km.toFixed(2));for(a in _.split_groups)_.split_groups.hasOwnProperty(a)&&(a!=e.group&&"estimated_chip"==_.position_data.source||("A"==_.global_info.race_status?(_.split_groups[a].state="started",b<=_.position_data.valid_until_km?_.split_groups[a].estimated_pos=_.split_groups[a].estimated_pos_string=b:_.split_groups[a].estimated_pos=_.split_groups[a].estimated_pos_string=_.position_data.valid_until_km):"F"==_.global_info.race_status?_.split_groups[a].estimated_pos=_.split_groups[a].state="finished":"S"==_.global_info.race_status&&(_.split_groups[a].estimated_pos=_.split_groups[a].state="not_started"),void 0===p[a]&&(p[a]={}),void 0===h[a]&&(h[a]={}),isNaN(_.split_groups[a].estimated_pos)?h[a][_.id]=0:h[a][_.id]=_.split_groups[a].estimated_pos))}}for(f in d.data.rows)if(d.data.rows.hasOwnProperty(f)){_=d.data.rows[f],e="",i="";var k=!1;for(t in _.splits)_.splits.hasOwnProperty(t)&&(s=_.splits[t],_.is_in_replay?this.replay_time&&s.time_ms<=this.replay_time&&(e=s,void 0!==_.splits[parseInt(t)+1]?i=_.splits[parseInt(t)+1]:(i=e,k=!0)):s.time_ms&&"-"!=s.time_ms&&(e=s,i=!1));e||(e=i=_.splits[0]),c[e.group]=0,u[e.group]=0;for(t in h[e.group])h[e.group].hasOwnProperty(t)&&(c[e.group]=Math.max(h[e.group][t],c[e.group]));for(t in p[e.group])p[e.group].hasOwnProperty(t)&&(u[e.group]=Math.max(p[e.group][t],u[e.group]));for(a in _.split_groups)_.split_groups.hasOwnProperty(a)&&a==e.group&&(_.is_in_replay&&this.data.global.options.replay_mode?(r=u[a]-_.split_groups[a].estimated_pos,_.split_groups[a].diff_km=r,isNaN(r)&&0!=r?_.split_groups[a].diff_km_string="+0 km":_.split_groups[a].diff_km_string="+"+r.toFixed(2)+" km",n=(u[a]-_.split_groups[a].estimated_pos)*i.ms_km_estimate,_.split_groups[a].diff_time=n,isNaN(n)&&0!=n?_.split_groups[a].diff_time_string="+0":_.split_groups[a].diff_time_string="+"+this.ms2time(n)):(r=c[a]-_.split_groups[a].estimated_pos,_.split_groups[a].diff_km=r,isNaN(r)&&0!=r?_.split_groups[a].diff_km_string="+0 km":_.split_groups[a].diff_km_string="+"+r.toFixed(2)+" km",n=(c[a]-_.split_groups[a].estimated_pos)*_.split_groups[a].ms_km_estimate,_.split_groups[a].diff_time=n,isNaN(n)&&0!=n?_.split_groups[a].diff_time_string="+0":_.split_groups[a].diff_time_string="+"+this.ms2time(n)))}this.favoritesOrderLive={};for(a in h)if(h.hasOwnProperty(a)){o={};for(t in h[a])h[a].hasOwnProperty(t)&&(o[h[a][t]]=t);o=this.sortObjByKey(o,!0),this.favoritesOrderLive[a]=[];for(t in o)o.hasOwnProperty(t)&&this.favoritesOrderLive[a].push(o[t]);this.favoritesOrderLive[a].reverse();for(t in h[a])h[a].hasOwnProperty(t)&&(h[a][t]||this.favoritesOrderLive[a].push(t))}this.favoritesOrderReplay={};for(a in p)if(p.hasOwnProperty(a)){o={};for(t in p[a])p[a].hasOwnProperty(t)&&p[a][t]&&(o[p[a][t]]=t);o=this.sortObjByKey(o,!0),this.favoritesOrderReplay[a]=[];for(t in o)o.hasOwnProperty(t)&&this.favoritesOrderReplay[a].push(o[t]);this.favoritesOrderReplay[a].reverse();for(t in p[a])p[a].hasOwnProperty(t)&&(p[a][t]||this.favoritesOrderReplay[a].push(t))}this.log("function: refresh","info");for(t in this.data.containers)this.data.containers.hasOwnProperty(t)&&"map"==this.data.containers[t].type&&this.mapUpdate(t);for(t in this.data.containers)this.data.containers.hasOwnProperty(t)&&"favorites"==this.data.containers[t].type&&this.updateContainerContentTypeFavorites(t,!0);!this.replay_running&&this.data.global.options.refresh_update_ms&&(window.clearTimeout(this.timer.refresh),this.timer.refresh=window.setTimeout(this.options.globalObjectName+".refresh()",this.data.global.options.refresh_update_ms)),this.data.global.options.replay_daytime?jQuery("#replay-racetime").html(this.ms2time(this.replay_time+g)):jQuery("#replay-racetime").html(this.ms2time(this.replay_time)),this.log("function: refresh","info")}},sortObjByKey:function(t,e){var i,s=[],a={};for(i in t)t.hasOwnProperty(i)&&s.push(i);e?s.sort(function(t,e){return t-e}):s.sort();for(i in s)s.hasOwnProperty(i)&&(a[s[i]]=t[s[i]]);return a},replayStep:function(){var t=this.data.global.options.replay_step*this.replay_speed;this.replay_time<=this.replay_time_max?(this.replay_time+=t,this.slider_time.slider("value",this.replay_time),jQuery(".resultsboard-"+this.options.globalObjectName+" .replay-racetime").html(window[this.options.globalObjectName].ms2time(this.replay_time)),this.refresh()):this.replayStop()},replayStart:function(){this.replay_time>=this.replay_time_max&&(this.replay_time=0),this.replay_running=!0,jQuery(".resultsboard-"+this.options.globalObjectName+" .lb-containers").addClass("replay-running"),window.clearInterval(this.timer.refresh),window.clearInterval(this.timer.replay),this.timer.replay=window.setInterval("window['"+this.options.globalObjectName+"'].replayStep()",this.data.global.options.replay_step)},replayStop:function(){this.replay_running=!1,jQuery(".resultsboard-"+this.options.globalObjectName+" .lb-containers").removeClass("replay-running"),window.clearInterval(this.timer.replay),this.refresh()},replayRewind:function(){this.replay_time=0,this.replayStop(),this.replayStart()},renderMainButtons:function(){var t="";return"fixed"!=jQuery(".cbox.left .list").css("position")?t+='
'+this.strings.reload+'"+this.strings.fullscreen+"
":t+='
'+this.strings.reload+'"+this.strings.fullscreen_close+"
",t+='
'+this.strings.reload+'"+this.strings.reload+"
",this.getContainerByType("list")&&(this.options.autoFollow?t+='
'+this.strings.auto_follow+'"+this.strings.auto_follow+"
":t+='
'+this.strings.auto_follow+'"+this.strings.auto_follow+"
"),this.options.help&&(t+='
'+this.strings.help+"
"),t},renderMain:function(){var t="";t+='
'+this.options.title,t+='
',t+=this.renderMainButtons(),t+="
",t+="
",t+='
',"jqm"==this.options.theme&&(t+='
  • '),void 0!==this.data.global.global_option_bar&&(t+=this.renderOptionBar());for(var e in this.data.global.options.cols)this.data.global.options.cols.hasOwnProperty(e)&&(t+='
    ');return"jqm"==this.options.theme&&(t+="
"),t+="
",t+='"},clearCols:function(){jQuery(".lb-col").html("")},trigger:function(t,e){switch(this.log("Trigger: "+t,"info"),t){case"reload":this.load();break;case"refresh":this.refresh();break;case"replayPlay":this.replayStart();break;case"replayStop":this.replayStop();break;case"replayRewind":this.replayRewind();break;case"setSelector":e.key&&e.container&&(this.subSelectorState[e.container]=e.key,this.options.autoFollow=!1,this.renderContainers(e.container),jQuery(".resultsboard-"+this.options.globalObjectName+" .list-option-buttons").html(this.renderMainButtons()));break;case"autoFollow":e?(this.options.autoFollow=!0,this.subSelectorState={}):this.options.autoFollow=!1,this.addToRenderQueue("list"),this.renderFromQueue(),jQuery(".resultsboard-"+this.options.globalObjectName+" .list-option-buttons").html(this.renderMainButtons());break;case"showDetails":this.data.global.options.show_details=!!e,this.addToRenderQueue("favorites"),this.renderFromQueue();break;case"openFavoriteDetails":this.openFavoriteDetails(e.id_favorite,e);break;case"closeFavoriteDetails":this.closeFavoriteDetails(e.id_favorite,e);break;case"addFavorite":"none"!=this.data.global.options.favorites_mode&&-1==this.favorites.indexOf(e.id)&&(this.favorites.push(e.id),this.options_submit.command={name:"addFavorite",id:e.id},this.addToRenderQueue("list"),this.addToRenderQueue("map"),this.load());break;case"removeFavorite":if("none"!=this.data.global.options.favorites_mode){a=[];if(-1!=(i=this.favorites.indexOf(e.id))){for(r in this.favorites)this.favorites.hasOwnProperty(r)&&this.favorites[r]!=e.id&&a.push(this.favorites[r]);this.favorites=a,this.options_submit.command={name:"removeFavorite",id:e.id},this.addToRenderQueue("list"),this.addToRenderQueue("map"),this.load()}}break;case"clearFavorites":this.favorites=[],this.options_submit.command={name:"clearFavorites",id:e.id},this.load(),this.renderContainers();break;case"selectFavoriteToggle":-1!=(i=this.favorites.indexOf(e.id))&&(-1!=this.favoritesSelected.indexOf(e.id)?this.trigger("deselectFavorite",{id:e.id}):this.trigger("selectFavorite",{id:e.id}));break;case"selectFavorite":-1!==(i=this.favorites.indexOf(e.id))&&this.favoritesSelected.push(e.id);break;case"deselectFavorite":var i;if(-1!==(i=this.favorites.indexOf(e.id))){var s=this.favorites[i],a=[];for(r in this.favoritesSelected)this.favoritesSelected.hasOwnProperty(r)&&s!=this.favoritesSelected[r]&&a.push(this.favoritesSelected[r]);this.favoritesSelected=a}break;case"submitOptions":a=[];jQuery(".resultsboard-"+this.options.globalObjectName+" form").each(function(t,e){"lb"==e.name&&(a=jQuery(this).serializeArray())});var o={};for(var r in a)a.hasOwnProperty(r)&&("field_"==a[r].name.substr(0,6)&&(o[a[r].name.substr(6)]=a[r].value),"option_"==a[r].name.substr(0,7)&&(o[a[r].name.substr(7)]=a[r].value));this.replay_time_max=0,this.replay_time=0,this.replay_speed=0,this.options_submit.option_bar=o,this.load();break;case"centerMap":this.mapAutoZoom=!1,this.mapCenter(e.container);break;case"switchFullscreen":this.switchFullscreen();break;case"switchControls":jQuery(".resultsboard-"+this.options.globalObjectName+".list").hasClass("hide-on")?jQuery(".resultsboard-"+this.options.globalObjectName+".list").removeClass("hide-on"):jQuery(".resultsboard-"+this.options.globalObjectName+".list").addClass("hide-on");break;case"switchControlsExtended":jQuery(".resultsboard-"+this.options.globalObjectName+".list").hasClass("hide-on")?(jQuery(".resultsboard-"+this.options.globalObjectName+".list").removeClass("hide-on"),jQuery(".resultsboard-"+this.options.globalObjectName+".list").removeClass("hide-on-extended")):(jQuery(".resultsboard-"+this.options.globalObjectName+".list").addClass("hide-on"),jQuery(".resultsboard-"+this.options.globalObjectName+".list").addClass("hide-on-extended"));break;case"switchAutoZoom":this.mapAutoZoom?(this.mapAutoZoom=!1,jQuery(".resultsboard-"+this.options.globalObjectName+" .button-map-autozoom").removeClass("button-active")):(this.mapAutoZoom=!0,jQuery(".resultsboard-"+this.options.globalObjectName+" .button-map-autozoom").addClass("button-active"));for(var r in this.data.containers)this.data.containers.hasOwnProperty(r)&&"map"==this.data.containers[r].type&&this.mapUpdate(r);break;case"switchOverlayMenu":(p=jQuery(".resultsboard-"+this.options.globalObjectName+" .overlayMenu")).css({display:"block"});var n=p.position(),l=p.offset(),d=n.top+(e.top-l.top),h=n.left+(e.left-l.left);p.css({display:"block",left:h+"px",top:d+"px"});break;case"switchOverlay":if(-1!==this.mapOverlays.indexOf(e.overlayId)){a=[];for(var r in this.mapOverlays)this.mapOverlays.hasOwnProperty(r)&&this.mapOverlays[r]!=e.overlayId&&a.push(this.mapOverlays[r]);this.mapOverlays=a,jQuery(".overlayMenu #overlayButton-"+e.overlayId).removeClass("active")}else this.mapOverlays.push(e.overlayId),jQuery(".overlayMenu #overlayButton-"+e.overlayId).addClass("active");window.setTimeout(this.options.globalObjectName+'.trigger("closeOverlayMenu")',350);break;case"closeOverlayMenu":(p=jQuery(".resultsboard-"+this.options.globalObjectName+" .overlayMenu")).css({display:"none"});for(var r in this.data.containers)this.data.containers.hasOwnProperty(r)&&"map"==this.data.containers[r].type&&this.mapUpdateOverlays(r);break;case"openInfoWindow":(p=jQuery(".resultsboard-"+this.options.globalObjectName+" .mapInfoWindow")).css({display:"block"});n=p.position(),l=p.offset(),d=e.top,h=e.left;p.css({display:"block",left:h+"px",top:d+"px"}),p.html(e.html);break;case"closeInfoWindow":var p;(p=jQuery(".resultsboard-"+this.options.globalObjectName+" .mapInfoWindow")).css({display:"none"})}},render:function(){jQuery(this.targetElement).html(this.renderMain()),this.renderContainers()},renderFromQueue:function(){for(var t in this.renderQueue)if(this.renderQueue.hasOwnProperty(t))for(var e in this.data.containers)this.data.containers.hasOwnProperty(e)&&this.data.containers[e].type==this.renderQueue[t]&&this.renderContainers(e);this.clearRenderQueue()},renderContainers:function(t){for(var e in this.data.containers)if(this.data.containers.hasOwnProperty(e)&&!(t&&e!=t||"map"!=this.data.containers[e].type&&"favorites"!=this.data.containers[e].type&&"list"!=this.data.containers[e].type&&"overlays"!=this.data.containers[e].type)){if(this.data.containers[e].state,"overlays"!=this.data.containers[e].type)if(jQuery(".resultsboard-"+this.options.globalObjectName+" .lb-container.container-id-"+e).length)if("favorites"==this.data.containers[e].type){var i=jQuery(".favorite-boxes .favorite-wrap").length,s=0;if(void 0!==this.data.containers[e].data.rows)for(var a in this.data.containers[e].data.rows)s++;i!=s?jQuery(".resultsboard-"+this.options.globalObjectName+" .lb-container.container-id-"+e).html(this.renderContainer(e,!0)):this.updateContainerContentTypeFavorites(e)}else jQuery(".resultsboard-"+this.options.globalObjectName+" .lb-container.container-id-"+e).html(this.renderContainer(e,!0));else{var o=this.renderContainer(e,!1);jQuery(".resultsboard-"+this.options.globalObjectName+" .lb-col.col-id-"+this.data.containers[e].col).append(o)}if("map"==this.data.containers[e].type&&this.mapInit(e),"favorites"==this.data.containers[e].type)for(var r in this.data.containers)this.data.containers.hasOwnProperty(r)&&"map"==this.data.containers[r].type&&this.mapUpdate(r);if("overlays"==this.data.containers[e].type)for(var r in this.data.containers)this.data.containers.hasOwnProperty(r)&&"map"==this.data.containers[r].type&&this.mapUpdateOverlays(r)}var n="";for(var l in this.data.global.options.cols)this.data.global.options.cols.hasOwnProperty(l)&&(n+=".lb-col.col-id-"+this.data.global.options.cols[l].id,l+1'+this.data.settings.global_event_official_string+"

")}else jQuery(".resultsboard-"+this.options.globalObjectName+" .event-official").remove();"undefined"!=typeof require&&require(["Mika/Mika"],function(t){(new t).emit("results/board.rendered")})},registerTooltips:function(){jQuery(".resultsboard-"+this.options.globalObjectName+" .leaderboard-search input").tooltip({tooltipClass:"tooltip-warning",show:{delay:0},position:{my:"center bottom",at:"center top"},content:this.strings.not_found,items:"input"}),jQuery(".resultsboard-"+this.options.globalObjectName+" .leaderboard-search input").tooltip("disable"),this.options.isTouchDevice||(jQuery(".tt-help").tooltip({tooltipClass:"tooltip-help",show:{delay:400},position:{my:"center top-45",at:"center top"},items:"a,span,button,div"}),jQuery(".tt-help.tt-oninit.tt-pos-bottom").tooltip({tooltipClass:"tooltip-help tooltip-icon-info tt-pos-bottom",show:{delay:2500},position:{my:"center top+4",at:"center bottom",collision:"none"},items:"a,span,button,div"}),jQuery(".tt-help.tt-oninit.tt-pos-top").tooltip({tooltipClass:"tooltip-help tooltip-icon-info tt-pos-top",show:{delay:2500},position:{my:"center bottom-10",at:"center top",collision:"none"},items:"a,span,button,div"}),jQuery(".resultsboard-"+this.options.globalObjectName+" .tt-oninit").tooltip("enable"),jQuery(".resultsboard-"+this.options.globalObjectName+" .tt-oninit").tooltip("open"),jQuery(".tt-help.tt-oninit").tooltip({show:{delay:400}})),jQuery(".tt-help-info").tooltip({tooltipClass:"tooltip-help-info",show:{delay:400,effect:"slideDown"},position:{my:"right top",at:"right bottom"},content:this.options.help})},renderContainer:function(t,e){var i,s=this.data.containers[t],a="",o="",r=s.title;if(void 0!==s.data.sub_selector){if(this.subSelectorState[t]&&(s.data.rows[this.subSelectorState[t]]||(this.subSelectorState[t]=!1)),!this.subSelectorState[t])for(i in s.data.sub_selector)s.data.sub_selector.hasOwnProperty(i)&&s.data.sub_selector[i].has_data&&(this.subSelectorState[t]=i);if(this.options.autoFollow)for(i in s.data.sub_selector)s.data.sub_selector.hasOwnProperty(i)&&s.data.sub_selector[i].has_data&&(this.subSelectorState[t]=i);this.subSelectorState[t]||(this.subSelectorState[t]=0);for(i in s.data.sub_selector)if(s.data.sub_selector.hasOwnProperty(i)&&i==this.subSelectorState[t])var n=s.data.sub_selector[i].name;this.data.global.options.append_subselector_title&&(r=s.title+" "+n+"")}switch(this.options.theme){case"jqm":e||(a+='
'),a+='
    ',a+='
  • '+s.title+"
  • ",a+="
  • ",a+='
    ',(o=this.renderContainerContent(t))&&(a+=o),a+="
    ",a+="
  • ",a+="
",e||(a+="
");break;default:e||(a+='
'),a+='
',a+='
'+r+"
",a+='
',a+=' '+this.strings.move+'',a+="
",a+="
";"",a+='
';(o=this.renderContainerContent(t))&&(a+=o),a+="
",e||(a+="
")}return a},renderContainerContent:function(t){var e="";switch(this.data.containers[t].type){case"list":e=this.renderContainerContentTypeList(t);break;case"favorites":e=this.renderContainerContentTypeFavorites(t);break;case"map":e=this.renderContainerContentTypeMap(t)}return e},renderTrendField:function(t,e,i,s){var a="";switch("object"!=typeof t[e.field]&&(t[e.field]={value:t[e.field]}),t[e.field].value){case"plus":s="icon_up.gif";break;case"minus":s="icon_down.gif";break;default:s="icon_even.gif"}var o="",r="";return void 0!==e.type_data&&void 0!==e.type_data.view_places&&!0===e.type_data.view_places&&"~"!=t[e.field].trend_place_diff.modifier&&"unknown"!=t[e.field].value?r=" "+(">"==t[e.field].trend_place_diff.modifier?">":t[e.field].trend_place_diff.modifier)+t[e.field].trend_place_diff.places+"":void 0!==t[e.field].trend_place_diff&&"plus"==t[e.field].value|"minus"==t[e.field].value&&(o=t[e.field].trend_place_diff.modifier+""+t[e.field].trend_place_diff.places),a+="',a+=r,a+=""},renderContainerContentTypeList:function(t){var e,i,s,a,o,r=this.data.containers[t],n="",l="",d="",h="",p="",c=!1;void 0!==r.data.sub_selector?(n+=this.renderSubSelector(t),e=r.data.rows[this.subSelectorState[t]]):e=r.data.rows;var u=!1;for(s in this.data.containers)if(this.data.containers.hasOwnProperty(s)&&"favorites"==this.data.containers[s].type){u=this.data.containers[s];break}if(u){var g=[];for(s in u.data.rows)if(u.data.rows.hasOwnProperty(s)){var m=u.data.rows[s];m.id&&g.push(m.id)}}else g=this.favorites;switch(n+="",this.options.theme){case"jqm":n+='
    ';break;default:n+='',n+="","none"!=this.data.global.options.favorites_mode&&(n+='');var f=0;for(s in r.data.fields.data)r.data.fields.data.hasOwnProperty(s)&&f++;var _=0;for(s in r.data.fields.data)r.data.fields.data.hasOwnProperty(s)&&((i=r.data.fields.data[s]).width||(i.width="auto"),l="",i.class&&(l+=i.class),_+1==f&&(l+=" last"),l&&(l=' class="'+l+'"'),n+="'+i.name+"",_++);n+=""}if(e.length){switch(this.options.theme){case"jqm":break;default:var v=0;for(void 0!==r.data.options.num_results&&e.length";else{h+=' style="cursor:pointer"';var b="?content=detail&fpid=search&pid=search&idp="+o.id+"&lang="+this.options.lang+"&event="+this.data.settings.global_event;n+="
  • '}break;default:if(void 0===o.id?n+='
  • ":n+="","none"!=this.data.global.options.favorites_mode){var k="";k=this.data.global.options.favorite_titles[this.favorites.indexOf(o.id)]?this.data.global.options.favorite_titles[this.favorites.indexOf(o.id)]:"",k=this.data.global.options.favorite_titles[g.indexOf(o.id)]?this.data.global.options.favorite_titles[g.indexOf(o.id)]:"",n+='"}}_=0;for(var w in r.data.fields.data)if(r.data.fields.data.hasOwnProperty(w)){i=r.data.fields.data[w],l="",p=y?i.type:"fillup",i.class&&(l+=i.class),_+1==f&&(l+=" last");var j="";switch("add_favorite"==p&&(l+=" icon s favorite-toggle"),l&&(j=' class="'+l+'"'),this.options.theme){case"jqm":switch(p){case"add_favorite":break;case"trend":o[i.field]?n+=this.renderTrendField(o,i,j,""):n+="";break;default:"name"==i.role?n+="

    "+(void 0!==o[i.field]&&null!=o[i.field]?o[i.field]:"")+"

    ":"actual_split_time"==i.field?n+='
    '+i.name+""+(void 0!==o[i.field]&&null!=o[i.field]?o[i.field]:"")+"
    ":n+='
    '+i.name+""+(void 0!==o[i.field]&&null!=o[i.field]?o[i.field]:"")+"
    "}break;default:switch(p){case"add_favorite":n+=c?"':"';break;case"trend":o[i.field]?n+=this.renderTrendField(o,i,j,""):n+="";break;case"fillup":n+=" ";break;default:n+=""+(void 0!==o[i.field]&&null!=o[i.field]?o[i.field]:"")+""}}_++}switch(this.options.theme){case"jqm":n+=c?'
    ":'";break;default:n+=""}}}else{var C=5;switch(r.data.options.num_results&&(C=r.data.options.num_results),this.options.theme){case"jqm":n+='
  • '+this.strings.no_results+"
  • ";break;default:n+='"}}switch(this.options.theme){case"jqm":n+="";break;default:n+="
     
    '+k+"
    '+this.strings.no_results+"
    "}return n},renderOptionBar:function(t){var e,i="";if(void 0!==this.data.global.global_option_bar&&this.data.global.global_option_bar.fields.length){var s=this.data.global.global_option_bar;if(t||(i+='
    '),i+='
    ',void 0!==s.fields&&s.fields.length)for(var a in s.fields)if(s.fields.hasOwnProperty(a)){var o=s.fields[a];switch(this.options.theme){case"jqm":s.fields.length>1?(i+='
    ',i+=' ",i+='");break;default:i+='
    ',i+=""+o.title+" ",i+='",i+="
    "}if(void 0!==s.options&&void 0!==s.options.hideable&&s.options.hideable&&(i+="Hide"),void 0!==s.options.limits&&s.options.limits.length){switch(this.options.theme){case"jqm":i+='
    ',i+='"}for(e in s.options.limits)s.options.limits.hasOwnProperty(e)&&(r="",void 0!==this.data.settings&&this.data.settings.limit==s.options.limits[e]&&(r=' selected="selected"'),i+='");i+="",i+="
    "}if("undefined"!=s.options.show_last_update&&!0===s.options.show_last_update)switch(this.options.theme){case"jqm":break;default:i+='
    ',i+=this.strings["resultsboard.last_update"]+' ',void 0!==s.options.last_update_count_up&&!0===s.options.last_update_count_up?i+='':i+=this.formatTime(new Date),i+="",i+="
    "}i+='
    ',i+="",t||(i+="
    ")}return void 0!==s.options&&void 0!==s.options.hideable&&s.options.hideable&&(i+="."),t?(jQuery("#optionbar-global").html(i),""):i},renderSubSelector:function(t){var e,i,s,a,o,r,n,l="",d="",h="",p="",c="",u=this.data.containers[t];if("auto"==u.data.options.sub_selector_mode&&(r=jQuery(".lb-container.container-id-"+t).width()?jQuery(".lb-container.container-id-"+t).width()/u.data.sub_selector.length-1:jQuery(".lb-col.col-id-"+u.col).width()/u.data.sub_selector.length-1,u.data.options.sub_selector_mode=r>30?"buttons":"dropdown"),"buttons"==u.data.options.sub_selector_mode){switch(this.options.theme){case"jqm":l+='
    ';break;default:u.data.options.sub_selector_class?l+='
    ':l+='
    '}for(e in u.data.sub_selector)u.data.sub_selector.hasOwnProperty(e)&&u.data.sub_selector[e].has_data&&e;if(r=0,n="","calc"==u.data.options.sub_selector_width)switch(this.options.theme){case"jqm":r=100/u.data.sub_selector.length,r-=.1*(u.data.sub_selector.length+1),n="%;";break;default:r=jQuery(".lb-container.container-id-"+t).width()?jQuery(".lb-container.container-id-"+t).width()/u.data.sub_selector.length-1:jQuery(".lb-col.col-id-"+u.col).width()/u.data.sub_selector.length-1,n="px;"}else u.data.options.sub_selector_width&&(r=u.data.options.sub_selector_width);isNaN(r)||(r*=u.data.options.sub_selector_width_factor),s=r+n,i=0;for(e in u.data.sub_selector)if(u.data.sub_selector.hasOwnProperty(e)){switch(a=u.data.sub_selector[e],p="",d="",h="width:"+s,a.color&&(h+="background-color:"+a.color+";"),a.class&&(d+=a.class+" "),o=!1,e==this.subSelectorState[t]&&(d+="selected ",p+=' data-theme="a"',o=!0),a.has_data&&(d+="active ",o||(p+=' data-theme="b"')),i+1==u.data.sub_selector.length&&(d+="last "),h&&(h='style="'+h+'" '),this.options.theme){case"jqm":l+="'+a.name+"";break;default:l+="'+a.name+""}i++}l+="
    "}else if("dropdown"==u.data.options.sub_selector_mode){l+='"}return l},updateContainerContentTypeFavorites:function(t,e){var i,s=this.data.containers[t];for(i in s.data.rows)s.data.rows.hasOwnProperty(i)&&s.data.rows[i].id&&this.renderFavorite(s.data.rows[i],s.data.fields.data,s.data.options,"",i,!0,e);if("position"==s.data.options.order_by)for(var a in s.data.split_groups.data){var o=s.data.split_groups.data[a].name;jQuery(".favorite-boxes .split-group-"+o+" .replay-barrier").remove();for(i in this.favoritesOrderLive[o])this.favoritesOrderLive[o].hasOwnProperty(i)&&jQuery("#f-"+this.favoritesOrderLive[o][i]).appendTo(".favorite-boxes .split-group-"+o);if(this.data.global.options.replay_mode&&this.favoritesOrderReplay[o]&&this.favoritesOrderReplay[o].length){jQuery(".favorite-boxes .split-group-"+o).append('
    REPLAY
    ');for(i in this.favoritesOrderReplay[o])this.favoritesOrderReplay[o].hasOwnProperty(i)&&jQuery("#f-"+this.favoritesOrderReplay[o][i]).appendTo(".favorite-boxes .split-group-"+o)}}},renderContainerContentTypeFavorites:function(t){var e=this.data.containers[t],i="";i+='
    ',this.data.global.options.show_clear_button&&(i+=' "+this.strings.clear+""),this.data.global.options.show_search&&(i+=' '),this.data.global.options.show_details_button&&(i+='
    '+this.strings.show_details+'
    '),i+="
    ",i+='
    ';var s=2;if(this.data.global.options.favorite_cols&&(s=this.data.global.options.favorite_cols),s=parseInt(s),"calc"==e.data.options.width){var a="";(a=jQuery(".lb-container.container-id-"+t).width()?jQuery(".lb-container.container-id-"+t).width()/s:jQuery(".lb-col.col-id-"+e.col).width()/s)<220&&(s=1,a=jQuery(".lb-container.container-id-"+t).width()?jQuery(".lb-container.container-id-"+t).width()/s:jQuery(".lb-col.col-id-"+e.col).width()/s),s>1&&(a-=4,a+=3/s),a+="px;"}else a=!!e.data.options.width&&e.data.options.width;var o=!1;for(var r in e.data.split_groups.data){var n=e.data.split_groups.data[r];if(e.data.split_groups.data.length>1&&e.data.options.use_split_groups){if(a)var l="width:"+a+";";else l="";(r+1)%s==0&&(l+="margin-right:0;"),i+='
    ',i+='
    '+n.title+"
    "}else i+='
    ';for(var d in e.data.rows){if(a)l="width:"+a+";";else l="";if(e.data.rows.hasOwnProperty(d)&&e.data.rows[d].id){var h=!1,p=!1;jQuery.each(e.data.rows[d].split_groups,function(t,e){e.active&&(h=e,p=t)}),h||jQuery.each(e.data.rows[d].split_groups,function(t,e){return h=e,p=t,!1}),e.data.options.use_split_groups&&h.name!=n.name||(o=!0,d=parseInt(d),i+=this.renderFavorite(e.data.rows[d],e.data.fields.data,e.data.options,l,d))}}if(i+="
    ",!e.data.options.use_split_groups)break}return o||(this.data.global.options.replay_mode?i+='
    '+this.strings.help_favorites_replay+"
    ":i+='
    '+this.strings.help_favorites+"
    "),i+="
    "},renderFavorite:function(t,e,i,s,a,o,r){var n=[],l=!1,d="";for(var h in e)if(e.hasOwnProperty(h)){var p=e[h];p.active&&(p.split||-1==p.field.search("time_finish_")&&-1!=p.field.search("place")&&(n.push(p),t[p.field]>0&&(l=!0)))}var c=this.renderFavoritesHead(t,e,a,i);if(c+='
    ',c+=this.renderFavoritesPrimaryFields(t,e,i),c+="
    ",l&&n.length,i.collapsible||(n.length>1&&(c+='
    ',c+=this.renderFavoritesPlaces(t,n,i),c+="
    "),this.data.global.options.show_details&&(c+='
    ',c+=this.renderFavoritesSplits(t,e,i),c+="
    ")),i.collapsible&&!r){var u=this.renderFavoritesHead(t,e,a,i);u+='
    ',u+=this.renderFavoritesSecondaryFields(t,e,i),u+="
    ",n.length>1&&(u+='
    ',u+=this.renderFavoritesPlaces(t,n,i),u+="
    "),this.data.global.options.show_details&&(u+='
    ',u+=this.renderFavoritesSplits(t,e,i),u+="
    "),u+='
    ',u+='close details',u+="drag box to detach",u+="
    "}if(!o){s=' style="'+s+'"';var g="info-box favorite-wrap";if(g+=" index-"+a,a%2&&(g+=" highlight"),this.options.addFavorite==t.id&&(g+=" favorite-active"),d+='
    ',d+='
    ',d+='
    ',d+=c,d+="
    ",i.collapsible){d+='
    ',d+='show details',d+='
    ',d+="
    ";var m=this.options.globalObjectName;this.events.click.push({selector:"#f-"+t.id+" .button-secondary.open",func:function(e){window[m].openFavoriteDetails(t.id,{top:e.pageY,left:e.pageX})}}),this.events.mouseover.push({selector:"#f-"+t.id+" .sensitive",func:function(e){jQuery("#f-"+t.id).addClass("mouseover")}}),this.events.mouseout.push({selector:"#f-"+t.id+" .sensitive",func:function(e){jQuery("#f-"+t.id).removeClass("mouseover")}})}return d+="
    ",i.collapsible&&(d+='
    ',d+=u,d+="
    "),d+="
    "}jQuery("#f-"+t.id+" .info-primary").html(c),i.collapsible&&!r&&jQuery("#f-"+t.id+" .info-secondary").html(u)},renderFavoritesPrimaryFields:function(t,e,i){var s=[],a="";t.is_in_replay&&(a+='
    R
    ');var o=0,r=0;for(var n in e)if(e.hasOwnProperty(n)){(l=e[n]).active&&(l.split||-1==l.field.search("time_finish_")&&(-1==l.field.search("place")?i.collapsible&&!l.primary||l.hide||r++:s.push(l)))}for(var n in e)if(e.hasOwnProperty(n)){var l;if((l=e[n]).active&&!l.split&&-1==l.field.search("time_finish_"))if(-1==l.field.search("place")){if((!i.collapsible||l.primary)&&!l.hide){if((!i.divide_fields&&0==o||o%i.divide_fields==0)&&(a+='',a+=""),null==t[l.field]&&(t[l.field]=""),"position_info"==l.type){var d=this.getPersonInfoStrings(t);t[l.field]=d.title}if("diff_time"==l.type){var h=!1;for(var p in t.split_groups)t.split_groups[p].active&&(h=t.split_groups[p]);if(!h)for(p in t.split_groups){h=t.split_groups[p];break}t[l.field]=h.diff_time_string}if("current_group"==l.type){h=!1;for(var p in t.split_groups)t.split_groups[p].active&&(h=t.split_groups[p]);if(!h)for(p in t.split_groups){h=t.split_groups[p];break}t[l.field]=h.title}if("diff_km"==l.type){h=!1;for(var p in t.split_groups)t.split_groups[p].active&&(h=t.split_groups[p]);if(!h)for(p in t.split_groups){h=t.split_groups[p];break}t[l.field]=h.diff_km_string}a+='",++o%i.divide_fields!=0&&o!=r||(a+="",a+="
    '+l.name+''+t[l.field]+"
    "),1===s.length&&(t[s[0].field]||(t[s[0].field]="-"),a+=''+s[0].name+''+t[s[0].field]+"")}}else s.push(l)}return a},renderFavoritesSecondaryFields:function(t,e,i){var s='';s+="";for(var a in e)if(e.hasOwnProperty(a)){var o=e[a];o.active&&(o.split||-1==o.field.search("time_finish_")&&-1==o.field.search("place")&&(i.collapsible&&o.primary||o.hide||(null==t[o.field]&&(t[o.field]=""),s+='",0)))}return s+="",s+="
    '+o.name+''+t[o.field]+"
    "},renderFavoritesSplits:function(t,e,i){var s,a,o,r,n=0,l="";for(var d in t.splits)if(t.splits.hasOwnProperty(d)){if(!i.divide_splits&&0==n||n%i.divide_splits==0){l+='',l+="",l+="",s=0;for(o in e)e.hasOwnProperty(o)&&e[o].active&&e[o].split&&s++;r=0;for(o in e)e.hasOwnProperty(o)&&e[o].active&&e[o].split&&(a="",0==r&&(a+=" desc"),r+1==s&&(a+=" last"),e[o].class&&(a+=" "+e[o].class),a&&(a=' class="'+a+'"'),l+=""+e[o].name+"",r++);l+="",l+="",l+=""}l+="",r=0;for(o in e)e.hasOwnProperty(o)&&e[o].active&&e[o].split&&(a="",0==r&&(a+=" desc"),r+1==s&&(a+=" last"),e[o].class&&(a+=" "+e[o].class),a&&(a=' class="'+a+'"'),l+=""+t.splits[d][e[o].field]+"",r++);l+="",++n%i.divide_splits!=0&&n!=t.splits.length||(l+="",l+="
    ")}return l},renderFavoritesPlaces:function(t,e,i){var s,a="",o='';o+="",o+="",o+='";for(s in e)e.hasOwnProperty(s)&&(o+='");o+="",o+="",o+="",o+="",o+='';for(s in e)e.hasOwnProperty(s)&&(a="",a=null==t[e[s].field]?"-":t[e[s].field],o+='");return o+="",o+="",o+="
    '+this.strings.places+"'+e[s].name+"
    '+a+"
    "},renderFavoritesHead:function(t,e,i,s){var a="";a=this.data.global.options.favorite_titles[i]?this.data.global.options.favorite_titles[i]:"";var o,r="",n="";for(o in e)e.hasOwnProperty(o)&&e[o].active&&e[o].head&&(e[o].name&&(n=e[o].name+": "),r+=' '+n+t[e[o].field]+"");var l='
    ';return l+='
    '+a+"
    ",l+=r,l+='
    '+this.strings.remove+'
    ',l+="
    "},openFavoriteDetails:function(t,e){var i=jQuery("#f-"+t+" .info-secondary");i.css({display:"block"});var s=i.position(),a=i.offset(),o=s.top+(e.top-a.top),r=s.left+(e.left-a.left);i.css({display:"block",left:r+"px",top:o+"px"}),i.draggable({snap:!0,cursor:"move",start:function(){jQuery("#f-"+t).addClass("dragged")}})},closeFavoriteDetails:function(t,e){jQuery("#f-"+t+" .info-secondary").css({display:"none"}),jQuery("#f-"+t).removeClass("dragged")},renderContainerContentTypeMap:function(t){var e="";if(e+='
    ',this.data.global.options.show_search&&(e+=' "),e+=' "+this.strings.map_center+"",e+=' "+this.strings.autozoom+"",this.getContainerByType("overlays")){this.data.global.options.tooltip_intros.map_overlays?e+=' '+this.strings.map_overlays+"":e+=' '+this.strings.map_overlays+"";var i=this.options.globalObjectName;this.eventsDelete.click.push({selector:".button-map-overlays"}),this.events.click.push({selector:".button-map-overlays",func:function(t){return window[i].trigger("switchOverlayMenu",{top:t.pageY,left:t.pageX}),!1}})}if(e+="
    ",e+='
    ',this.data.global.options.replay_mode){if(e+='
    ',e+='
    ',e+=' '+this.strings.replay_play+"",e+=' '+this.strings.replay_stop+"",e+=' '+this.strings.replay_rewind+"",e+="
    ",e+='
    ',e+=' '+this.strings.slider_start+"",e+=' '+this.strings.slider_finish+"",this.data.global.options.tooltip_intros.map_slider)var s="tt-oninit";this.data.global.options.replay_daytime?e+=' '+this.strings.replay_daytime+' 00:00:00':e+=' '+this.strings.replay_racetime+' 00:00:00',e+=' ',e+="
    ",e+='
    ',e+=' '+this.strings.replay_speed+' ',e+=' ',e+="
    ",e+='
    ',e+="
    "}return e+=this.renderOverlayMenu(),e+=''},renderOverlayMenu:function(){var t=this.getContainerByType("overlays"),e="",i="",s=this.options.globalObjectName;if(t){e+='"}return e},switchFullscreen:function(){var t;if("fixed"!=jQuery(".cbox.left .list").css("position")){this.fullscreen_old_style={height:jQuery(".cbox.left .list").css("height"),position:"relative",width:jQuery(".cbox.left .list").css("width"),overflow:"inherit"};for(t in this.data.containers)if(this.data.containers.hasOwnProperty(t)&&"map"==this.data.containers[t].type){this.fullscreen_map_old_style={height:jQuery("#map-container-"+this.data.containers[t].id).css("height")};break}jQuery(".cbox.left .list").css({position:"fixed",overflow:"hidden",zIndex:9999,margin:0,top:0,left:0,width:jQuery(window).width()+"px",height:jQuery(window).height()+"px"}),jQuery(".cbox.left .list").addClass("is-fullscreen"),this.render();for(t in this.data.containers)if(this.data.containers.hasOwnProperty(t)&&"map"==this.data.containers[t].type){jQuery(".tt-help").tooltip("disable"),jQuery("#map-container-"+this.data.containers[t].id).css("height",jQuery(window).height()-142+"px"),this.mapInit(this.data.containers[t].id),this.mapInitSliders(),this.registerTooltips();break}}else{jQuery(".cbox.left .list").css(this.fullscreen_old_style),jQuery(".cbox.left .list").removeClass("is-fullscreen"),this.render();for(t in this.data.containers)if(this.data.containers.hasOwnProperty(t)&&"map"==this.data.containers[t].type){jQuery(".tt-help").tooltip("disable"),jQuery("#map-container-"+this.data.containers[t].id).css(this.fullscreen_map_old_style),this.mapInit(this.data.containers[t].id),this.mapInitSliders(),this.registerTooltips();break}}},getReplaySpeedFromIndex:function(t){return this.data.global.options.replay_speeds[t]},getContainerByType:function(t){for(i=0;i"+t.start_no_text+" "+t.__fullname+"
    ("+this.strings.finished+")"):"started"==l.estimated_pos||"started"==l.state?(a=this.strings.started,o+=""+t.start_no_text+" "+t.__fullname+"
    ("+this.strings.started+")"):(a=this.strings.not_started,o+=""+t.start_no_text+" "+t.__fullname):(l.estimated_pos_string||(l.estimated_pos_string=l.estimated_pos),o+=""+t.start_no_text+" "+t.__fullname,o+="
    "+l.estimated_pos_string+" km",a+=l.estimated_pos_string+" km",this.data.global.options.show_map_miles&&(o+="/"+t.__estimated_pos_factor+" Miles",a+="/"+t.__estimated_pos_factor+" Miles"),t.__estimated_finish&&(o+="
    "+this.strings.estimated_finish+": "+t.__estimated_finish),t.__estimated_finish_daytime&&(o+="
    "+this.strings.estimated_finish_daytime+": "+t.__estimated_finish_daytime)),r+=o,o=''+o,e?a+=" "+this.strings.click_to_follow:i?(o='',o+=''+this.data.global.options.favorite_titles[s]+"",o+=''+t.start_no_text+" "+t.__fullname,t.subtitle&&(o+="
    "+t.subtitle),o+="
    ",n="marker-person small details-short",r=this.data.global.options.favorite_titles[s]):(o='',o+=''+this.data.global.options.favorite_titles[s]+"",n="marker-person small",r=this.data.global.options.favorite_titles[s]),n+=" fav-color i-"+s,{title:a,label:o,summary:r,css_class:n}},mapInit:function(t){if("object"==typeof google.maps||"function"==typeof google.maps){this.maps[t]=new google.maps.Map(document.getElementById("map-container-"+t));var e;switch(this.data.global.options.map_type){case"satellite":e=google.maps.MapTypeId.SATELLITE;break;case"hybrid":e=google.maps.MapTypeId.HYBRID;break;case"physical":case"terrain":e=google.maps.MapTypeId.TERRAIN;break;default:e=google.maps.MapTypeId.ROADMAP}if(this.maps[t].setOptions({mapTypeId:e,zoom:8}),this.data.containers[t].data.tracks){this.mapPolylines[t]=[],this.mapMarkers[t]=[],this.mapMarkersPersons[t]=[],this.mapMarkersFree[t]=[],this.mapBounds[t]=new google.maps.LatLngBounds;var i=0;for(var s in this.data.containers[t].data.tracks)if(this.data.containers[t].data.tracks.hasOwnProperty(s)){var a=!1;i==this.data.containers[t].data.tracks.length-1&&(a=!0),this.mapPolylines[t][s]=this.mapInitTrack(t,this.data.containers[t].data.tracks[s],this.data.containers[t].data.fields.data,a),i++,this.maps[t].fitBounds(this.mapBounds[t])}}}this.mapUpdate(t),this.mapUpdateOverlays(t)},mapInitTrack:function(t,e,i,s){var a="#0000ff";e.color&&(a=e.color);var o=new google.maps.Polyline({strokeColor:a,strokeWeight:4,strokeOpacity:.8}),r=google.maps.geometry.encoding.decodePath(e.points_encoded);o.setPath(r),o.setMap(this.maps[t]);for(var n=0;nkm",labelAnchor:new google.maps.Point(8,31),labelClass:"marker-km",zIndex:h,labelZIndex:h+1}),h++,d+=1e3*e.km_marker}if(e.custom_marker)for(var p in e.custom_marker)if(e.custom_marker.hasOwnProperty(p)){var c,u=e.custom_marker[p];(c=moveAlongPath(i,1e3*u.km))&&new MarkerWithLabel({icon:o=new google.maps.MarkerImage(this.options.path_images+"/map_marker_grey.png",new google.maps.Size(32,37),new google.maps.Point(0,0),new google.maps.Point(16,37)),position:c,draggable:!1,map:this.maps[t],labelContent:u.title,labelAnchor:new google.maps.Point(10,31),labelClass:"marker-km custom",labelStyle:{opacity:1}})}var g=i.getPath().getAt(i.getPath().getLength()-1);g&&(r=a?this.options.path_images+"/map_flag_finish.png":this.options.path_images+"/map_flag_blue.png",o=new google.maps.MarkerImage(r,new google.maps.Size(32,37),new google.maps.Point(0,0),new google.maps.Point(11,30)),new google.maps.Marker({position:g,map:this.maps[t],icon:o}));var m=i.getPath().getAt(0);m&&(o=new google.maps.MarkerImage(this.options.path_images+"/map_flag_start.png",new google.maps.Size(32,37),new google.maps.Point(0,0),new google.maps.Point(11,30)),new google.maps.Marker({position:m,map:this.maps[t],icon:o}))},mapUpdate:function(t){var e=this.getContainerByType("favorites");if(!e)return!1;for(var i in e.data.rows)if(e.data.rows.hasOwnProperty(i)){var s=e.data.rows[i];if(!s.id)return!0;var a=s.split_groups[s.global_info.active_group_key];if(void 0===this.mapMarkerCluster[t]&&(this.mapMarkerCluster[t]={}),a.estimated_pos||0===a.estimated_pos){var o,r="";if(jQuery.each(this.data.containers[t].data.mappings.tracks,function(t,e){if(e.event_ids&&-1==e.event_ids.indexOf(s.event))return!0;if(s.start_group&&e.start_groups&&-1==e.start_groups.indexOf(s.start_group))return!0;if(e.split_groups&&-1==e.split_groups.indexOf(s.global_info.active_group_key))return!0;if(e.field_values)for(var i in e.field_values)if(e.field_values.hasOwnProperty(i)&&-1==e.field_values[i].indexOf(s[i]))return!0;return r=e.track,!1}),!r)continue;void 0!==(o=this.mapPolylines[t][r])&&this.mapUpdatePersonMarker(t,r,o,s,i)}}if(this.data.containers[t].data.options.clustering)for(r in this.data.containers[t].data.tracks)if(this.data.containers[t].data.tracks.hasOwnProperty(r))if(this.mapMarkerCluster[t]||(this.mapMarkerCluster[t]={}),this.mapMarkerCluster[t]&&void 0===this.mapMarkerCluster[t][r]&&(this.mapMarkerCluster[t][r]={}),this.mapMarkerCluster[t]&&"function"==typeof this.mapMarkerCluster[t][r].repaint)this.mapMarkerCluster[t][r].repaint();else{this.mapMarkerClusterIcons[t]=[];for(var n in this.data.containers[t].data.mappings.markers){var l=this.data.containers[t].data.mappings.markers[n];if(l.cluster_sizes){var d=this.data.containers[t].data.markers[l.marker];d.icon.anchor||(d.icon.anchor=[32,32]),d.icon.height||(d.icon.height=32),d.icon.width||(d.icon.width=32),d.icon.url&&this.mapMarkerClusterIcons[t].push({url:d.icon.url,height:d.icon.height,width:d.icon.width,anchor:[20,20],anchorIcon:[d.icon.anchor[0],d.icon.anchor[1]],mapping:l})}}var h=this.mapMarkerClusterIcons[t];this.mapMarkerCluster[t][r]=new MarkerClusterer(this.maps[t],this.mapMarkersPersons[t],{gridSize:20,calculator:function(t,e){var i=0,s="",a=0,o=0,r=0;for(var n in t)t.hasOwnProperty(n)&&("e"==t[n].clusterSummaryDirection&&a++,"w"==t[n].clusterSummaryDirection&&o++,"not_started"!=t[n].clusterSummaryPosition&&"finished"!=t[n].clusterSummaryPosition||r++,t[n].clusterSummary&&(s+=""+t[n].clusterSummary+""));var l={count:t.length};l.count>4&&(l.count=4),r==t.length?l.state="not_started":(l.state="started",l.direction=a>o?"e":"w");for(var d in h){var p=h[d].mapping;if((!p.cluster_sizes||-1!=p.cluster_sizes.indexOf(l.count))&&!(p.directions&&-1==p.directions.indexOf(l.direction)||p.states&&-1==p.states.indexOf(l.state))){i=parseInt(d)+1;break}}var c='
    '+s+"
    ";return{text:l.count,index:i,title:"",html:c}},styles:this.mapMarkerClusterIcons[t]})}if(this.favoritesSelected){var p=new google.maps.LatLngBounds,c=0;for(var n in this.mapMarkersPersons[t])this.mapMarkersPersons[t].hasOwnProperty(n)&&-1!=this.favoritesSelected.indexOf(this.mapMarkersPersons[t][n].favoriteId)&&(c++,p.extend(this.mapMarkersPersons[t][n].getPosition()));this.mapAutoZoom&&c>1?(this.maps[t].fitBounds(p),this.data.containers[t].data.options.autozoom_add&&this.maps[t].setZoom(this.maps[t].getZoom()+this.data.containers[t].data.options.autozoom_add)):this.mapAutoZoom&&1==c?(this.maps[t].setCenter(p.getCenter()),this.maps[t].setZoom(15)):c&&this.maps[t].setCenter(p.getCenter())}},getDevicePixelRatio:function(){var t=1;return void 0!==window.screen.systemXDPI&&void 0!==window.screen.logicalXDPI&&window.screen.systemXDPI>window.screen.logicalXDPI?t=window.screen.systemXDPI/window.screen.logicalXDPI:void 0!==window.devicePixelRatio&&(t=window.devicePixelRatio),t},mapFetchIcons:function(t,e){var i={},s="",a="",o="",r="";for(var n in t)t.hasOwnProperty(n)&&n.substr(0,e.length)==e&&((i=this.mapFetchIcon(e,n,"marker")).icon&&(s=t[n],a=i.ratio),(i=this.mapFetchIcon(e,n,"settings")).icon&&(o=t[n],r=i.ratio));for(var n in t)t.hasOwnProperty(n)&&(s||(i=this.mapFetchIcon("",n,"marker")).icon&&(s=t[n],a=i.ratio),o||(i=this.mapFetchIcon("",n,"settings")).icon&&(o=t[n],r=i.ratio));return{icon_settings:o,icon_settings_ratio:r,icon_marker:s,icon_marker_ratio:a}},mapFetchIcon:function(t,e,i){var s="",a=null;return t&&(shift_substr=t.length+1),e.substr(0,i.length+3)==i+"@3x"&&3==this.pixelRatio?(s=e,a=3):"@2x"==e.substr(0,i.length+3)&&2==this.pixelRatio?(s=e,a=2):e.substr(0,i.length)==i&&(s=e,a=1),{icon:s,ratio:a}},mapUpdateOverlays:function(t){var e=this.getContainerByType("overlays");if(e)for(var i in e.data.rows)if(e.data.rows.hasOwnProperty(i)){var s=e.data.rows[i];if(-1!=this.mapOverlays.indexOf(s.id)){if(s.icons)var a=this.mapFetchIcons(s.icons,"resultsboard");for(var o in s.points)if(s.points.hasOwnProperty(o)){var r=this.mapFetchIcons(s.points[o].icons,"resultsboard"),n={};n=r.icon_marker?r.icon_marker:a.icon_marker,this.mapUpdateMarker(t,{icon:n,position_latlng:s.points[o].position_latlng,title:s.points[o].title,description:s.points[o].description,show_label:s.show_label,detail_window:s.show_label},s.id,o)}}else{for(o in this.mapMarkers[t][s.id])this.mapMarkers[t][s.id].hasOwnProperty(o)&&this.mapMarkers[t][s.id][o].setMap(null);this.mapMarkers[t][s.id]=[]}}},mapUpdateMarker:function(t,e,i,s){var a={},o=["icon","shadow"];for(var r in o)if(o.hasOwnProperty(r)){var n=o[r];e[n]&&(a[n]=new google.maps.MarkerImage,e[n].url&&(a[n].url=e[n].url),e[n].width&&e[n].height&&(a[n].size=new google.maps.Size(e[n].width,e[n].height)),e[n].anchor&&(a[n].anchor=new google.maps.Point(e[n].anchor[0],e[n].anchor[1])),e[n].origin&&(a[n].origin=new google.maps.Point(e[n].origin[0],e[n].origin[1])))}a.icon||(a.icon=new google.maps.MarkerImage,a.icon.url="http://maps.gstatic.com/intl/de_ALL/mapfiles/ms/micons/man.png",a.icon.anchor=new google.maps.Point(16,32)),a.shadow||(a.shadow=new google.maps.MarkerImage,a.shadow.url="http://maps.gstatic.com/intl/de_ALL/mapfiles/ms/micons/man.shadow.png",a.shadow.anchor=new google.maps.Point(16,32)),void 0===this.mapMarkers[t][i]&&(this.mapMarkers[t][i]={});var l=new google.maps.LatLng(e.position_latlng[0],e.position_latlng[1]);if(this.mapMarkers[t][i][s])this.mapMarkers[t][i][s].setPosition(l),this.mapMarkers[t][i][s].setOptions({labelContent:e.title,optimized:!1}),this.mapMarkers[t][i][s].setIcon(a.icon),this.mapMarkers[t][i][s].setShadow(a.shadow);else{e.show_label?(this.mapMarkers[t][i][s]={},this.mapMarkers[t][i][s]=new MarkerWithLabel({icon:a.icon,shadow:a.shadow,optimized:!1,position:l,draggable:!1,labelContent:e.title,labelAnchor:new google.maps.Point(-10,20),labelClass:"marker-person marker-group marker-group-"+i})):(this.mapMarkers[t][i][s]={},this.mapMarkers[t][i][s]=new google.maps.Marker({icon:a.icon,shadow:a.shadow,optimized:!1,position:l,draggable:!1})),this.mapMarkers[t][i][s].setMap(this.maps[t]);var d=this.options.globalObjectName,h=new google.maps.OverlayView;h.draw=function(){},h.setMap(this.maps[t]),google.maps.event.addListener(this.mapMarkers[t][i][s],"mouseover",function(t){var a="

    "+e.title+"

    ";a+='
    '+e.description+"
    ";var o=h.getProjection().fromLatLngToContainerPixel(t.latLng);window[d].trigger("openInfoWindow",{index:s,groupKey:i,top:o.y,left:o.x,html:a})}),google.maps.event.addListener(this.mapMarkers[t][i][s],"mouseout",function(t){window[d].trigger("closeInfoWindow",{})})}return!0},mapUpdatePersonMarker:function(t,e,i,s,a){var o="",r=!1,n=s.split_groups[s.global_info.active_group_key];if(i){var l=0;isNaN(n.estimated_pos)?"finished"==n.estimated_pos?r=i.getPath().getAt(i.getPath().getLength()-1):"started"==n.estimated_pos?r=moveAlongPath(i,0):"not_started"==n.estimated_pos&&(r=i.getPath().getAt(0)):(r=moveAlongPath(i,1e3*n.estimated_pos),l=n.estimated_pos)}if(!r)return!1;for(var d in this.data.containers[t].data.mappings.markers)if(this.data.containers[t].data.mappings.markers.hasOwnProperty(d)){var h=this.data.containers[t].data.mappings.markers[d];if(!(h.event_ids&&-1==h.event_ids.indexOf(s.event)||h.directions&&-1==h.directions.indexOf(r.direction)||h.sex&&-1==h.sex.indexOf(s.sex)||h.states&&-1==h.states.indexOf(n.state)||h.split_groups&&-1==h.split_groups.indexOf(s.global_info.active_group_key)||h.source&&-1==h.source.indexOf(s.position_data.source))){if(l>0&&h.force_marker_id&&this.data.containers[t].data.tracks[e].force_tracking_marker){var p=this.data.containers[t].data.tracks[e].force_tracking_marker,c=!1;for(var u in p)p.hasOwnProperty(u)&&p[u].from_km";w+="
    "+s.tracker_data.position[0]+","+s.tracker_data.position[1],this.mapMarkersPersons[t][s.id]?(this.mapMarkersPersons[t][s.id].setPosition(k),this.mapMarkersPersons[t][s.id].setOptions({clusterSummary:y.summary,clusterSummaryClass:y.css_class+" summary",clusterSummaryDirection:r.direction,clusterSummaryPosition:n.estimated_pos,labelContent:w,optimized:!1}),this.mapMarkersPersons[t][s.id].setIcon(g.icon),this.mapMarkersPersons[t][s.id].setShadow(g.shadow)):(this.mapMarkersPersons[t][s.id]={},this.mapMarkersPersons[t][s.id]=new MarkerWithLabel({dataId:s.id,icon:g.icon,shadow:g.shadow,favoriteId:s.id,optimized:!1,position:r,draggable:!1,clusterSummary:y.summary,clusterSummaryClass:y.css_class+" summary",clusterSummaryDirection:r.direction,clusterSummaryPosition:n.estimated_pos,labelContent:w,labelAnchor:new google.maps.Point(-20,30),labelClass:y.css_class,zIndex:999,labelZIndex:1e3}))}return!0},mapCenter:function(t){var e=new google.maps.LatLngBounds;for(var i in this.mapPolylines[t])if(this.mapPolylines[t].hasOwnProperty(i))for(var s=this.mapPolylines[t][i].getPath(),a=0;ao&&r.getMap().setZoom(o+1)},100)),s.cancelBubble=!0,s.stopPropagation&&s.stopPropagation()}}),google.maps.event.addDomListener(this.div_,"mouseover",function(){var t=i.cluster_.getMarkerClusterer();google.maps.event.trigger(t,"mouseover",i.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",function(){var t=i.cluster_.getMarkerClusterer();google.maps.event.trigger(t,"mouseout",i.cluster_)})},ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},ClusterIcon.prototype.draw=function(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}},ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},ClusterIcon.prototype.show=function(){if(this.div_){var t="",e=this.backgroundPosition_.split(" "),i=parseInt(e[0].trim(),10),s=parseInt(e[1].trim(),10),a=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(a),t="",this.sums_.html?this.div_.innerHTML=t+this.sums_.html:this.div_.innerHTML=t+"
    "+this.sums_.text+"
    ",void 0===this.sums_.title||""===this.sums_.title?this.div_.title=this.cluster_.getMarkerClusterer().getTitle():this.div_.title=this.sums_.title,this.div_.style.display=""}this.visible_=!0},ClusterIcon.prototype.useStyle=function(t){this.sums_=t;var e=Math.max(0,t.index-1);e=Math.min(this.styles_.length-1,e);var i=this.styles_[e];this.url_=i.url,this.height_=i.height,this.width_=i.width,this.anchorText_=i.anchorText||[0,0],this.anchorIcon_=i.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)],this.textColor_=i.textColor||"black",this.textSize_=i.textSize||11,this.textDecoration_=i.textDecoration||"none",this.fontWeight_=i.fontWeight||"bold",this.fontStyle_=i.fontStyle||"normal",this.fontFamily_=i.fontFamily||"Arial,sans-serif",this.backgroundPosition_=i.backgroundPosition||"0 0"},ClusterIcon.prototype.setCenter=function(t){this.center_=t},ClusterIcon.prototype.createCss=function(t){var e=[];return e.push("cursor: pointer;"),e.push("position: absolute; top: "+t.y+"px; left: "+t.x+"px;"),e.push("width: "+this.width_+"px; height: "+this.height_+"px;"),e.join("")},ClusterIcon.prototype.getPosFromLatLng_=function(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x-=this.anchorIcon_[1],e.y-=this.anchorIcon_[0],e.x=parseInt(e.x,10),e.y=parseInt(e.y,10),e},Cluster.prototype.getSize=function(){return this.markers_.length},Cluster.prototype.getMarkers=function(){return this.markers_},Cluster.prototype.getCenter=function(){return this.center_},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){var t,e=new google.maps.LatLngBounds(this.center_,this.center_),i=this.getMarkers();for(t=0;ts)t.getMap()!==this.map_&&t.setMap(this.map_);else if(ie)this.clusterIcon_.hide();else if(t0))for(t=0;t3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var o=this.getExtendedBounds(s),r=Math.min(t+this.batchSize_,this.markers_.length);for(e=t;e');for(var i in e)if("active"!=i){var s=document.createElement("audio");s.id="sound"+i.replace("url_",""),s.autoplay=!1,s.loop=!1,s.volume=1,s.preload="auto",document.getElementById("playSound").appendChild(s);var a=document.createElement("source");a.src=e[i],a.type="audio/wav",s.appendChild(a)}},playSound:function(t){document.getElementById("sound"+t)&&document.getElementById("sound"+t).play()}})}(jQuery),"function"!=typeof openQuicksearch){var openQuicksearch,waitForRequireJsAndInjectQuicksearchFunction=function(){"function"==typeof require?require(["Mika/Quicksearch","Mika/Tools"],function(t,e){jQuery(document).ready(function(){var i=new e,s=document.createElement("input");s.className="hidden",document.getElementsByTagName("body")[0].appendChild(s),openQuicksearch=new t({input:i.identify(s)}).openQuicksearchDetailDialog})}):setTimeout(arguments.callee,200)};waitForRequireJsAndInjectQuicksearchFunction()}var results_tfd_global={},tfd_object;MikaResultsTfd.prototype={result:[],prev_result:[],hash:"",hash_filters:"",config:"",options_submit:{},paused:!1,filter_fields:{},only_favorites:!1,requester:{},favorites:!1,ack_favorites:[],sound:!1,timer:{},clocks:{},ids_on_screen:[],init:function(){this.favorites||(this.favorites=[]);var t=document.cookie.match("results_favorites=(.*?)(;|$)");if(null!=t){t[1]=unescape(t[1]),favorites=t[1].split("|");for(i in favorites)favorites[i]&&jQuery.inArray(favorites[i],this.favorites)&&this.favorites.push(favorites[i])}void 0===this.filter_fields[this.options.obj]&&(this.filter_fields[this.options.obj]={}),this.options.localSettings=[],this.options.localSettings.push("paused"),this.options.localSettings.push("sound"),this.options.localSettings.push("only_favorites");var e=this.options.obj;this.options_submit={fields:{},options:{}},this.makeRequest("getTFDConfig",{lang:this.options.lang,pid:this.options.pid},function(t){window[e].setConfig(t),window[e].render(!1),jQuery.playSoundInit(t.sound)})},trackGA:function(t){"object"==typeof ga_track?ga_track.push(["_trackPageview","/"+t]):"undefined"!=typeof console&&this.options.debug&&console.info("Leaderboard: No GA")},setData:function(t){if("timeout"!=t.status){this.result=t,"update_filter"!=this.result.status&&(this.prev_result=this.result);for(var e in this.result.filters)for(var i in this.result.filters[e].values)if(this.result.filters[e].values[i].selected){this.options_submit.fields[this.result.filters[e].field]=this.result.filters[e].values[i].key,this.filter_fields[this.options.obj][this.result.filters[e].field]=this.result.filters[e].values[i].key;break}if("paused"==this.result.status)return this.render(!0),void window.setTimeout(this.options.obj+".load()",3e4);this.hash=this.result.hash,this.render(!0),this.reload()}else this.reload()},setConfig:function(t){this.config=t;var e=this.options.obj;this.config.shortcuts&&jQuery(document).keydown(function(t){"input"!=document.activeElement.nodeName.toLowerCase()&&"textarea"!=document.activeElement.nodeName.toLowerCase()&&("32"==t.keyCode&&window[e].switchPause(),"70"==t.keyCode&&window[e].switchFavorites(),"88"==t.keyCode&&window[e].switchFullscreen(),"65"==t.keyCode&&window[e].ackFavorites(),"84"==t.keyCode&&window[e].testSound())}),this.config.buttons_selected.favorites&&(this.only_favorites=!0),this.config.buttons_selected.sound&&(this.sound=!0),this.readConfig(),this.reload()},testSound:function(){if(this.config.sound.active&&this.sound){var t={};t.row=!0,t.update=!0,t.favorite=!0;for(i in t)void 0!==this.config.sound["url_"+i]&&this.config.sound["url_"+i]&&jQuery.playSound(i)}},readConfig:function(){if("undefined"!=typeof localStorage){for(var t in this.options.localSettings){null!=(a=localStorage.getItem("mikatfd_"+this.options.obj+"_config_"+this.options.localSettings[t]))&&("false"==a?a=!1:"true"==a&&(a=!0),this[this.options.localSettings[t]]=a)}var e=sessionStorage.getItem("mikatfd_"+this.options.obj+"_config_filters");if(e){var i=e.split(",");for(var s in i)if(i.hasOwnProperty(s)){null!=(a=sessionStorage.getItem("mikatfd_"+this.options.obj+"_config_field_"+i[s]))&&(this.options_submit.fields[i[s]]=a)}}null!=(a=sessionStorage.getItem("mikatfd_"+this.options.obj+"_config_field_lpc"))&&(this.options_submit.fields.lpc=a);var a;null!=(a=sessionStorage.getItem("mikatfd_"+this.options.obj+"_config_ack_favorites"))&&(this.ack_favorites=JSON.parse(a))}},saveConfig:function(){if("undefined"!=typeof localStorage){for(var t in this.options.localSettings)localStorage.setItem("mikatfd_"+this.options.obj+"_config_"+this.options.localSettings[t],this[this.options.localSettings[t]]);var e=[];for(var i in this.options_submit.fields)(this.options_submit.fields.hasOwnProperty(i)||this.options_submit.fields[i])&&(sessionStorage.setItem("mikatfd_"+this.options.obj+"_config_field_"+i,this.options_submit.fields[i]),e.push(i));sessionStorage.setItem("mikatfd_"+this.options.obj+"_config_filters",e.join(",")),this.options_submit.fields.lpc&&sessionStorage.setItem("mikatfd_"+this.options.obj+"_config_field_lpc",this.options_submit.fields.lpc),sessionStorage.setItem("mikatfd_"+this.options.obj+"_config_ack_favorites",JSON.stringify(this.ack_favorites))}},stop:function(){this.requester["getTFD"+this.options.obj].abort()},switchPause:function(){this.paused?(this.paused=!1,this.reload()):(this.requester["getTFD"+this.options.obj].abort(),this.paused=!0),this.saveConfig(),jQuery("#"+this.options.target+" #tfd-status-buttons").html(this.renderStatusButtons())},switchSound:function(){this.sound?this.sound=!1:this.sound=!0,this.saveConfig(),jQuery("#"+this.options.target+" #tfd-status-buttons").html(this.renderStatusButtons())},switchFavorites:function(){this.only_favorites?this.only_favorites=!1:this.only_favorites=!0,this.paused||(this.requester["getTFD"+this.options.obj].abort(),this.reload(!0)),this.saveConfig(),jQuery("#"+this.options.target+" #tfd-status-buttons").html(this.renderStatusButtons())},makeRequest:function(t,e,i){tfd_object=this.options.obj,this.requester[t+this.options.obj]=jQuery.ajax({type:"POST",url:"index.php?content=ajax2&func="+t,data:{func:t,options:e},success:i})},ackFavorites:function(){jQuery("#"+this.options.target+" .tfd-row.favorite").addClass("favorite-ack")},reloadAckFavoritesMark:function(){jQuery("#"+this.options.target).removeClass("favorite-ack");for(var t in this.ack_favorites)jQuery("#"+this.options.target+" #id-"+this.ack_favorites[t]).addClass("favorite-ack")},ackSwitchFavorite:function(t){if(-1!=this.ack_favorites.indexOf(t)){var e=[];if(-1!=this.ack_favorites.indexOf(t)){for(i in this.ack_favorites)this.ack_favorites[i]!=t&&e.push(this.ack_favorites[i]);this.ack_favorites=e}jQuery("#"+this.options.target+" #id-"+t).removeClass("favorite-ack")}else this.ack_favorites.push(t),jQuery("#"+this.options.target+" #id-"+t).addClass("favorite-ack");this.saveConfig()},load:function(){},reload:function(t){"function"==typeof window.hookTfdReload&&window.hookTfdReload(),this.only_favorites?this.options_submit.only_favorites=1:this.options_submit.only_favorites&&(this.options_submit.only_favorites=0),this.options_submit.pid=this.options.pid,this.options_submit.hash=this.hash,this.options_submit.hash_filters=this.hash_filters,this.options_submit.event=this.options.event,t?this.options_submit.last_seq=0:"ok"==this.result.status&&void 0!==this.result.data[0]&&void 0!==this.result.data[0].seq?this.options_submit.last_seq=this.result.data[0].seq:"update_filter"!=this.result.status&&(this.options_submit.last_seq=0);var e=this.options.obj;this.makeRequest("getTFD",{options:this.options_submit},function(t){window[e].setData(t)})},setFilter:function(t,e,i){this.paused&&this.switchPause(),this.filter_fields[this.options.obj][t]!=e||i?this.filter_fields[this.options.obj][t]=e:delete this.filter_fields[this.options.obj][t],this.options_submit={fields:this.filter_fields[this.options.obj],options:{}},this.requester["getTFD"+this.options.obj].abort(),this.saveConfig(),this.reload(!0)},switchFullscreen:function(){"fixed"!=jQuery(".tfd-container").css("position")?(results_tfd_global.fullscreen_old_style={height:jQuery("#tfd-container #tfd-main").height()+"px",position:"relative",width:"auto"},jQuery(".tfd-container").css({position:"fixed",overflow:"hidden",zIndex:1090,top:0,left:0,width:jQuery(window).width()+"px",height:jQuery(window).height()+"px",backgroundColor:"#FFFFFF"}),jQuery("#tfd-container #tfd-content").height(jQuery(window).height()-56)):(jQuery(".tfd-container").css(results_tfd_global.fullscreen_old_style),jQuery("#tfd-content").height(jQuery("#tfd-container").height())),this.updateFilterStatus()},resetAllFilters:function(){var t=this;jQuery.each(this.filter_fields[this.options.obj],function(e){delete t.filter_fields[t.options.obj][e]}),this.options_submit={fields:this.filter_fields[this.options.obj],options:{}},this.requester["getTFD"+this.options.obj].abort(),this.saveConfig(),this.reload(!0)},renderStatusButtons:function(){var t="";return this.paused?t+=''+this.config.strings.pause+"":t+=''+this.config.strings.pause+"",t+=''+this.config.strings.fullscreen_toggle+"",this.only_favorites?t+=''+this.config.strings.only_favorites+"":t+=''+this.config.strings.only_favorites+"",this.config.sound&&(this.sound?t+=''+this.config.strings.sound+"":t+=''+this.config.strings.sound+""),t+=''+this.config.strings.reset_all_filters+""},renderFilterStatus:function(){var t="";if(void 0!==this.result.filters){jQuery("#"+this.options.target+" #tfd-status-filters").addClass("num-filters-"+Object.keys(this.result.filters).length);var e=this.options.obj,i=0;jQuery.each(this.result.filters,function(s,a){if("status-bar"==a.type){t+='
    ',t+='
    '+a.title+"
    ",t+='
    ';var o=jQuery("#tfd-main .status.field-"+a.field).width();o||(o=jQuery("#tfd-main").width()),"fixed"==jQuery("#tfd-container").css("position")&&(o-=22);var r=a.values.length;a.num_button_rows&&(r=Math.ceil(a.values.length/a.num_button_rows));var n=o/r;n*=a.button_width_factor;var l='style="width:'+(n-=.2)+'px;" ',d="";jQuery.each(a.values,function(i,s){d="",s.has_data&&(d+=" active");var o="";s.fav_count&&(o=''+s.fav_count+""),s.selected&&(d+=" selected"),i==a.values.length-1&&(d+=" last"),a.classes&&(d+=" "+a.classes);var r="";s.subtext&&(r=""+s.subtext+""),t+="'+s.value+r+o+""}),t+="
    ",t+="
    ",i++}}),t+='
    '}return t},updateFilterStatus:function(){jQuery("#"+this.options.target+" #tfd-status-filters").html(this.renderFilterStatus())},render:function(t){this.options_submit.last_seq||(this.ids_on_screen=[]);var e="",i="",s="",a=[],o=[],r=[];if(t||(e+='
    ',e+='
    ',e+='
    ',e+='
    ',e+="
    ",e+='
    ',e+='
    ',e+='
    '),void 0!==this.result.data)if("paused"==this.result.status)e+='
    ',e+='
    ',e+='
    Stream pausiert. Wird automatisch fortgesetzt.
    ',e+="
    ";else if(this.result.data.length||"ok"!=this.result.status){var n,l=!1,d=!1;this.options_submit.last_seq?this.result.data.length&&(jQuery("#"+this.options.target+" #tfd-content").removeClass("initial"),l=this.result.data.length):(void 0!==this.prev_result.data&&this.prev_result.data.length?(n=this.prev_result.data[0].seq,jQuery.each(this.result.data,function(t,e){if(e.seq==n)return l=t,!1})):n=!1,jQuery("#"+this.options.target+" #tfd-content").addClass("initial")),d=jQuery("#"+this.options.target+" .tfd-row").first().hasClass("highlight")?!(l%2):!!(l%2);var h=this.config,p=this.favorites,c=this.options_submit.last_seq,u=0,g={},m=this.ids_on_screen,f={},_=this.options.obj;jQuery.each(this.result.data,function(t,n){if(void 0===n.seq)return!0;var v="",y="",b=!1,k="",w="",j="",C="",M=!1;if(f.row=!0,h.update_on_duplicates){var x=!1;for(var S in m)if(m[S]==n.id){M=!0,f.update=!0;break}}if(-1!=jQuery.inArray(n.id,p)?(b=!0,v+=" favorite"):n.fav&&(v+=" favorite",f.favorite=!0),n.css_class&&(v+=" "+n.css_class),d?(v+=" highlight",d=!1):(d=!0,v+=""),(l||c)&&(tACK
    "),u++,i='
    ",C&&(i+=C),void 0!==n.g.marker&&(i+='
    ",jQuery.each(n.g.marker,function(t,e){i+='
    ',e.v,"cutoff"==e.n&&void 0!==e.o&&void 0!==e.o.cutoff_discipline&&null!=e.o.cutoff_discipline&&(i+='
    '+e.o.cutoff_discipline+"
    "),i+="
    ",void 0!==e.o&&(g[n.id]={field:e.n.toLowerCase(),options:e.o})}),i+="
    "),void 0!==n.g.primary){i+='
    ",jQuery.each(n.g.primary,function(t,e){i+='
    ',e.v&&(i+=e.v),i+="
    ",void 0!==e.o&&(g[n.id]={field:e.n.toLowerCase(),options:e.o})}),i+="
    ";var O="";void 0!==n.g.marker&&n.g.marker.length&&(O+=" has-marker marker-"+n.g.marker.length),s='
    ',jQuery.each(n.g.primary,function(t,e){s+='
    ',e.n&&(s+=e.n),s+="
    "}),s+="
    "}if(void 0!==n.g.secondary&&(i+='
    ",jQuery.each(n.g.secondary,function(t,e){i+='
    ',i+='
    '+e.n+"
    ",i+=e.v,i+="
    ",void 0!==e.o&&(g[n.id]={field:e.n.toLowerCase(),options:e.o})}),i+="
    "),void 0!==n.g.tertiary&&(i+='
    ",jQuery.each(n.g.tertiary,function(t,e){i+='
    ',i+='
    '+e.n+"
    ",i+=e.v,i+="
    ",void 0!==e.o&&(g[n.id]={field:e.n.toLowerCase(),options:e.o})}),i+="
    "),i+='
    ',i+="
    ",h.update_on_duplicates){x=!1;for(var S in m)if(m[S]==n.id){o.push({id:n.id,content:i}),x=!0;break}x||(a.push(i),e+=i)}else a.push(i),e+=i;if(m.push(n.id),h.close_on_duplicates&&is_close)for(var S in m)m[S]==n.id&&delete m[S]})}else e+='
    ',e+='
    ',e+='
    '+this.config.strings.no_results+"
    ",e+="
    ";if(t||(e+="
    ",e+='
    ',e+="
    ",e+="
    "),this.options_submit.last_seq){if(void 0!==h&&"overview"==h.mode)for(var v in r)if(jQuery("#"+this.options.target+" .index-"+r[v]).replaceWith(a[v]).length)jQuery("#"+this.options.target+" .index-"+r[v]).removeClass("newentry"),jQuery("#"+this.options.target+" .index-"+r[v]).addClass("updated");else{var y=[];if(jQuery("#"+this.options.target+" .tfd-row").each(function(t){var e=jQuery(this).attr("class"),i=e.substr(e.indexOf("index-")+6);i=i.replace(" updated",""),y.push(i)}),y.length){var b=y;b.push(r[v]),isNaN(b[0])?b.sort():b.sort(function(t,e){return t-e});for(var k in b)b[k]==r[v]&&((k=parseInt(k))>0?jQuery("#"+this.options.target+" .index-"+b[k-1]).after(a[v]):jQuery("#"+this.options.target+" .index-"+b[k+1]).before(a[v]),jQuery("#"+this.options.target+" .index-"+r[v]).addClass("updated"))}else jQuery("#"+this.options.target+" #tfd-content").append(a[v])}else if(jQuery("#"+this.options.target+" #tfd-content").prepend(a.join("")),jQuery("#"+this.options.target+" #tfd-content div.tfd-row").length>this.result.max_entries)for(v=0;v0&&c.val(s.value)}}"event"==r.field&&t&&"event_main_group"==t.attr("name")?this.options_submit.b[l][r.field]="":this.options_submit.b[l][r.field]=n.val()}}}this.lockForm(l)}return this.load().then(function(){a.resolve()}),a.promise()},setData:function(t){this.branches=t.branches,this.strings=t.strings,this.render()},render:function(){for(var t in this.options.mapping)if(this.options.mapping.hasOwnProperty(t))for(var e in this.options.mapping[t])if(this.options.mapping[t].hasOwnProperty(e)){var i=this.options.mapping[t][e],s=this.jq(i.parent+" "+i.element),a=this.branches[t].fields[i.field];"ok"==a.state&&a.data.length?this.generateSelectFromField(s,a.data,s.val(),i,t):this.generateField(s,s.val()),1!=this.branches[t].fields[i.field].data.length||this.branches[t].fields[i.field].data[0].v[0]}},lockForm:function(t){for(var e in this.options.mapping)if(this.options.mapping.hasOwnProperty(e)){for(var i in this.options.mapping[e]){var s=this.options.mapping[e][i];this.jq(s.parent+" "+s.element).attr("disabled","disabled")}window.clearTimeout(res2.timer[t]),res2.timer[t]=window.setTimeout("res2.showIndicator('"+t+"')",400)}},showIndicator:function(t){jQuery(".branch-"+t+" .box-content");jQuery(".panel-loading").css("display","block")},unlockForm:function(){jQuery(".panel-loading").css("display","none");for(var t in res2.timer)window.clearTimeout(res2.timer[t])},generateSelectFromField:function(t,e,i,s,a){t.attr("placeholder")||t.attr("placeholder","");var o=this.jq("");o.attr({placeholder:t.attr("placeholder"),class:t.attr("class"),name:t.attr("name"),id:t.attr("id")}),i||(i="%");for(var r in e){var n,l;"object"==typeof e[r].v?(n=e[r].v[0],l=1==e[r].n?e[r].v[1]:e[r].n&&null!=e[r].n?e[r].v[1]+" ("+e[r].n+")":e[r].v[1]):(n=e[r].v,l=1==e[r].n?e[r].v:e[r].n&&null!=e[r].n?e[r].v+" ("+e[r].n+")":e[r].v);var d=this.jq("