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)o.lng()&&(r="w");var n=google.maps.geometry.spherical.computeOffset(s,e,google.maps.geometry.spherical.computeHeading(s,o));return n.direction=r,n}return moveAlongPath(t,e-a,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 o="?";for(var a in e)o+="&"+a+"="+e[a];for(var r in i){var n=encodeURI(o+"&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,o,a,r;return o=2147483648&t,a=2147483648&e,i=1073741824&t,s=1073741824&e,r=(1073741823&t)+(1073741823&e),i&s?2147483648^r^o^a:i|s?1073741824&r?3221225472^r^o^a:1073741824^r^o^a:r^o^a},s=function(t,s,o,a,r,n,l){return t=i(t,i(i(function(t,e,i){return t&e|~t&i}(s,o,a),r),l)),i(e(t,n),s)},o=function(t,s,o,a,r,n,l){return t=i(t,i(i(function(t,e,i){return t&i|e&~i}(s,o,a),r),l)),i(e(t,n),s)},a=function(t,s,o,a,r,n,l){return t=i(t,i(i(function(t,e,i){return t^e^i}(s,o,a),r),l)),i(e(t,n),s)},r=function(t,s,o,a,r,n,l){return t=i(t,i(i(function(t,e,i){return e^(t|~i)}(s,o,a),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,f,m=Array();for(m=function(t){for(var e,i=t.length,s=i+8,o=16*((s-s%64)/64+1),a=Array(o-1),r=0,n=0;n>>29,a}(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,f=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),o=s.data("mika.button"),a="object"==typeof i&&i;o||s.data("mika.button",o=new e(this,a)),i&&o.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(a=t({path:"/"},s.defaults,a)).expires){var n=new Date;n.setMilliseconds(n.getMilliseconds()+864e5*a.expires),a.expires=n}try{r=JSON.stringify(o),/^[\{\[]/.test(r)&&(o=r)}catch(t){}return o=i.write?i.write(o,e):encodeURIComponent(String(o)).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,"=",o,a.expires&&"; expires="+a.expires.toUTCString(),a.path&&"; path="+a.path,a.domain&&"; domain="+a.domain,a.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)&&a._cookie)for(var r in Cookies.get())""!=r&&o.push(r.replace(a._prefix,""));else for(var n in a)a.hasOwnProperty(n)&&o.push(n);return o}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,o=s[0];if(e<1||!t.isPlainObject(o)&&e<2)throw new Error("Minimum 2 arguments must be given or first parameter must be an object");if(t.isPlainObject(o)&&this._ns){for(var a in o)this._callMethod(i,[a,o[a]]);return o}var r=this._callMethod(i,s);return this._ns?r[o.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(o,[t])},isEmpty:function(){return this._callMethod(a,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,o,a,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(o){(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),o&&(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)),o&&(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(),a=n.marker_.getPosition(),r=n.marker_.getMap().getCenter(),o=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&&(o=!1,n.marker_.setPosition(a),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||(o=this.get("raiseOnDrag"))}),google.maps.event.addListener(this.marker_,"drag",function(t){d||o&&(n.setPosition(20),n.labelDiv_.style.zIndex=1e6+(this.get("labelInBackground")?-1:1))}),google.maps.event.addListener(this.marker_,"dragend",function(t){d||o&&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?a-=60*(o=Math.floor(o)):o=0,s>=1?o-=60*(s=Math.floor(s)):s=0,i>=1?s-=24*(i=Math.floor(i)):i=0,s<10&&(s="0"+s),o<10&&(o="0"+o),a<10&&(a="0"+a),i?e+i+s+":"+o+":"+a:e+s+":"+o+":"+a},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,o,a,r=0,n=0,l=0,d=this.getContainerByType("favorites");if(d.data){var h={},p={},c={},u={},g=0,f=0;for(var m in d.data.rows)if(d.data.rows.hasOwnProperty(m)){var _=d.data.rows[m];_.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?(f=this.data.global.options.replay_daytime?_.starttime_net_ms-g:0,this.replay_time&&s.time_ms&&s.time_ms+f<=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+f):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(o in _.split_groups)if(_.split_groups.hasOwnProperty(o))if(o==e.group)if(void 0===p[o]&&(p[o]={}),void 0===h[o]&&(h[o]={}),_.is_in_replay&&this.data.global.options.replay_mode){_.split_groups[o].active=!0,_.global_info.active_group_key=o,n=0,this.data.global.options.replay_daytime?(l=(this.replay_time-f-e.time_ms)/i.ms_km_estimate,l+=e.km-_.split_groups[o].first_km):(l=(this.replay_time-e.time_ms)/i.ms_km_estimate,l+=e.km-_.split_groups[o].first_km),(isNaN(l)||l<0)&&(l=0),_.split_groups[o].estimated_pos=l;var v=this.replay_time-f;_.race_time=v>0&&!k?this.ms2time(v):k?e.time:"00:00:00",_.split_groups[o].estimated_pos_string=l.toFixed(2),p[o][_.id]=l,_.split_groups[o].state="started",k&&(_.split_groups[o].estimated_pos="finished",_.split_groups[o].state="finished")}else isNaN(_.split_groups[o].estimated_pos)?h[o][_.id]=0:h[o][_.id]=_.split_groups[o].estimated_pos;else _.is_in_replay&&this.data.global.options.replay_mode&&(_.split_groups[o].active=!1)}else{if(!e)for(o in _.split_groups)if(_.split_groups.hasOwnProperty(o)){"S"==_.global_info.race_status?(_.split_groups[o].estimated_pos="not_started",_.split_groups[o].estimated_pos_string="not_started"):(_.split_groups[o].estimated_pos="started",_.split_groups[o].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(o in _.split_groups)_.split_groups.hasOwnProperty(o)&&(o!=e.group&&"estimated_chip"==_.position_data.source||("A"==_.global_info.race_status?(_.split_groups[o].state="started",b<=_.position_data.valid_until_km?_.split_groups[o].estimated_pos=_.split_groups[o].estimated_pos_string=b:_.split_groups[o].estimated_pos=_.split_groups[o].estimated_pos_string=_.position_data.valid_until_km):"F"==_.global_info.race_status?_.split_groups[o].estimated_pos=_.split_groups[o].state="finished":"S"==_.global_info.race_status&&(_.split_groups[o].estimated_pos=_.split_groups[o].state="not_started"),void 0===p[o]&&(p[o]={}),void 0===h[o]&&(h[o]={}),isNaN(_.split_groups[o].estimated_pos)?h[o][_.id]=0:h[o][_.id]=_.split_groups[o].estimated_pos))}}for(m in d.data.rows)if(d.data.rows.hasOwnProperty(m)){_=d.data.rows[m],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(o in _.split_groups)_.split_groups.hasOwnProperty(o)&&o==e.group&&(_.is_in_replay&&this.data.global.options.replay_mode?(r=u[o]-_.split_groups[o].estimated_pos,_.split_groups[o].diff_km=r,isNaN(r)&&0!=r?_.split_groups[o].diff_km_string="+0 km":_.split_groups[o].diff_km_string="+"+r.toFixed(2)+" km",n=(u[o]-_.split_groups[o].estimated_pos)*i.ms_km_estimate,_.split_groups[o].diff_time=n,isNaN(n)&&0!=n?_.split_groups[o].diff_time_string="+0":_.split_groups[o].diff_time_string="+"+this.ms2time(n)):(r=c[o]-_.split_groups[o].estimated_pos,_.split_groups[o].diff_km=r,isNaN(r)&&0!=r?_.split_groups[o].diff_km_string="+0 km":_.split_groups[o].diff_km_string="+"+r.toFixed(2)+" km",n=(c[o]-_.split_groups[o].estimated_pos)*_.split_groups[o].ms_km_estimate,_.split_groups[o].diff_time=n,isNaN(n)&&0!=n?_.split_groups[o].diff_time_string="+0":_.split_groups[o].diff_time_string="+"+this.ms2time(n)))}this.favoritesOrderLive={};for(o in h)if(h.hasOwnProperty(o)){a={};for(t in h[o])h[o].hasOwnProperty(t)&&(a[h[o][t]]=t);a=this.sortObjByKey(a,!0),this.favoritesOrderLive[o]=[];for(t in a)a.hasOwnProperty(t)&&this.favoritesOrderLive[o].push(a[t]);this.favoritesOrderLive[o].reverse();for(t in h[o])h[o].hasOwnProperty(t)&&(h[o][t]||this.favoritesOrderLive[o].push(t))}this.favoritesOrderReplay={};for(o in p)if(p.hasOwnProperty(o)){a={};for(t in p[o])p[o].hasOwnProperty(t)&&p[o][t]&&(a[p[o][t]]=t);a=this.sortObjByKey(a,!0),this.favoritesOrderReplay[o]=[];for(t in a)a.hasOwnProperty(t)&&this.favoritesOrderReplay[o].push(a[t]);this.favoritesOrderReplay[o].reverse();for(t in p[o])p[o].hasOwnProperty(t)&&(p[o][t]||this.favoritesOrderReplay[o].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=[],o={};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)&&(o[s[i]]=t[s[i]]);return o},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+='
'),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){o=[];if(-1!=(i=this.favorites.indexOf(e.id))){for(r in this.favorites)this.favorites.hasOwnProperty(r)&&this.favorites[r]!=e.id&&o.push(this.favorites[r]);this.favorites=o,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],o=[];for(r in this.favoritesSelected)this.favoritesSelected.hasOwnProperty(r)&&s!=this.favoritesSelected[r]&&o.push(this.favoritesSelected[r]);this.favoritesSelected=o}break;case"submitOptions":o=[];jQuery(".resultsboard-"+this.options.globalObjectName+" form").each(function(t,e){"lb"==e.name&&(o=jQuery(this).serializeArray())});var a={};for(var r in o)o.hasOwnProperty(r)&&("field_"==o[r].name.substr(0,6)&&(a[o[r].name.substr(6)]=o[r].value),"option_"==o[r].name.substr(0,7)&&(a[o[r].name.substr(7)]=o[r].value));this.replay_time_max=0,this.replay_time=0,this.replay_speed=0,this.options_submit.option_bar=a,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)){o=[];for(var r in this.mapOverlays)this.mapOverlays.hasOwnProperty(r)&&this.mapOverlays[r]!=e.overlayId&&o.push(this.mapOverlays[r]);this.mapOverlays=o,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 o 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 a=this.renderContainer(e,!1);jQuery(".resultsboard-"+this.options.globalObjectName+" .lb-col.col-id-"+this.data.containers[e].col).append(a)}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+"
');var m=0;for(s in r.data.fields.data)r.data.fields.data.hasOwnProperty(s)&&m++;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==m&&(l+=" last"),l&&(l=' class="'+l+'"'),n+="