!function(t){function n(t,e){return t<<e|t>>>32-e}function p(t,e){var i=2147483648&t,s=2147483648&e,o=1073741824&t,a=1073741824&e,t=(1073741823&t)+(1073741823&e);return o&a?2147483648^t^i^s:o|a?1073741824&t?3221225472^t^i^s:1073741824^t^i^s:t^i^s}function c(t,e,i,s,o,a,r){return t=p(t,p(p(e&i|~e&s,o),r)),p(n(t,a),e)}function u(t,e,i,s,o,a,r){return t=p(t,p(p(e&s|i&~s,o),r)),p(n(t,a),e)}function g(t,e,i,s,o,a,r){return t=p(t,p(p(e^i^s,o),r)),p(n(t,a),e)}function m(t,e,i,s,o,a,r){return t=p(t,p(p(i^(e|~s),o),r)),p(n(t,a),e)}function f(t){for(var e="",i="",s=0;s<=3;s++)e+=(i="0"+(t>>>8*s&255).toString(16)).substr(i.length-2,2);return e}t.extend({md5:function(t){Array();for(var e,i,s,o,a=function(t){for(var e,i=t.length,s=i+8,s=16*(1+(s-s%64)/64),o=Array(s-1),a=0,r=0;r<i;)a=r%4*8,o[e=(r-r%4)/4]=o[e]|t.charCodeAt(r)<<a,r++;return o[e=(r-r%4)/4]=o[e]|128<<(a=r%4*8),o[s-2]=i<<3,o[s-1]=i>>>29,o}(t=function(t){t=t.replace(/\x0d\x0a/g,"\n");for(var e="",i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?e+=String.fromCharCode(s):e=127<s&&s<2048?(e+=String.fromCharCode(s>>6|192))+String.fromCharCode(63&s|128):(e=(e+=String.fromCharCode(s>>12|224))+String.fromCharCode(s>>6&63|128))+String.fromCharCode(63&s|128)}return e}(t)),r=1732584193,n=4023233417,l=2562383102,d=271733878,h=0;h<a.length;h+=16)r=c(e=r,i=n,s=l,o=d,a[h+0],7,3614090360),d=c(d,r,n,l,a[h+1],12,3905402710),l=c(l,d,r,n,a[h+2],17,606105819),n=c(n,l,d,r,a[h+3],22,3250441966),r=c(r,n,l,d,a[h+4],7,4118548399),d=c(d,r,n,l,a[h+5],12,1200080426),l=c(l,d,r,n,a[h+6],17,2821735955),n=c(n,l,d,r,a[h+7],22,4249261313),r=c(r,n,l,d,a[h+8],7,1770035416),d=c(d,r,n,l,a[h+9],12,2336552879),l=c(l,d,r,n,a[h+10],17,4294925233),n=c(n,l,d,r,a[h+11],22,2304563134),r=c(r,n,l,d,a[h+12],7,1804603682),d=c(d,r,n,l,a[h+13],12,4254626195),l=c(l,d,r,n,a[h+14],17,2792965006),n=c(n,l,d,r,a[h+15],22,1236535329),r=u(r,n,l,d,a[h+1],5,4129170786),d=u(d,r,n,l,a[h+6],9,3225465664),l=u(l,d,r,n,a[h+11],14,643717713),n=u(n,l,d,r,a[h+0],20,3921069994),r=u(r,n,l,d,a[h+5],5,3593408605),d=u(d,r,n,l,a[h+10],9,38016083),l=u(l,d,r,n,a[h+15],14,3634488961),n=u(n,l,d,r,a[h+4],20,3889429448),r=u(r,n,l,d,a[h+9],5,568446438),d=u(d,r,n,l,a[h+14],9,3275163606),l=u(l,d,r,n,a[h+3],14,4107603335),n=u(n,l,d,r,a[h+8],20,1163531501),r=u(r,n,l,d,a[h+13],5,2850285829),d=u(d,r,n,l,a[h+2],9,4243563512),l=u(l,d,r,n,a[h+7],14,1735328473),n=u(n,l,d,r,a[h+12],20,2368359562),r=g(r,n,l,d,a[h+5],4,4294588738),d=g(d,r,n,l,a[h+8],11,2272392833),l=g(l,d,r,n,a[h+11],16,1839030562),n=g(n,l,d,r,a[h+14],23,4259657740),r=g(r,n,l,d,a[h+1],4,2763975236),d=g(d,r,n,l,a[h+4],11,1272893353),l=g(l,d,r,n,a[h+7],16,4139469664),n=g(n,l,d,r,a[h+10],23,3200236656),r=g(r,n,l,d,a[h+13],4,681279174),d=g(d,r,n,l,a[h+0],11,3936430074),l=g(l,d,r,n,a[h+3],16,3572445317),n=g(n,l,d,r,a[h+6],23,76029189),r=g(r,n,l,d,a[h+9],4,3654602809),d=g(d,r,n,l,a[h+12],11,3873151461),l=g(l,d,r,n,a[h+15],16,530742520),n=g(n,l,d,r,a[h+2],23,3299628645),r=m(r,n,l,d,a[h+0],6,4096336452),d=m(d,r,n,l,a[h+7],10,1126891415),l=m(l,d,r,n,a[h+14],15,2878612391),n=m(n,l,d,r,a[h+5],21,4237533241),r=m(r,n,l,d,a[h+12],6,1700485571),d=m(d,r,n,l,a[h+3],10,2399980690),l=m(l,d,r,n,a[h+10],15,4293915773),n=m(n,l,d,r,a[h+1],21,2240044497),r=m(r,n,l,d,a[h+8],6,1873313359),d=m(d,r,n,l,a[h+15],10,4264355552),l=m(l,d,r,n,a[h+6],15,2734768916),n=m(n,l,d,r,a[h+13],21,1309151649),r=m(r,n,l,d,a[h+4],6,4149444226),d=m(d,r,n,l,a[h+11],10,3174756917),l=m(l,d,r,n,a[h+2],15,718787259),n=m(n,l,d,r,a[h+9],21,3951481745),r=p(r,e),n=p(n,i),l=p(l,s),d=p(d,o);return(f(r)+f(n)+f(l)+f(d)).toLowerCase()}})}(jQuery),!function(s){s.topZIndex=function(t){return Math.max(0,Math.max.apply(null,s.map("*"===(t||"*")?s.makeArray(document.getElementsByTagName("*")):s(t),function(t){return parseFloat(s(t).css("z-index"))||null})))},s.fn.topZIndex=function(t){if(0===this.length)return this;t=s.extend({increment:1},t);var e=s.topZIndex(t.selector),i=t.increment;return this.each(function(){this.style.zIndex=e+=i})}}(jQuery),!function(o){"use strict";function s(t,e){this.$element=o(t),this.isLoading=!1}s.prototype.setState=function(t){var e="disabled",i=this.$element,s=i.data();setTimeout(o.proxy(function(){i.html((null===s[t]?this.options:s)[t]),"loading"==t&&(!1===this.isLoading?(0===i.find(".loading-label").length&&(i.data("label-created",!0),i.html('<span class="loading-label">'+i.html()+"</span>")),i.css({width:i.width()+parseInt(i.css("padding-left").replace("px",""))+parseInt(i.css("padding-right").replace("px","")),height:i.height()+parseInt(i.css("padding-top").replace("px",""))+parseInt(i.css("padding-bottom").replace("px",""))}),i.append('<span class="loading-spinner" style="margin-left:-'+i.height()/2+"px;margin-top:-"+(i.height()/2+.08*i.height())+'px"><img src="//static.r.mikatiming.net/stages/blue/images/loading.gif" width="'+i.height()+'" /></span>'),this.isLoading=!0,i.addClass(t).addClass(e).attr(e,e)):(this.isLoading=!1,i.removeClass(t).removeClass(e).removeAttr(e),i.find(".loading-spinner").remove(),!0===i.data("label-created")&&i.html(i.find("loading-label").html())))},this),0)};var t=o.fn.mikaButton;o.fn.mikaButton=function(i){return this.each(function(){var t=o(this),e=t.data("mika.button");e||t.data("mika.button",e=new s(this)),i&&e.setState(i)})},o.fn.mikaButton.Constructor=s,o.fn.mikaButton.noConflict=function(){return o.fn.mikaButton=t,this}}(jQuery),!function(t){var e,i;"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():(e=window.Cookies,(i=window.Cookies=t()).noConflict=function(){return window.Cookies=e,i})}(function(){function c(){for(var t=0,e={};t<arguments.length;t++){var i,s=arguments[t];for(i in s)e[i]=s[i]}return e}return function t(h){function p(t,e,i){var s,o;if(1<arguments.length){"number"==typeof(i=c({path:"/"},p.defaults,i)).expires&&((o=new Date).setMilliseconds(o.getMilliseconds()+864e5*i.expires),i.expires=o);try{s=JSON.stringify(e),/^[\{\[]/.test(s)&&(e=s)}catch(t){}return e=h.write?h.write(e,t):encodeURIComponent(String(e)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[t,"=",e,i.expires&&"; expires="+i.expires.toUTCString(),i.path&&"; path="+i.path,i.domain&&"; domain="+i.domain,i.secure?"; secure":""].join("")}t||(s={});for(var a=document.cookie?document.cookie.split("; "):[],r=/(%[0-9A-Z]{2})+/g,n=0;n<a.length;n++){var l=a[n].split("="),d=l[0].replace(r,decodeURIComponent);'"'===(l=l.slice(1).join("=")).charAt(0)&&(l=l.slice(1,-1));try{if(l=h.read?h.read(l,d):h(l,d)||l.replace(r,decodeURIComponent),this.json)try{l=JSON.parse(l)}catch(t){}if(t===d){s=l;break}t||(s[d]=l)}catch(t){}}return s}return(p.get=p.set=p).getJSON=function(){return p.apply({json:!0},[].slice.call(arguments))},p.defaults={},p.remove=function(t,e){p(t,"",c(e,{expires:-1}))},p.withConverter=t,p}(function(){})}),!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(h){function a(){var e,i,t,s=this._type,o=arguments.length,a=window[s],r=arguments,n=r[0];if(o<1)throw new Error("Minimum 1 argument must be given");if(h.isArray(n)){for(var l in i={},n){e=n[l];try{i[e]=JSON.parse(a.getItem(e))}catch(t){i[e]=a.getItem(e)}}return i}if(1!=o){try{i=JSON.parse(a.getItem(n))}catch(t){throw new ReferenceError(n+" is not defined in this storage")}for(l=1;l<o-1;l++)if(void 0===(i=i[r[l]]))throw new ReferenceError([].slice.call(r,1,l+1).join(".")+" is not defined in this storage");if(h.isArray(r[l])){for(var d in t=i,i={},r[l])i[r[l][d]]=t[r[l][d]];return i}return i[r[l]]}try{return JSON.parse(a.getItem(n))}catch(t){return a.getItem(n)}}function o(){var t,e,i=this._type,s=arguments.length,o=window[i],a=arguments,r=a[0],i=a[1],n=isNaN(i)?{}:[];if(s<1||!h.isPlainObject(r)&&s<2)throw new Error("Minimum 2 arguments must be given or first parameter must be an object");if(h.isPlainObject(r)){for(var l in r)t=r[l],h.isPlainObject(t)||this.alwaysUseJson?o.setItem(l,JSON.stringify(t)):o.setItem(l,t);return r}if(2==s)return"object"==typeof i||this.alwaysUseJson?o.setItem(r,JSON.stringify(i)):o.setItem(r,i),i;try{null!=(d=o.getItem(r))&&(n=JSON.parse(d))}catch(t){}for(var d=n,l=1;l<s-2;l++)t=a[l],e=isNaN(a[l+1])?"object":"array",d[t]&&("object"!=e||h.isPlainObject(d[t]))&&("array"!=e||h.isArray(d[t]))||(d[t]="array"==e?[]:{}),d=d[t];return d[a[l]]=a[l+1],o.setItem(r,JSON.stringify(n)),n}function s(){var t,e,i=this._type,s=arguments.length,o=window[i],a=arguments,r=a[0];if(s<1)throw new Error("Minimum 1 argument must be given");if(h.isArray(r))for(var n in r)o.removeItem(r[n]);else if(1==s)o.removeItem(r);else{try{t=e=JSON.parse(o.getItem(r))}catch(t){throw new ReferenceError(r+" is not defined in this storage")}for(n=1;n<s-1;n++)if(void 0===(e=e[a[n]]))throw new ReferenceError([].slice.call(a,1,n).join(".")+" is not defined in this storage");if(h.isArray(a[n]))for(var l in a[n])delete e[a[n][l]];else delete e[a[n]];o.setItem(r,JSON.stringify(t))}return!0}function e(t){var e=l.call(this);for(i in e)s.call(this,e[i]);if(t)for(var i in h.namespaceStorages)d(i)}function r(){var t=arguments.length,e=arguments,i=e[0];if(0==t)return 0==l.call(this).length;if(h.isArray(i)){for(var s=0;s<i.length;s++)if(!r.call(this,i[s]))return!1;return!0}try{var o=a.apply(this,arguments);for(s in o=h.isArray(e[t-1])?o:{totest:o})if(!(h.isPlainObject(o[s])&&h.isEmptyObject(o[s])||h.isArray(o[s])&&!o[s].length)&&o[s])return!1;return!0}catch(t){return!0}}function n(){var t=arguments.length,e=arguments,i=e[0];if(t<1)throw new Error("Minimum 1 argument must be given");if(h.isArray(i)){for(var s=0;s<i.length;s++)if(!n.call(this,i[s]))return!1;return!0}try{var o=a.apply(this,arguments);for(s in o=h.isArray(e[t-1])?o:{totest:o})if(void 0===o[s]||null===o[s])return!1;return!0}catch(t){return!1}}function l(){var t=this._type,t=window[t],e=[],i={};if((i=0<arguments.length?a.apply(this,arguments):t)&&i._cookie)for(var s in Cookies.get())""!=s&&e.push(s.replace(i._prefix,""));else for(var o in i)i.hasOwnProperty(o)&&e.push(o);return e}function d(t){if(!t||"string"!=typeof t)throw new Error("First parameter must be a string");i?(window.localStorage.getItem(t)||window.localStorage.setItem(t,"{}"),window.sessionStorage.getItem(t)||window.sessionStorage.setItem(t,"{}")):(window.localCookieStorage.getItem(t)||window.localCookieStorage.setItem(t,"{}"),window.sessionCookieStorage.getItem(t)||window.sessionCookieStorage.setItem(t,"{}"));var e={localStorage:h.extend({},h.localStorage,{_ns:t}),sessionStorage:h.extend({},h.sessionStorage,{_ns:t})};return"undefined"!=typeof Cookies&&(window.cookieStorage.getItem(t)||window.cookieStorage.setItem(t,"{}"),e.cookieStorage=h.extend({},h.cookieStorage,{_ns:t})),h.namespaceStorages[t]=e}var t,i=function(t){var e="jsapi";try{return window[t]?(window[t].setItem(e,e),window[t].removeItem(e),!0):!1}catch(t){return!1}}("localStorage"),p={_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(a,arguments)},set:function(){var t=arguments.length,e=arguments,i=e[0];if(t<1||!h.isPlainObject(i)&&t<2)throw new Error("Minimum 2 arguments must be given or first parameter must be an object");if(h.isPlainObject(i)&&this._ns){for(var s in i)this._callMethod(o,[s,i[s]]);return i}return t=this._callMethod(o,e),this._ns?t[i.split(".")[0]]:t},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(o,[{}]),!0):this._callMethod(e,[t])},isEmpty:function(){return this._callMethod(r,arguments)},isSet:function(){if(arguments.length<1)throw new Error("Minimum 1 argument must be given");return this._callMethod(n,arguments)},keys:function(){return this._callMethod(l,arguments)}};"undefined"!=typeof Cookies&&(window.name||(window.name=Math.floor(1e8*Math.random())),t={_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}},i||(window.localCookieStorage=h.extend({},t,{_prefix:"ls_",_expires:3650}),window.sessionCookieStorage=h.extend({},t,{_prefix:"ss_"+window.name+"_"})),window.cookieStorage=h.extend({},t),h.cookieStorage=h.extend({},p,{_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}})),h.initNamespaceStorage=d,i?(h.localStorage=h.extend({},p,{_type:"localStorage"}),h.sessionStorage=h.extend({},p,{_type:"sessionStorage"})):(h.localStorage=h.extend({},p,{_type:"localCookieStorage"}),h.sessionStorage=h.extend({},p,{_type:"sessionCookieStorage"})),h.namespaceStorages={},h.removeAllStorages=function(t){h.localStorage.removeAll(t),h.sessionStorage.removeAll(t),h.cookieStorage&&h.cookieStorage.removeAll(t),t||(h.namespaceStorages={})},h.alwaysUseJsonInStorage=function(t){p.alwaysUseJson=t,h.localStorage.alwaysUseJson=t,h.sessionStorage.alwaysUseJson=t,h.cookieStorage&&(h.cookieStorage.alwaysUseJson=t)}});{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)}"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(){function e(t){t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}function i(){h.marker_.setAnimation(null)}var s,o,a,r,n,l,d,h=this,p=!1,c=!1,u="url("+this.handCursorURL_+")";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){(h.marker_.getDraggable()||h.marker_.getClickable())&&(this.style.cursor="pointer",google.maps.event.trigger(h.marker_,"mouseover",t))}),google.maps.event.addDomListener(this.eventDiv_,"mouseout",function(t){!h.marker_.getDraggable()&&!h.marker_.getClickable()||c||(this.style.cursor=h.marker_.getCursor(),google.maps.event.trigger(h.marker_,"mouseout",t))}),google.maps.event.addDomListener(this.eventDiv_,"mousedown",function(t){c=!1,h.marker_.getDraggable()&&(p=!0,this.style.cursor=u),(h.marker_.getDraggable()||h.marker_.getClickable())&&(google.maps.event.trigger(h.marker_,"mousedown",t),e(t))}),google.maps.event.addDomListener(document,"mouseup",function(t){var e;if(p&&(p=!1,h.eventDiv_.style.cursor="pointer",google.maps.event.trigger(h.marker_,"mouseup",t)),c){if(n){(e=h.getProjection().fromLatLngToDivPixel(h.marker_.getPosition())).y+=20,h.marker_.setPosition(h.getProjection().fromDivPixelToLatLng(e));try{h.marker_.setAnimation(google.maps.Animation.BOUNCE),setTimeout(i,1406)}catch(t){}}h.crossDiv_.style.display="none",h.marker_.setZIndex(s),c=!(r=!0),t.latLng=h.marker_.getPosition(),google.maps.event.trigger(h.marker_,"dragend",t)}}),google.maps.event.addListener(h.marker_.getMap(),"mousemove",function(t){var e;p&&(c?(t.latLng=new google.maps.LatLng(t.latLng.lat()-o,t.latLng.lng()-a),e=h.getProjection().fromLatLngToDivPixel(t.latLng),n&&(h.crossDiv_.style.left=e.x+"px",h.crossDiv_.style.top=e.y+"px",h.crossDiv_.style.display="",e.y-=20),h.marker_.setPosition(h.getProjection().fromDivPixelToLatLng(e)),n&&(h.eventDiv_.style.top=e.y+20+"px"),google.maps.event.trigger(h.marker_,"drag",t)):(o=t.latLng.lat()-h.marker_.getPosition().lat(),a=t.latLng.lng()-h.marker_.getPosition().lng(),s=h.marker_.getZIndex(),l=h.marker_.getPosition(),d=h.marker_.getMap().getCenter(),n=h.marker_.get("raiseOnDrag"),c=!0,h.marker_.setZIndex(1e6),t.latLng=h.marker_.getPosition(),google.maps.event.trigger(h.marker_,"dragstart",t)))}),google.maps.event.addDomListener(document,"keydown",function(t){c&&27===t.keyCode&&(n=!1,h.marker_.setPosition(l),h.marker_.getMap().setCenter(d),google.maps.event.trigger(document,"mouseup",t))}),google.maps.event.addDomListener(this.eventDiv_,"click",function(t){(h.marker_.getDraggable()||h.marker_.getClickable())&&(r?r=!1:(google.maps.event.trigger(h.marker_,"click",t),e(t)))}),google.maps.event.addDomListener(this.eventDiv_,"dblclick",function(t){(h.marker_.getDraggable()||h.marker_.getClickable())&&(google.maps.event.trigger(h.marker_,"dblclick",t),e(t))}),google.maps.event.addListener(this.marker_,"dragstart",function(t){c||(n=this.get("raiseOnDrag"))}),google.maps.event.addListener(this.marker_,"drag",function(t){c||n&&(h.setPosition(20),h.labelDiv_.style.zIndex=1e6+(this.get("labelInBackground")?-1:1))}),google.maps.event.addListener(this.marker_,"dragend",function(t){c||n&&h.setPosition(0)}),google.maps.event.addListener(this.marker_,"position_changed",function(){h.setPosition()}),google.maps.event.addListener(this.marker_,"zindex_changed",function(){h.setZIndex()}),google.maps.event.addListener(this.marker_,"visible_changed",function(){h.setVisible()}),google.maps.event.addListener(this.marker_,"labelvisible_changed",function(){h.setVisible()}),google.maps.event.addListener(this.marker_,"title_changed",function(){h.setTitle()}),google.maps.event.addListener(this.marker_,"labelcontent_changed",function(){h.setContent()}),google.maps.event.addListener(this.marker_,"labelanchor_changed",function(){h.setAnchor()}),google.maps.event.addListener(this.marker_,"labelclass_changed",function(){h.setStyles()}),google.maps.event.addListener(this.marker_,"labelstyle_changed",function(){h.setStyles()})]},MarkerLabel_.prototype.onRemove=function(){var t;for(this.labelDiv_.parentNode.removeChild(this.labelDiv_),this.eventDiv_.parentNode.removeChild(this.eventDiv_),t=0;t<this.listeners_.length;t++)google.maps.event.removeListener(this.listeners_[t])},MarkerLabel_.prototype.draw=function(){this.setContent(),this.setTitle(),this.setStyles()},MarkerLabel_.prototype.setContent=function(){var t=this.marker_.get("labelContent");void 0===t.nodeType?(this.labelDiv_.innerHTML=t,this.eventDiv_.innerHTML=this.labelDiv_.innerHTML):(this.labelDiv_.innerHTML="",this.labelDiv_.appendChild(t),t=t.cloneNode(!0),this.eventDiv_.innerHTML="",this.eventDiv_.appendChild(t))},MarkerLabel_.prototype.setTitle=function(){this.eventDiv_.title=this.marker_.getTitle()||""},MarkerLabel_.prototype.setStyles=function(){var t,e;for(t in this.labelDiv_.className=this.marker_.get("labelClass"),this.eventDiv_.className=this.labelDiv_.className,this.labelDiv_.style.cssText="",this.eventDiv_.style.cssText="",e=this.marker_.get("labelStyle"))e.hasOwnProperty(t)&&(this.labelDiv_.style[t]=e[t],this.eventDiv_.style[t]=e[t]);this.setMandatoryStyles()},MarkerLabel_.prototype.setMandatoryStyles=function(){this.labelDiv_.style.position="absolute",this.labelDiv_.style.overflow="hidden",void 0!==this.labelDiv_.style.opacity&&""!==this.labelDiv_.style.opacity&&(this.labelDiv_.style.MsFilter='"progid:DXImageTransform.Microsoft.Alpha(opacity='+100*this.labelDiv_.style.opacity+')"',this.labelDiv_.style.filter="alpha(opacity="+100*this.labelDiv_.style.opacity+")"),this.eventDiv_.style.position=this.labelDiv_.style.position,this.eventDiv_.style.overflow=this.labelDiv_.style.overflow,this.eventDiv_.style.opacity=.01,this.eventDiv_.style.MsFilter='"progid:DXImageTransform.Microsoft.Alpha(opacity=1)"',this.eventDiv_.style.filter="alpha(opacity=1)",this.setAnchor(),this.setPosition(),this.setVisible()},MarkerLabel_.prototype.setAnchor=function(){var t=this.marker_.get("labelAnchor");this.labelDiv_.style.marginLeft=-t.x+"px",this.labelDiv_.style.marginTop=-t.y+"px",this.eventDiv_.style.marginLeft=-t.x+"px",this.eventDiv_.style.marginTop=-t.y+"px"},MarkerLabel_.prototype.setPosition=function(t){var e=this.getProjection().fromLatLngToDivPixel(this.marker_.getPosition());void 0===t&&(t=0),this.labelDiv_.style.left=Math.round(e.x)+"px",this.labelDiv_.style.top=Math.round(e.y-t)+"px",this.eventDiv_.style.left=this.labelDiv_.style.left,this.eventDiv_.style.top=this.labelDiv_.style.top,this.setZIndex()},MarkerLabel_.prototype.setZIndex=function(){var t=this.marker_.get("labelInBackground")?-1:1;void 0===this.marker_.getZIndex()?this.labelDiv_.style.zIndex=parseInt(this.labelDiv_.style.top,10)+t:this.labelDiv_.style.zIndex=this.marker_.getZIndex()+t,this.eventDiv_.style.zIndex=this.labelDiv_.style.zIndex},MarkerLabel_.prototype.setVisible=function(){this.marker_.get("labelVisible")?this.labelDiv_.style.display=this.marker_.getVisible()?"block":"none":this.labelDiv_.style.display="none",this.eventDiv_.style.display=this.labelDiv_.style.display},inherits(MarkerWithLabel,google.maps.Marker),MarkerWithLabel.prototype.setMap=function(t){google.maps.Marker.prototype.setMap.apply(this,arguments),this.label.setMap(t)})}function MikaResultsBoard(){}MikaResultsBoard.prototype={options:{},requester:{},data:{},targetElement:{},strings:{},timer:{},options_submit:{},subSelectorState:{},favorites:[],renderQueue:[],maps:{},mapPolylines:{},mapMarkers:{},mapMarkersPersons:{},mapMarkersFree:{},mapMarkerCluster:{},mapMarkerClusterIcons:{},mapOverlays:{},mapAutoZoom:!1,mapBounds:{},favoritesSelected:[],replay_time_max:0,replay_time:0,replay_daytime:0,replay_speed:0,replay_running:!1,slider_time:{},slider_speed:{},events:{},eventsDelete:{},favoritesOrderReplay:{},favoritesOrderLive:{},shift_pressed:!1,ctrl_pressed:!1,shortcuts_registred:!1,debugTimers:{},pixelRatio:1,setOptions:function(t){this.options=t},setJQ:function(t){},createResultsBoard:function(t){"function"!=typeof jQuery?console.log("no jQuery found!"):(this.targetElement=t,this.options.autoFollow=!0,this.favorites=[],this.events.click=[],this.events.mouseover=[],this.events.mouseout=[],this.eventsDelete.click=[],this.eventsDelete.mouseover=[],this.eventsDelete.mouseout=[],this.options_submit.option_bar={},this.mapOverlays=[],this.pixelRatio=this.getDevicePixelRatio(),this.load())},makeRequest:function(t,e,i){this.requester[t]=jQuery.ajax({type:"POST",url:this.options.path+"/index.php?content=ajax2&func="+t+"&onpage="+this.options.pid,data:{func:t,options:e},success:i})},log:function(t,e,i){var s;this.options.debug&&"object"==typeof console&&(i?this.debugTimers[t]=this.microtime():this.debugTimers[t]&&(s=t+" (duration "+(this.microtime()-this.debugTimers[t])+"ms)"),e=e||"log",console[e](s||t))},ms2time:function(t){var e=t<0?(t*=-1,"-"):"",t=Math.ceil(t/1e3),i=t/60,s=i/60,o=s/24;return 1<=i?t-=60*(i=Math.floor(i)):i=0,1<=s?i-=60*(s=Math.floor(s)):s=0,1<=o?s-=24*(o=Math.floor(o)):o=0,s<10&&(s="0"+s),i<10&&(i="0"+i),t<10&&(t="0"+t),o?e+o+s+":"+i+":"+t:e+s+":"+i+":"+t},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 e=this.options.globalObjectName;this.makeRequest("getLeaderboard",this.options_submit,function(t){window[e].setData(t)})},addToRenderQueue:function(t){-1==this.renderQueue.indexOf(t)&&this.renderQueue.push(t)},clearRenderQueue:function(){this.renderQueue=[]},registerEvents:function(){var t,e,i;for(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(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)}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&&(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,s=(void 0===this.data.settings&&(i=!0),!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)for(e in this.favorites=[],t.settings.favorites)t.settings.favorites.hasOwnProperty(e)&&this.favorites.push(t.settings.favorites[e]);for(e in void 0===this.data.global&&(this.data.global={},this.data.global.meta={},this.options_submit.globalData={}),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()}for(e in this.options_submit.containers={},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('<time datetime="'+this.data.lastUpdateTs+'" data-direction="up">00:00</time>'):jQuery(".resultsboard-"+this.options.globalObjectName+' [data-type="lastupdatetimestamp"]').html(this.formatTime(new Date))),MikaResultsRenderTrigger()},formatTime:function(t){var e=t.getHours(),i=t.getMinutes(),t=t.getSeconds();return e+":"+(i=i<10?"0"+i:i)+":"+(t=t<10?"0"+t:t)},microtime:function(){return(new Date).getTime()},getClientSeconds:function(){var t=new Date,e=3600*t.getHours();return(e+=60*t.getMinutes())+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=0,a=0,r=0,n=this.getContainerByType("favorites");if(n.data){var l,d={},h={},p={},c={},u=0,g=0;for(l in n.data.rows)if(n.data.rows.hasOwnProperty(l)){var m,f=n.data.rows[l];f.split_groups[f.global_info.active_group_key];for(t in void 0===f.is_in_replay&&("F"==f.global_info.race_status&&this.data.global.options.replay_mode?f.is_in_replay=!0:f.is_in_replay=!1),w=k=b=!1,f.starttime_net_ms&&(f.starttime_net_ms=parseInt(f.starttime_net_ms),u=u||f.starttime_net_ms,u=Math.min(u,f.starttime_net_ms)),f.splits)f.splits.hasOwnProperty(t)&&(e=f.splits[t],f.is_in_replay?(g=this.data.global.options.replay_daytime?f.starttime_net_ms-u:0,this.replay_time&&e.time_ms&&e.time_ms+g<=this.replay_time&&(b=e,void 0!==f.splits[parseInt(t)+1]?k=f.splits[parseInt(t)+1]:(k=b,w=!0)),e.time_ms&&(this.data.global.options.replay_daytime?this.replay_time_max=Math.max(this.replay_time_max,e.time_ms+g):this.replay_time_max=Math.max(this.replay_time_max,e.time_ms))):e.time_ms&&"-"!=e.time_ms&&(b=e,k=!1));if(!b&&f.is_in_replay){for(t in f.splits)if(f.splits.hasOwnProperty(t)){k=f.splits[t];break}b=k}if(k)for(i in f.split_groups)f.split_groups.hasOwnProperty(i)&&(i==b.group?(void 0===h[i]&&(h[i]={}),void 0===d[i]&&(d[i]={}),f.is_in_replay&&this.data.global.options.replay_mode?(f.split_groups[i].active=!0,f.global_info.active_group_key=i,a=0,r=this.data.global.options.replay_daytime?(this.replay_time-g-b.time_ms)/k.ms_km_estimate:(this.replay_time-b.time_ms)/k.ms_km_estimate,r+=b.km-f.split_groups[i].first_km,(isNaN(r)||r<0)&&(r=0),f.split_groups[i].estimated_pos=r,m=this.replay_time-g,f.race_time=0<m&&!w?this.ms2time(m):w?b.time:"00:00:00",f.split_groups[i].estimated_pos_string=r.toFixed(2),h[i][f.id]=r,f.split_groups[i].state="started",w&&(f.split_groups[i].estimated_pos="finished",f.split_groups[i].state="finished")):isNaN(f.split_groups[i].estimated_pos)?d[i][f.id]=0:d[i][f.id]=f.split_groups[i].estimated_pos):f.is_in_replay&&this.data.global.options.replay_mode&&(f.split_groups[i].active=!1));else{if(!b)for(i in f.split_groups)if(f.split_groups.hasOwnProperty(i)){"S"==f.global_info.race_status?(f.split_groups[i].estimated_pos="not_started",f.split_groups[i].estimated_pos_string="not_started"):(f.split_groups[i].estimated_pos="started",f.split_groups[i].estimated_pos_string="started");break}var _=1e3*(this.getClientSeconds()+this.data.settings.time_offset)-f.position_data.daytime_last_change,v=f.position_data.speed_kmh/3.6,y=((1e3*f.position_data.pos_km+_/1e3*v)/1e3).toFixed(2);for(i in y<f.position_data.pos_km&&(y=f.position_data.pos_km.toFixed(2)),f.split_groups)!f.split_groups.hasOwnProperty(i)||i!=b.group&&"estimated_chip"==f.position_data.source||("A"==f.global_info.race_status?(f.split_groups[i].state="started",y<=f.position_data.valid_until_km?f.split_groups[i].estimated_pos=f.split_groups[i].estimated_pos_string=y:f.split_groups[i].estimated_pos=f.split_groups[i].estimated_pos_string=f.position_data.valid_until_km):"F"==f.global_info.race_status?f.split_groups[i].estimated_pos=f.split_groups[i].state="finished":"S"==f.global_info.race_status&&(f.split_groups[i].estimated_pos=f.split_groups[i].state="not_started"),void 0===h[i]&&(h[i]={}),void 0===d[i]&&(d[i]={}),isNaN(f.split_groups[i].estimated_pos)?d[i][f.id]=0:d[i][f.id]=f.split_groups[i].estimated_pos)}}for(l in n.data.rows)if(n.data.rows.hasOwnProperty(l)){var b="",k="",w=!1;for(t in(f=n.data.rows[l]).splits)f.splits.hasOwnProperty(t)&&(e=f.splits[t],f.is_in_replay?this.replay_time&&e.time_ms<=this.replay_time&&(b=e,void 0!==f.splits[parseInt(t)+1]?k=f.splits[parseInt(t)+1]:(k=b,w=!0)):e.time_ms&&"-"!=e.time_ms&&(b=e,k=!1));for(t in p[(b=b||(k=f.splits[0])).group]=0,c[b.group]=0,d[b.group])d[b.group].hasOwnProperty(t)&&(p[b.group]=Math.max(d[b.group][t],p[b.group]));for(t in h[b.group])h[b.group].hasOwnProperty(t)&&(c[b.group]=Math.max(h[b.group][t],c[b.group]));for(i in f.split_groups)f.split_groups.hasOwnProperty(i)&&i==b.group&&(a=f.is_in_replay&&this.data.global.options.replay_mode?(o=c[i]-f.split_groups[i].estimated_pos,f.split_groups[i].diff_km=o,isNaN(o)&&0!=o?f.split_groups[i].diff_km_string="+0 km":f.split_groups[i].diff_km_string="+"+o.toFixed(2)+" km",(c[i]-f.split_groups[i].estimated_pos)*k.ms_km_estimate):(o=p[i]-f.split_groups[i].estimated_pos,f.split_groups[i].diff_km=o,isNaN(o)&&0!=o?f.split_groups[i].diff_km_string="+0 km":f.split_groups[i].diff_km_string="+"+o.toFixed(2)+" km",(p[i]-f.split_groups[i].estimated_pos)*f.split_groups[i].ms_km_estimate),f.split_groups[i].diff_time=a,isNaN(a)&&0!=a?f.split_groups[i].diff_time_string="+0":f.split_groups[i].diff_time_string="+"+this.ms2time(a))}for(i in this.favoritesOrderLive={},d)if(d.hasOwnProperty(i)){for(t in s={},d[i])d[i].hasOwnProperty(t)&&(s[d[i][t]]=t);for(t in s=this.sortObjByKey(s,!0),this.favoritesOrderLive[i]=[],s)s.hasOwnProperty(t)&&this.favoritesOrderLive[i].push(s[t]);for(t in this.favoritesOrderLive[i].reverse(),d[i])!d[i].hasOwnProperty(t)||d[i][t]||this.favoritesOrderLive[i].push(t)}for(i in this.favoritesOrderReplay={},h)if(h.hasOwnProperty(i)){for(t in s={},h[i])h[i].hasOwnProperty(t)&&h[i][t]&&(s[h[i][t]]=t);for(t in s=this.sortObjByKey(s,!0),this.favoritesOrderReplay[i]=[],s)s.hasOwnProperty(t)&&this.favoritesOrderReplay[i].push(s[t]);for(t in this.favoritesOrderReplay[i].reverse(),h[i])!h[i].hasOwnProperty(t)||h[i][t]||this.favoritesOrderReplay[i].push(t)}for(t in this.log("function: refresh","info"),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+u)):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);for(i in e?s.sort(function(t,e){return t-e}):s.sort(),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+='  <div title="'+this.strings.help_fullscreen+'" class="tt-help layout-button layout-button-fullscreen"><img onclick="'+this.options.globalObjectName+".trigger('switchFullscreen');\" src=\""+this.options.path_images+'/icon_fullscreen.png" alt="'+this.strings.reload+'"/><span onclick="'+this.options.globalObjectName+".trigger('switchFullscreen');\">"+this.strings.fullscreen+"</span></div>":t+='  <div class="tt-help layout-button layout-button-fullscreen"><img onclick="'+this.options.globalObjectName+".trigger('switchFullscreen');\" src=\""+this.options.path_images+'/icon_fullscreen.png" alt="'+this.strings.reload+'"/><span onclick="'+this.options.globalObjectName+".trigger('switchFullscreen');\">"+this.strings.fullscreen_close+"</span></div>",t+='  <div title="'+this.strings.help_reload+'" class="tt-help layout-button layout-button-reload"><img onclick="'+this.options.globalObjectName+".trigger('reload');\" src=\""+this.options.path_images+'/icon_refresh.png" alt="'+this.strings.reload+'" /><span onclick="'+this.options.globalObjectName+".trigger('reload');\">"+this.strings.reload+"</span></div>",this.getContainerByType("list")&&(this.options.autoFollow?t+='  <div title="'+this.strings.help_autofollow+'" class="tt-help layout-button layout-button-follow"><img onclick="'+this.options.globalObjectName+".trigger('autoFollow', false);\" src=\""+this.options.path_images+'/icon_autofollow_active.png" alt="'+this.strings.auto_follow+'" /><span onclick="'+this.options.globalObjectName+".trigger('autoFollow', false);\">"+this.strings.auto_follow+"</span></div>":t+='  <div title="'+this.strings.help_autofollow+'" class="tt-help layout-button layout-button-follow"><img onclick="'+this.options.globalObjectName+".trigger('autoFollow', true);\" src=\""+this.options.path_images+'/icon_autofollow.png" alt="'+this.strings.auto_follow+'" /><span onclick="'+this.options.globalObjectName+".trigger('autoFollow', true);\">"+this.strings.auto_follow+"</span></div>"),this.options.help&&(t+='  <div title="" class="tt-help-info layout-button layout-button-help"><img src="'+this.options.path_images+'/icon_help.png" alt="" /><span>'+this.strings.help+"</span></div>"),t},renderMain:function(){var t,e=(e=(e=(e="")+('<div class="list-head">'+this.options.title)+'  <div class="list-option-buttons hideable">')+this.renderMainButtons()+"  </div>")+"</div>"+'<div class="lb-containers">';for(t in"jqm"==this.options.theme&&(e+='<ul class="resultsboard-wrap" data-role="listview"><li class="resultsboard-wrap-li">'),void 0!==this.data.global.global_option_bar&&(e+=this.renderOptionBar()),this.data.global.options.cols)this.data.global.options.cols.hasOwnProperty(t)&&(e+='<div class="lb-col col-id-'+this.data.global.options.cols[t].id+'"></div>');return"jqm"==this.options.theme&&(e+="</li></ul>"),e=e+"</div>"+'<div class="list-footer">',1==this.data.settings.global_event_official_show&&(e+='<p class="event-official">'+this.data.settings.global_event_official_string+"</p>"),e+="</div>"},clearCols:function(){jQuery(".lb-col").html("")},trigger:function(t,e){var i;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)if(o=[],-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":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":var o=[],a=(jQuery(".resultsboard-"+this.options.globalObjectName+" form").each(function(t,e){"lb"==e.name&&(o=jQuery(this).serializeArray())}),{});for(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":for(var r in 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")),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(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":for(r in(p=jQuery(".resultsboard-"+this.options.globalObjectName+" .overlayMenu")).css({display:"none"}),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"});var p,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":(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{i=this.renderContainer(e,!1);jQuery(".resultsboard-"+this.options.globalObjectName+" .lb-col.col-id-"+this.data.containers[e].col).append(i)}if("map"==this.data.containers[e].type&&this.mapInit(e),"favorites"==this.data.containers[e].type)for(var a in this.data.containers)this.data.containers.hasOwnProperty(a)&&"map"==this.data.containers[a].type&&this.mapUpdate(a);if("overlays"==this.data.containers[e].type)for(var a in this.data.containers)this.data.containers.hasOwnProperty(a)&&"map"==this.data.containers[a].type&&this.mapUpdateOverlays(a)}var r,n="";for(r in this.data.global.options.cols)this.data.global.options.cols.hasOwnProperty(r)&&(n+=".lb-col.col-id-"+this.data.global.options.cols[r].id,r+1<this.data.global.options.cols.length)&&(n+=",");var l,d=this.options.globalObjectName,h=(jQuery(n).sortable({connectWith:".resultsboard-"+this.options.globalObjectName+" .lb-col",placeholder:"lb-sortable-placeholder",distance:20,handle:".drag",update:function(t,e){window[d].renderContainers()}}),this.options_submit),p=this.options.pid;jQuery(".resultsboard-"+d+" input#autocomplete").autocomplete({source:function(t,e){h.string=t.term,jQuery.ajax({url:"index.php?content=ajax2&onpage="+p,type:"GET",data:{func:"getSearchResult",options:h},success:function(t){t.length?(jQuery(".resultsboard-"+d+" .leaderboard-search input").tooltip("close"),jQuery(".resultsboard-"+d+" .leaderboard-search input").tooltip("disable")):(jQuery(".resultsboard-"+d+" .leaderboard-search input").tooltip("enable"),jQuery(".resultsboard-"+d+" .leaderboard-search input").tooltip("open")),e(t)}})},minLength:1,delay:this.data.global.options.search_delay,autoFocus:!0,select:function(t,e){return window[d].trigger("addFavorite",{id:e.item.id}),!0}}),this.data.global.options.focus_input&&jQuery(".resultsboard-"+this.options.globalObjectName+" input#autocomplete").focus(),this.registerEvents(),this.registerTooltips(),"jqm"==this.options.theme&&(jQuery(".resultsboard-"+this.options.globalObjectName+" .lb-containers").trigger("create"),applySizes()),1==this.data.settings.global_event_official_show?(l=jQuery(".resultsboard-"+this.options.globalObjectName+" .event-official")).length?jQuery(l).html(this.data.settings.global_event_official_string):jQuery(".resultsboard-"+this.options.globalObjectName+" .list-footer").append('<p class="event-official">'+this.data.settings.global_event_official_string+"</p>"):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,o=this.data.containers[t],a="",r="",n=o.title;if(void 0!==o.data.sub_selector){if(!this.subSelectorState[t]||o.data.rows[this.subSelectorState[t]]||(this.subSelectorState[t]=!1),!this.subSelectorState[t])for(i in o.data.sub_selector)o.data.sub_selector.hasOwnProperty(i)&&o.data.sub_selector[i].has_data&&(this.subSelectorState[t]=i);if(this.options.autoFollow)for(i in o.data.sub_selector)o.data.sub_selector.hasOwnProperty(i)&&o.data.sub_selector[i].has_data&&(this.subSelectorState[t]=i);for(i in this.subSelectorState[t]||(this.subSelectorState[t]=0),o.data.sub_selector)o.data.sub_selector.hasOwnProperty(i)&&i==this.subSelectorState[t]&&(s=o.data.sub_selector[i].name);this.data.global.options.append_subselector_title&&(n=o.title+" <span>"+s+"</span>")}return"jqm"===this.options.theme?(e||(a+='<div class="lb-container container-id-'+t+'" id="container_'+t+'">'),a=(a=a+'<ul data-inset="false" data-role="listview"><li data-role="list-divider">'+o.title+"</li>")+'<li> <div class="lb-container-content" id="container-content-'+t+'">',(r=this.renderContainerContent(t))&&(a+=r),a+=" </div></li></ul>"):(e||(a+='<div class="lb-container container-id-'+t+'" id="container_'+t+'">'),a=(a=a+' <div class="container-info">  <div class="container-headline">'+n+"</div>")+'  <div class="list-options hideable">   <span class="drag"><img src="'+this.options.path_images+'/icon_drag.gif" alt="'+this.strings.move+'" title="'+this.strings.move+'" /></span>  </div> </div>',a+=' <div class="lb-container-content" id="container-content-'+t+'">',(r=this.renderContainerContent(t))&&(a+=r),a+=" </div>"),e||(a+="</div>"),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 o="";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 a="",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="&nbsp;<small>"+(">"==t[e.field].trend_place_diff.modifier?"&gt;":t[e.field].trend_place_diff.modifier)+t[e.field].trend_place_diff.places+"</small>":void 0!==t[e.field].trend_place_diff&&"plus"==t[e.field].value|"minus"==t[e.field].value&&(a=t[e.field].trend_place_diff.modifier+""+t[e.field].trend_place_diff.places),(o+="<td"+i+'><img src="'+this.options.path_images+"/"+s+'" title="'+a+'" alt="">')+r+"</td>"},renderContainerContentTypeList:function(t){var e,i,s,o=this.data.containers[t],a="",r="",n="",l="",d="",h=!1,p=void 0!==o.data.sub_selector?(a+=this.renderSubSelector(t),o.data.rows[this.subSelectorState[t]]):o.data.rows,c=!1;for(i in this.data.containers)if(this.data.containers.hasOwnProperty(i)&&"favorites"==this.data.containers[i].type){c=this.data.containers[i];break}if(c){var u,g=[];for(i in c.data.rows)c.data.rows.hasOwnProperty(i)&&(u=c.data.rows[i]).id&&g.push(u.id)}else g=this.favorites;if(a+="","jqm"===this.options.theme)a+='<ul data-role="listview" data-split-icon="plus" data-split-theme="a">';else{a+='<table border="0" cellspacing="0" cellpadding="0" class="list-table"><thead><tr>',"none"!=this.data.global.options.favorites_mode&&(a+='<td class="color last">&nbsp;</td>');var m=0;for(i in o.data.fields.data)o.data.fields.data.hasOwnProperty(i)&&m++;var f=0;for(i in o.data.fields.data)o.data.fields.data.hasOwnProperty(i)&&((e=o.data.fields.data[i]).width||(e.width="auto"),r="",e.class&&(r+=e.class),f+1==m&&(r+=" last"),a+="<td"+(r=r&&' class="'+r+'"')+' style="width:'+e.width+'">'+e.name+"</td>",f++);a+="</tr></thead>"}if(p.length){if("jqm"!==this.options.theme){var _=0;for(void 0!==o.data.options.num_results&&p.length<o.data.options.num_results&&(_=p.length<=o.data.options.max_results?o.data.options.max_results-p.length:o.data.options.num_results-p.length),i=0;i<_;i++)p.push({})}for(i in p)if(p.hasOwnProperty(i)){var v,y,b,n="",l="",h=!1,k=!1;for(s in v=p[i])if(v.hasOwnProperty(s)){k=!0;break}for(b in i%2&&(n+=" list-highlight"),-1!=this.favorites.indexOf(v.id)&&"none"!=this.data.global.options.favorites_mode&&(n+=" favorite",h=!0),n=' class="'+n+'"',"jqm"===this.options.theme?void 0===v.id?a+="<li>":(l+=' style="cursor:pointer"',a+="<li "+(h?'class="favorite" data-icon="delete" data-theme="b"':"")+'><a href="'+("?content=detail&amp;fpid=search&amp;pid=search&amp;idp="+v.id+"&amp;lang="+this.options.lang+"&amp;event="+this.data.settings.global_event)+'">'):(void 0===v.id?a+='<tr style="cursor:default"'+n+">":a+="<tr onmouseover=\"jQuery(this).addClass('mark');\" onmouseout=\"jQuery(this).removeClass('mark');\""+n+l+">","none"!=this.data.global.options.favorites_mode&&(y="",y=this.data.global.options.favorite_titles[this.favorites.indexOf(v.id)]?this.data.global.options.favorite_titles[this.favorites.indexOf(v.id)]:"",y=this.data.global.options.favorite_titles[g.indexOf(v.id)]?this.data.global.options.favorite_titles[g.indexOf(v.id)]:"",a+='<td class="color last"><div class="fav-color i-'+g.indexOf(v.id)+'">'+y+"</div></td>")),f=0,o.data.fields.data)if(o.data.fields.data.hasOwnProperty(b)){e=o.data.fields.data[b],r="",d=k?e.type:"fillup",e.class&&(r+=e.class),f+1==m&&(r+=" last");var w="";if("add_favorite"==d&&(r+=" icon s favorite-toggle"),r&&(w=' class="'+r+'"'),"jqm"===this.options.theme)switch(d){case"add_favorite":break;case"trend":v[e.field]?a+=this.renderTrendField(v,e,w,""):a+="<span></span>";break;default:"name"==e.role?a+="<h3>"+(void 0!==v[e.field]&&null!=v[e.field]?v[e.field]:"")+"</h3>":"actual_split_time"==e.field?a+='<div class="field time'+r+'"><span class="desc">'+e.name+"</span>"+(void 0!==v[e.field]&&null!=v[e.field]?v[e.field]:"")+"</div>":a+='<div class="field '+r+'"><span class="desc">'+e.name+"</span>"+(void 0!==v[e.field]&&null!=v[e.field]?v[e.field]:"")+"</div>"}else switch(d){case"add_favorite":a+=h?"<td"+w+' onclick="'+this.options.globalObjectName+".trigger('removeFavorite', {id:'"+v.id+"', container:'"+t+'\'}); return false;"><img style="cursor:pointer" title="'+this.strings.add_favorite_list+'" src="'+this.options.path_icons+'/icons/check.svg" onmouseover="this.src=\''+this.options.path_icons+"/icons/delete.svg';\" onmouseout=\"this.src='"+this.options.path_icons+'/icons/check.svg\';"  alt=""></td>':"<td"+w+' onclick="'+this.options.globalObjectName+".trigger('addFavorite', {id:'"+v.id+"', container:'"+t+'\'}); return false;"><img style="cursor:pointer" title="'+this.strings.add_favorite_list+'" src="'+this.options.path_icons+'/icons/add.svg" alt=""></td>';break;case"trend":v[e.field]?a+=this.renderTrendField(v,e,w,""):a+="<td"+w+"></td>";break;case"fillup":a+="<td"+w+">&nbsp;</td>";break;default:a+="<td"+w+">"+(void 0!==v[e.field]&&null!=v[e.field]?v[e.field]:"")+"</td>"}f++}"jqm"===this.options.theme?a+=h?'</a><a href="#" data-ajax="false" onclick="'+this.options.globalObjectName+".trigger('removeFavorite', {id:'"+v.id+"', container:'"+t+"'}); return false;\" onmouseover=\"jQuery(this).addClass('mark');\" onmouseout=\"jQuery(this).removeClass('mark');\""+n+l+"></a></li>":'</a><a href="#" data-ajax="false" onclick="'+this.options.globalObjectName+".trigger('addFavorite', {id:'"+v.id+"', container:'"+t+"'}); return false;\" onmouseover=\"jQuery(this).addClass('mark');\" onmouseout=\"jQuery(this).removeClass('mark');\""+n+l+"></a></li>":a+="</tr>"}}else{var j=5;o.data.options.num_results&&(j=o.data.options.num_results),"jqm"===this.options.theme?a+='<li><div class="results-message">'+this.strings.no_results+"</div></li>":a+='<tr><td class="message-cell" colspan="'+(f+1)+'" style="height:'+18*j+'px; text-align:center;border-right:0;"><div class="results-message">'+this.strings.no_results+"</div></div></td></tr>"}return"jqm"===this.options.theme?a+="</ul>":a+="</table>",a},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+='<div class="optionbar hideable" id="optionbar-global">'),i+='<form action="" id="lb" name="lb">',void 0!==s.fields&&s.fields.length)for(var o in s.fields)if(s.fields.hasOwnProperty(o)){var a,r,n=s.fields[o],i="jqm"===this.options.theme?1<s.fields.length?(i=(i+='<div data-role="fieldcontain" class="ui-hide-label optionbar-option option-left">')+'<label for="field_'+n.name+'">'+n.title+"</label> ")+'<select data-mini="true" data-inline="true" name="field_'+n.name+'" id="field_'+n.name+'" onchange="'+this.options.globalObjectName+".trigger('submitOptions');\">":(i=(i+='<div data-role="fieldcontain" class="ui-hide-label optionbar-option">')+'<label for="field_'+n.name+'">'+n.title+"</label> ")+'<select data-mini="true" name="field_'+n.name+'" id="field_'+n.name+'" onchange="'+this.options.globalObjectName+".trigger('submitOptions');\">":(i=(i+='<div class="optionbar-option option-left">')+"<span>"+n.title+"</span> ")+'<select name="field_'+n.name+'" id="field_'+n.name+'" onchange="'+this.options.globalObjectName+".trigger('submitOptions', {triggerField:'"+n.name+"'});\">",l="";for(a in n.data)break;for(e in void 0!==n.data[a].index&&(n.data.sort(function(t,e){return t.index==e.index?0:t.index<e.index?-1:1}),r={},jQuery.each(n.data,function(t,e){r[e.key]=e.name}),n.data=r),n.data)n.data.hasOwnProperty(e)&&(l="",n.selected==e&&(l=' selected="selected"'),"%"==e&&"jqm"==this.options.theme&&(n.data[e]=n.title+": "+n.data[e]),i+='<option value="'+e+'"'+l+">"+n.data[e]+"</option>",0);i=i+"</select>"+"</div>"}if(void 0!==s.options&&void 0!==s.options.hideable&&s.options.hideable&&(i+="<a href=\"#\" onclick=\"jQuery('#optionbar-global').css('display','none');\">Hide</a>"),void 0!==s.options.limits&&s.options.limits.length){for(e in i="jqm"===this.options.theme?i+'<div data-role="fieldcontain" class="ui-hide-label optionbar-option option-right"><select name="option_limit" id="option_limit" onchange="'+this.options.globalObjectName+".trigger('submitOptions');\">":i+'<div class="optionbar-option option-right"><select name="option_limit" id="option_limit" onchange="'+this.options.globalObjectName+".trigger('submitOptions');\">",s.options.limits)s.options.limits.hasOwnProperty(e)&&(l="",void 0!==this.data.settings&&this.data.settings.limit==s.options.limits[e]&&(l=' selected="selected"'),i+='<option value="'+s.options.limits[e]+'"'+l+">TOP "+s.options.limits[e]+"</option>");i=i+"</select>"+"</div>"}"undefined"!=s.options.show_last_update&&!0===s.options.show_last_update&&"jqm"!==this.options.theme&&(i=i+'<div class="optionbar-option option-right">'+this.strings["resultsboard.last_update"]+' <span data-type="lastupdatetimestamp">',void 0!==s.options.last_update_count_up&&!0===s.options.last_update_count_up?i+='<time datetime="'+this.data.lastUpdateTs+'" data-direction="up">00:00</time>':i+=this.formatTime(new Date),i+="</span></div>"),i=i+'<div style="clear:both"></div>'+"</form>",t||(i+="</div>")}return void 0!==s.options&&void 0!==s.options.hideable&&s.options.hideable&&(i+="<a class=\"hidebutton\" href=\"#\" onclick=\"jQuery('optionbar-global').css('display','block');\">.</a>"),t?(jQuery("#optionbar-global").html(i),""):i},renderSubSelector:function(t){var e,i,s,o,a,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=30<r?"buttons":"dropdown"),"buttons"==u.data.options.sub_selector_mode){for(e in"jqm"===this.options.theme?l+='<div data-role="controlgroup" data-type="horizontal" class="status" style="width: 100%;">':u.data.options.sub_selector_class?l+='<div class="status hideable-extended '+u.data.options.sub_selector_class+'">':l+='<div class="status hideable-extended">',u.data.sub_selector)u.data.sub_selector.hasOwnProperty(e)&&u.data.sub_selector[e].has_data&&0;for(e in r=0,n="","calc"==u.data.options.sub_selector_width?n="jqm"===this.options.theme?(r=100/u.data.sub_selector.length,r-=.1*(u.data.sub_selector.length+1),"%;"):(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,"px;"):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,u.data.sub_selector)u.data.sub_selector.hasOwnProperty(e)&&(d=p="",h="width:"+s,(o=u.data.sub_selector[e]).color&&(h+="background-color:"+o.color+";"),o.class&&(d+=o.class+" "),a=!1,e==this.subSelectorState[t]&&(d+="selected ",p+=' data-theme="a"',a=!0),o.has_data&&(d+="active ",a||(p+=' data-theme="b"')),i+1==u.data.sub_selector.length&&(d+="last "),h=h&&'style="'+h+'" ',"jqm"===this.options.theme?l+="<a "+p+' data-role="button" '+h+'onclick="'+this.options.globalObjectName+".trigger('setSelector', {key:'"+e+"', container:'"+t+'\'}); return false;" href="#" class="'+d+'"><span>'+o.name+"</span></a>":l+="<a "+h+'onclick="'+this.options.globalObjectName+".trigger('setSelector', {key:'"+e+"', container:'"+t+'\'}); return false;" href="#" class="'+d+'"><span>'+o.name+"</span></a>",i++);l+="</div>"}else if("dropdown"==u.data.options.sub_selector_mode){for(var g in l+='<select data-mini="true" class="sub_selector" onchange="'+this.options.globalObjectName+".trigger('setSelector', {key:this.value, container:'"+t+"'}); return false;\" >",u.data.sub_selector)u.data.sub_selector.hasOwnProperty(g)&&(o=u.data.sub_selector[g],c="",g==this.subSelectorState[t]&&(c=' selected="selected"'),o.has_data,l+='<option value="'+g+'"'+c+">"+o.name+"</option>");l+="</select>"}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 o in s.data.split_groups.data){var a=s.data.split_groups.data[o].name;for(i in jQuery(".favorite-boxes .split-group-"+a+" .replay-barrier").remove(),this.favoritesOrderLive[a])this.favoritesOrderLive[a].hasOwnProperty(i)&&jQuery("#f-"+this.favoritesOrderLive[a][i]).appendTo(".favorite-boxes .split-group-"+a);if(this.data.global.options.replay_mode&&this.favoritesOrderReplay[a]&&this.favoritesOrderReplay[a].length)for(i in jQuery(".favorite-boxes .split-group-"+a).append('<div class="replay-barrier"><span>REPLAY</span></div>'),this.favoritesOrderReplay[a])this.favoritesOrderReplay[a].hasOwnProperty(i)&&jQuery("#f-"+this.favoritesOrderReplay[a][i]).appendTo(".favorite-boxes .split-group-"+a)}},renderContainerContentTypeFavorites:function(t){var e,i,s=this.data.containers[t],o="",a=(o+='<div class="status buttons favorites hideable">',this.data.global.options.show_clear_button&&(o+=' <a href="#" onclick="'+this.options.globalObjectName+".trigger('clearFavorites'); return false;\">"+this.strings.clear+"</a>"),this.data.global.options.show_search&&(o+=' <div class="leaderboard-search"><span class="caption">'+this.strings.add_favorite+'</span> <input type="text" id="autocomplete" name="autocomplete_parameter" onfocus="this.value=\'\';this.style.color=\'#333333\';" onblur="this.style.color=\'#AAAAAA\'; this.value=\''+this.strings.search_help+'\'" value="'+this.strings.search_help+'" /></div>'),this.data.global.options.show_details_button&&(o+=' <div class="leaderboard-details"><span class="caption">'+this.strings.show_details+'</span> <input onclick="'+this.options.globalObjectName+".trigger('showDetails', this.checked); return false;\" "+(this.data.global.options.showDetails?" checked":"")+' type="checkbox" id="show_details" name="show_details" value="1" /></div>'),o=o+"</div>"+'<div class="favorite-boxes">',2),r=(this.data.global.options.favorite_cols&&(a=this.data.global.options.favorite_cols),a=parseInt(a),"calc"==s.data.options.width?(e="",(e=jQuery(".lb-container.container-id-"+t).width()?jQuery(".lb-container.container-id-"+t).width()/a:jQuery(".lb-col.col-id-"+s.col).width()/a)<220&&(a=1,e=jQuery(".lb-container.container-id-"+t).width()?jQuery(".lb-container.container-id-"+t).width()/a:jQuery(".lb-col.col-id-"+s.col).width()/a),1<a&&(e=e-4+3/a),e+="px;"):e=s.data.options.width||!1,!1);for(i in s.data.split_groups.data){var n,l,d,h=s.data.split_groups.data[i];for(n in 1<s.data.split_groups.data.length&&s.data.options.use_split_groups?(l=e?"width:"+e+";":"",(i+1)%a==0&&(l+="margin-right:0;"),o=(o+='<div style="'+l+'" class="split-group split-group-'+h.name+'">')+'<div class="label"><span>'+h.title+"</span></div>"):o+='<div style="margin-right:0" class="split-group split-group-'+h.name+'">',s.data.rows)l=e?"width:"+e+";":"",s.data.rows.hasOwnProperty(n)&&s.data.rows[n].id&&(d=!1,jQuery.each(s.data.rows[n].split_groups,function(t,e){e.active&&(d=e,0)}),d||jQuery.each(s.data.rows[n].split_groups,function(t,e){return d=e,!1}),s.data.options.use_split_groups&&d.name!=h.name||(r=!0,n=parseInt(n),o+=this.renderFavorite(s.data.rows[n],s.data.fields.data,s.data.options,l,n)));if(o+="</div>",!s.data.options.use_split_groups)break}return r||(this.data.global.options.replay_mode?o+='<div class="results-message">'+this.strings.help_favorites_replay+"</div>":o+='<div class="results-message">'+this.strings.help_favorites+"</div>"),o+="</div>"},renderFavorite:function(e,t,i,s,o,a,r){var n,l,d=[],h="";for(n in t)t.hasOwnProperty(n)&&((l=t[n]).active&&!l.split&&-1==l.field.search("time_finish_")&&-1!=l.field.search("place")&&(d.push(l),0<e[l.field])&&0);var p,c,u=this.renderFavoritesHead(e,t,o,i),u=(u+='<div class="info-table-wrap fields-primary">')+this.renderFavoritesPrimaryFields(e,t,i)+"</div>";if(i.collapsible||(1<d.length&&(u=(u+='<div class="info-table-wrap places">')+this.renderFavoritesPlaces(e,d,i)+"</div>"),this.data.global.options.show_details&&(u=(u+='<div class="info-table-wrap splits">')+this.renderFavoritesSplits(e,t,i)+"</div>")),i.collapsible&&!r&&(p=this.renderFavoritesHead(e,t,o,i),p=(p+='<div class="info-table-wrap fields-secondary">')+this.renderFavoritesSecondaryFields(e,t,i)+"</div>",1<d.length&&(p=(p+='<div class="info-box info-box-places">')+this.renderFavoritesPlaces(e,d,i)+"</div>"),p=(p=this.data.global.options.show_details?(p+='<div class="info-box info-box-splits">')+this.renderFavoritesSplits(e,t,i)+"</div>":p)+'<div class="info-buttons"><a onclick="'+this.options.globalObjectName+".trigger('closeFavoriteDetails', {id_favorite:'"+e.id+'\'}); return false;" class="button-secondary close">close details</a><span>drag box to detach</span></div>'),!a)return a="info-box favorite-wrap",a+=" index-"+o,o%2&&(a+=" highlight"),this.options.addFavorite==e.id&&(a+=" favorite-active"),h=(h=h+('<div class="'+a+'"'+(s=' style="'+s+'"')+' id="f-'+e.id)+'"><div class="sensitive">  <div class="info-primary">')+u+"  </div>",i.collapsible&&(h=h+'<div class="info-buttons"><a id="b-'+e.id+'" class="button-secondary open">show details</a><div style="clear:both"></div></div>',c=this.options.globalObjectName,this.events.click.push({selector:"#f-"+e.id+" .button-secondary.open",func:function(t){window[c].openFavoriteDetails(e.id,{top:t.pageY,left:t.pageX})}}),this.events.mouseover.push({selector:"#f-"+e.id+" .sensitive",func:function(t){jQuery("#f-"+e.id).addClass("mouseover")}}),this.events.mouseout.push({selector:"#f-"+e.id+" .sensitive",func:function(t){jQuery("#f-"+e.id).removeClass("mouseover")}})),h+="</div>",(h=i.collapsible?(h+='<div class="info-secondary">')+p+"</div>":h)+"</div>";jQuery("#f-"+e.id+" .info-primary").html(u),i.collapsible&&!r&&jQuery("#f-"+e.id+" .info-secondary").html(p)},renderFavoritesPrimaryFields:function(t,e,i){var s,o=[],a="",r=(t.is_in_replay&&(a+='<div class="replay-info">R</div>'),0),n=0;for(s in e)!e.hasOwnProperty(s)||(d=e[s]).active&&!d.split&&-1==d.field.search("time_finish_")&&(-1!=d.field.search("place")?o.push(d):i.collapsible&&!d.primary||d.hide||n++);for(s in e)if(e.hasOwnProperty(s)){var l,d=e[s];if(d.active&&!d.split&&-1==d.field.search("time_finish_"))if(-1!=d.field.search("place"))o.push(d);else if((!i.collapsible||d.primary)&&!d.hide){if((i.divide_fields||0!=r)&&r%i.divide_fields!=0||(a+='<table cellspacing="0" cellpadding="0" border="0" class="info-table fields-primary"><tbody>'),null==t[d.field]&&(t[d.field]=""),"position_info"==d.type&&(l=this.getPersonInfoStrings(t),t[d.field]=l.title),"diff_time"==d.type){var h=!1;for(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[d.field]=h.diff_time_string}if("current_group"==d.type){h=!1;for(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[d.field]=h.title}if("diff_km"==d.type){var p,h=!1;for(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[d.field]=h.diff_km_string}a+='<tr class="fav-row '+d.type+" "+d.class+'"><td class="desc">'+d.name+'</td><td class="last">'+t[d.field]+"</td></tr>",++r%i.divide_fields!=0&&r!=n||(a+="</tbody></table>"),1===o.length&&(t[o[0].field]||(t[o[0].field]="-"),a+='<tr><td class="desc">'+o[0].name+'</td><td class="last">'+t[o[0].field]+"</td></tr>")}}return a},renderFavoritesSecondaryFields:function(t,e,i){var s,o,a='<table cellspacing="0" cellpadding="0" border="0" class="info-table fields-primary">';a+="<tbody>";for(s in e)e.hasOwnProperty(s)&&(!(o=e[s]).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]=""),a+='<tr class="fav-row '+o.type+'"><td class="desc">'+o.name+'</td><td class="last">'+t[o.field]+"</td></tr>",0));return a=a+"</tbody>"+"</table>"},renderFavoritesSplits:function(t,e,i){var s,o,a,r,n,l=0,d="";for(n in t.splits)if(t.splits.hasOwnProperty(n)){if(!i.divide_splits&&0==l||l%i.divide_splits==0){for(a in d=(d+='<table cellspacing="0" cellpadding="0" border="0" class="info-table splits">')+"<thead>"+"<tr>",s=0,e)e.hasOwnProperty(a)&&e[a].active&&e[a].split&&s++;for(a in r=0,e)e.hasOwnProperty(a)&&e[a].active&&e[a].split&&(o="",0==r&&(o+=" desc"),r+1==s&&(o+=" last"),e[a].class&&(o+=" "+e[a].class),d+="<td"+(o=o&&' class="'+o+'"')+">"+e[a].name+"</td>",r++);d=(d+="</tr>")+"</thead>"+"<tbody>"}for(a in d+="<tr"+(o=t.splits[n].estimated?' class="estimated"':"")+" onmouseover=\"jQuery(this).addClass('mark');\" onmouseout=\"jQuery(this).removeClass('mark');\">",r=0,e)e.hasOwnProperty(a)&&e[a].active&&e[a].split&&(o="",0==r&&(o+=" desc"),r+1==s&&(o+=" last"),e[a].class&&(o+=" "+e[a].class),d+="<td"+(o=o&&' class="'+o+'"')+">"+t.splits[n][e[a].field]+"</td>",r++);d+="</tr>",++l%i.divide_splits!=0&&l!=t.splits.length||(d+="</tbody></table>")}return d},renderFavoritesPlaces:function(t,e,i){var s,o="",a='<table cellspacing="0" cellpadding="0" border="0" class="info-table places">',a=(a+="<thead>")+"<tr>"+('<td class="desc">'+this.strings.places+"</td>");for(s in e)e.hasOwnProperty(s)&&(a+='<td class="last">'+e[s].name+"</td>");for(s in a=(a=(a+="</tr>")+"</thead>"+"<tbody>")+"<tr>"+'<td class="desc"></td>',e)e.hasOwnProperty(s)&&(o="",o=null==t[e[s].field]?"-":t[e[s].field],a+='<td class="'+(s==e.length-1?"last":"")+'">'+o+"</td>");return a=(a+="</tr>")+"</tbody>"+"</table>"},renderFavoritesHead:function(t,e,i,s){var o,a="",a=this.data.global.options.favorite_titles[i]||"",r="",n="";for(o in e)e.hasOwnProperty(o)&&e[o].active&&e[o].head&&(e[o].name&&(n=e[o].name+": "),r+='  <span class="field-'+e[o].field+'">'+n+t[e[o].field]+"</span>");var l='<div class="info-head">';return l+('  <div class="color last fav-color i-'+i+'">'+a+"</div>")+r+('  <div class="fav-options "><span class="icon s favorite-toggle"><img onclick="'+this.options.globalObjectName+".trigger('removeFavorite', {id:'"+t.id+'\'});" src="'+this.options.path_icons+'/icons/delete.svg" alt="'+this.strings.remove+'" title="'+this.strings.remove+'" /></span></div>')+"</div>"},openFavoriteDetails:function(t,e){var i=jQuery("#f-"+t+" .info-secondary"),s=(i.css({display:"block"}),i.position()),o=i.offset(),a=s.top+(e.top-o.top),s=s.left+(e.left-o.left);i.css({display:"block",left:s+"px",top:a+"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,i,s="";return s+='<div class="status buttons map hideable">',this.data.global.options.show_search&&(s+=' <div class="leaderboard-search"><span class="caption">'+this.strings.add_favorite+'</span> <input type="text" id="autocomplete" name="autocomplete_parameter" onfocus="this.value=\'\';this.style.color=\'#333333\';" onblur="this.style.color=\'#AAAAAA\'; this.value=\''+this.strings.search_help+'\'" value="'+this.strings.search_help+'" /> <div class="message not_found tooltip">'+this.strings.not_found+"</div></div>"),s=(s+=' <a title="'+this.strings.help_center+'" class="tt-help button-map-center" href="#" onclick="'+this.options.globalObjectName+".trigger('centerMap', {container:'"+t+"'}); return false;\">"+this.strings.map_center+"</a>")+(' <a title="'+this.strings.help_autozoom+'" class="tt-help button-map-autozoom has-status" href="#" onclick="'+this.options.globalObjectName+".trigger('switchAutoZoom', {container:'"+t+"'}); return false;\">"+this.strings.autozoom+"</a>"),this.getContainerByType("overlays")&&(this.data.global.options.tooltip_intros.map_overlays?s+=' <a title="'+this.strings.help_map_overlays+'" class="tt-help tt-oninit tt-pos-bottom button-map-overlays" href="#" >'+this.strings.map_overlays+"</a>":s+=' <a title="'+this.strings.help_map_overlays+'" class="tt-help tt-pos-bottom button-map-overlays" href="#" >'+this.strings.map_overlays+"</a>",e=this.options.globalObjectName,this.eventsDelete.click.push({selector:".button-map-overlays"}),this.events.click.push({selector:".button-map-overlays",func:function(t){return window[e].trigger("switchOverlayMenu",{top:t.pageY,left:t.pageX}),!1}})),s=s+"</div>"+('<div id="map-container-'+t+'" class="map-container" style="height:'+this.data.global.options.map_height+'px"></div>'),this.data.global.options.replay_mode&&(s=(s=(s=(s=(s=(s+='<div class="replay-controls">')+'<div class="replay-buttons">  <span class="button" onclick="'+this.options.globalObjectName+".trigger('replayPlay');\"><img src=\""+this.options.path_images+'/icon_play.png" alt="" title=""/>'+this.strings.replay_play+"</span>")+'  <span class="button" onclick="'+this.options.globalObjectName+".trigger('replayStop');\"><img  src=\""+this.options.path_images+'/icon_stop.png" alt="" title=""/>'+this.strings.replay_stop+"</span>")+'  <span class="button" onclick="'+this.options.globalObjectName+".trigger('replayRewind');\"><img  src=\""+this.options.path_images+'/icon_rewind.png" alt="" title=""/>'+this.strings.replay_rewind+"</span></div>")+'<div class="slider-time">  <span class="label start">'+this.strings.slider_start+"</span>")+'  <span class="label finish">'+this.strings.slider_finish+"</span>",this.data.global.options.tooltip_intros.map_slider&&(i="tt-oninit"),this.data.global.options.replay_daytime?s+='  <span title="'+this.strings.help_map_slider+'" class="tt-help '+i+' tt-pos-top label time">'+this.strings.replay_daytime+' <span id="replay-racetime">00:00:00</span></span>':s+='  <span title="'+this.strings.help_map_slider+'" class="tt-help '+i+' tt-pos-top label time">'+this.strings.replay_racetime+' <span id="replay-racetime">00:00:00</span></span>',s=(s+='  <span class="slider"></span></div>')+'<div class="slider-speed">  <span class="label">'+this.strings.replay_speed+' <span class="replay-speed"></span></span>  <span class="slider"></span></div><div style="clear:both;"></div></div>'),s=s+this.renderOverlayMenu()+'<div style="display:none" class="mapInfoWindow"></div>'},renderOverlayMenu:function(){var t,e=this.getContainerByType("overlays"),i="",s="",o=this.options.globalObjectName;if(e){for(var a in i=i+'<div style="display:none" class="overlayMenu">'+'<div class="menu-divider">Selected Overlays</div>',e.data.rows)e.data.rows.hasOwnProperty(a)&&(a=e.data.rows[a],s=(t=this.mapFetchIcons(a.icons,"resultsboard")).icon_settings?'<img src="'+t.icon_settings.url+'" alt=""/>':"",-1!=this.mapOverlays.indexOf(a.id)?i+='<a class="active" id="overlayButton-'+a.id+'" href="#">'+s+a.title+"</a>":i+='<a id="overlayButton-'+a.id+'" href="#">'+s+a.title+"</a>",this.eventsDelete.click.push({selector:"#overlayButton-"+a.id}),this.events.click.push({selector:"#overlayButton-"+a.id,data:{overlayId:a.id},func:function(t){return window[o].trigger("switchOverlay",{overlayId:t.data.overlayId,top:t.pageY,left:t.pageX}),!1}}));i+="</div>"}return i},switchFullscreen:function(){if("fixed"!=jQuery(".cbox.left .list").css("position")){for(var t in this.fullscreen_old_style={height:jQuery(".cbox.left .list").css("height"),position:"relative",width:jQuery(".cbox.left .list").css("width"),overflow:"inherit"},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}for(t in 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(),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 for(t in jQuery(".cbox.left .list").css(this.fullscreen_old_style),jQuery(".cbox.left .list").removeClass("is-fullscreen"),this.render(),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<this.data.containers.length;i++)if(this.data.containers[i].type==t)return this.data.containers[i];return!1},getPersonInfoStrings:function(t,e,i,s){var o="",a="",r="",n="marker-person",l=t.split_groups[t.global_info.active_group_key];return 99999!=t.start_no&&"F99999"!=t.start_no&&99998!=t.start_no&&"F99998"!=t.start_no||(t.start_no="",t.start_no_text=""),isNaN(l.estimated_pos)?"finished"==l.estimated_pos?(o=this.strings.finished,a+="<b>"+t.start_no_text+"</b> "+t.__fullname+"<br/>("+this.strings.finished+")"):"started"==l.estimated_pos||"started"==l.state?(o=this.strings.started,a+="<b>"+t.start_no_text+"</b> "+t.__fullname+"<br/>("+this.strings.started+")"):(o=this.strings.not_started,a+="<b>"+t.start_no_text+"</b> "+t.__fullname):(l.estimated_pos_string||(l.estimated_pos_string=l.estimated_pos),a=(a+="<b>"+t.start_no_text+"</b> "+t.__fullname)+"<br/>"+l.estimated_pos_string+" km",o+=l.estimated_pos_string+" km",this.data.global.options.show_map_miles&&(a+="/"+t.__estimated_pos_factor+" Miles",o+="/"+t.__estimated_pos_factor+" Miles"),t.__estimated_finish&&(a+="<br/>"+this.strings.estimated_finish+": "+t.__estimated_finish),t.__estimated_finish_daytime&&(a+="<br/>"+this.strings.estimated_finish_daytime+": "+t.__estimated_finish_daytime)),r+=a,a='<img class="star" src="'+this.options.path_images+'/icon_star.png" alt="" />'+a,e?o+=" "+this.strings.click_to_follow:r=(n=i?(a='<img class="star" src="'+this.options.path_images+'/icon_star.png" alt="" />',a=(a+='<span class="favorite_title">'+this.data.global.options.favorite_titles[s]+"</span>")+'<span class="label"><b>'+t.start_no_text+"</b> "+t.__fullname,t.subtitle&&(a+="<br/>"+t.subtitle),a+="</span>","marker-person small details-short"):(a='<img class="star" src="'+this.options.path_images+'/icon_star.png" alt="" />',a+='<span class="favorite_title">'+this.data.global.options.favorite_titles[s]+"</span>","marker-person small"),this.data.global.options.favorite_titles[s]),{title:o,label:a,summary:r,css_class:n+=" fav-color i-"+s}},mapInit:function(t){if("object"==typeof google.maps||"function"==typeof google.maps){var e;switch(this.maps[t]=new google.maps.Map(document.getElementById("map-container-"+t)),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,s,o=0;for(i in this.data.containers[t].data.tracks)this.data.containers[t].data.tracks.hasOwnProperty(i)&&(s=!1,o==this.data.containers[t].data.tracks.length-1&&(s=!0),this.mapPolylines[t][i]=this.mapInitTrack(t,this.data.containers[t].data.tracks[i],this.data.containers[t].data.fields.data,s),o++,this.maps[t].fitBounds(this.mapBounds[t]))}}this.mapUpdate(t),this.mapUpdateOverlays(t)},mapInitTrack:function(t,e,i,s){var o="#0000ff",o=(e.color&&(o=e.color),new google.maps.Polyline({strokeColor:o,strokeWeight:4,strokeOpacity:.8})),a=google.maps.geometry.encoding.decodePath(e.points_encoded);o.setPath(a),o.setMap(this.maps[t]);for(var r=0;r<a.length;r++)this.mapBounds[t].extend(a[r]);return this.mapInitTrackMarkers(t,e,o,i,s),o},mapInitTrackMarkers:function(t,e,i,s,o){var a={},r="";if(e.split_marker&&s.length)for(var n in s)s.hasOwnProperty(n)&&-1==(n=s[n]).field.search("time_finish_")&&void 0!==n.km&&(l=moveAlongPath(i,1e3*n.km))&&new MarkerWithLabel({icon:a=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:l,draggable:!1,map:this.maps[t],labelContent:n.name,labelAnchor:new google.maps.Point(10,31),labelClass:"marker-km",labelStyle:{opacity:1}});if(e.km_marker)for(var l,d=1e3*e.km_marker,h=888;;){if(!(l=moveAlongPath(i,d)))break;new MarkerWithLabel({icon:a=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:l,draggable:!1,map:this.maps[t],labelContent:d/1e3+"<br/>km",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)e.custom_marker.hasOwnProperty(p)&&(l=moveAlongPath(i,1e3*(p=e.custom_marker[p]).km))&&new MarkerWithLabel({icon:a=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:l,draggable:!1,map:this.maps[t],labelContent:p.title,labelAnchor:new google.maps.Point(10,31),labelClass:"marker-km custom",labelStyle:{opacity:1}});var c=i.getPath().getAt(i.getPath().getLength()-1),o=(c&&(r=o?this.options.path_images+"/map_flag_finish.png":this.options.path_images+"/map_flag_blue.png",a=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:c,map:this.maps[t],icon:a})),i.getPath().getAt(0));o&&(a=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:o,map:this.maps[t],icon:a}))},mapUpdate:function(t){var e,i=this.getContainerByType("favorites");if(!i)return!1;for(e in i.data.rows)if(i.data.rows.hasOwnProperty(e)){var s=i.data.rows[e];if(!s.id)return!0;var o,a=s.split_groups[s.global_info.active_group_key];void 0===this.mapMarkerCluster[t]&&(this.mapMarkerCluster[t]={}),(a.estimated_pos||0===a.estimated_pos)&&(o="",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 o=e.track,!1}),o)&&void 0!==(a=this.mapPolylines[t][o])&&this.mapUpdatePersonMarker(t,o,a,s,e)}if(this.data.containers[t].data.options.clustering)for(o in this.data.containers[t].data.tracks)if(this.data.containers[t].data.tracks.hasOwnProperty(o))if(this.mapMarkerCluster[t]||(this.mapMarkerCluster[t]={}),this.mapMarkerCluster[t]&&void 0===this.mapMarkerCluster[t][o]&&(this.mapMarkerCluster[t][o]={}),this.mapMarkerCluster[t]&&"function"==typeof this.mapMarkerCluster[t][o].repaint)this.mapMarkerCluster[t][o].repaint();else{for(var r in this.mapMarkerClusterIcons[t]=[],this.data.containers[t].data.mappings.markers){var n,l=this.data.containers[t].data.mappings.markers[r];l.cluster_sizes&&((n=this.data.containers[t].data.markers[l.marker]).icon.anchor||(n.icon.anchor=[32,32]),n.icon.height||(n.icon.height=32),n.icon.width||(n.icon.width=32),n.icon.url)&&this.mapMarkerClusterIcons[t].push({url:n.icon.url,height:n.icon.height,width:n.icon.width,anchor:[20,20],anchorIcon:[n.icon.anchor[0],n.icon.anchor[1]],mapping:l})}var p=this.mapMarkerClusterIcons[t];this.mapMarkerCluster[t][o]=new MarkerClusterer(this.maps[t],this.mapMarkersPersons[t],{gridSize:20,calculator:function(t,e){var i,s=0,o="",a=0,r=0,n=0;for(i in t)t.hasOwnProperty(i)&&("e"==t[i].clusterSummaryDirection&&a++,"w"==t[i].clusterSummaryDirection&&r++,"not_started"!=t[i].clusterSummaryPosition&&"finished"!=t[i].clusterSummaryPosition||n++,t[i].clusterSummary)&&(o+="<span"+(t[i].clusterSummaryClass?' class="'+t[i].clusterSummaryClass+'"':"")+">"+t[i].clusterSummary+"</span>");var l,d={count:t.length};for(l in 4<d.count&&(d.count=4),n==t.length?d.state="not_started":(d.state="started",d.direction=r<a?"e":"w"),p){var h=p[l].mapping;if((!h.cluster_sizes||-1!=h.cluster_sizes.indexOf(d.count))&&!(h.directions&&-1==h.directions.indexOf(d.direction)||h.states&&-1==h.states.indexOf(d.state))){s=parseInt(l)+1;break}}return{text:d.count,index:s,title:"",html:'<div class="cluster-summary">'+o+"</div>"}},styles:this.mapMarkerClusterIcons[t]})}if(this.favoritesSelected){var d=new google.maps.LatLngBounds,h=0;for(r in this.mapMarkersPersons[t])this.mapMarkersPersons[t].hasOwnProperty(r)&&-1!=this.favoritesSelected.indexOf(this.mapMarkersPersons[t][r].favoriteId)&&(h++,d.extend(this.mapMarkersPersons[t][r].getPosition()));this.mapAutoZoom&&1<h?(this.maps[t].fitBounds(d),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==h?(this.maps[t].setCenter(d.getCenter()),this.maps[t].setZoom(15)):h&&this.maps[t].setCenter(d.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={},o="",a="",r="",n="";for(i in t)t.hasOwnProperty(i)&&i.substr(0,e.length)==e&&((s=this.mapFetchIcon(e,i,"marker")).icon&&(o=t[i],a=s.ratio),(s=this.mapFetchIcon(e,i,"settings")).icon)&&(r=t[i],n=s.ratio);for(i in t)t.hasOwnProperty(i)&&(o||(s=this.mapFetchIcon("",i,"marker")).icon&&(o=t[i],a=s.ratio),r||(s=this.mapFetchIcon("",i,"settings")).icon&&(r=t[i],n=s.ratio));return{icon_settings:r,icon_settings_ratio:n,icon_marker:o,icon_marker_ratio:a}},mapFetchIcon:function(t,e,i){var s="",o=null;return t&&(shift_substr=t.length+1),e.substr(0,i.length+3)==i+"@3x"&&3==this.pixelRatio?(s=e,o=3):"@2x"==e.substr(0,i.length+3)&&2==this.pixelRatio?(s=e,o=2):e.substr(0,i.length)==i&&(s=e,o=1),{icon:s,ratio:o}},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,o,a,r=e.data.rows[i];if(-1==this.mapOverlays.indexOf(r.id)){for(o in this.mapMarkers[t][r.id])this.mapMarkers[t][r.id].hasOwnProperty(o)&&this.mapMarkers[t][r.id][o].setMap(null);this.mapMarkers[t][r.id]=[]}else for(o in r.icons&&(s=this.mapFetchIcons(r.icons,"resultsboard")),r.points)r.points.hasOwnProperty(o)&&(a={},a=this.mapFetchIcons(r.points[o].icons,"resultsboard").icon_marker||s.icon_marker,this.mapUpdateMarker(t,{icon:a,position_latlng:r.points[o].position_latlng,title:r.points[o].title,description:r.points[o].description,show_label:r.show_label,detail_window:r.show_label},r.id,o))}},mapUpdateMarker:function(t,i,s,o){var e,a,r={},n=["icon","shadow"];for(e in n)n.hasOwnProperty(e)&&i[a=n[e]]&&(r[a]=new google.maps.MarkerImage,i[a].url&&(r[a].url=i[a].url),i[a].width&&i[a].height&&(r[a].size=new google.maps.Size(i[a].width,i[a].height)),i[a].anchor&&(r[a].anchor=new google.maps.Point(i[a].anchor[0],i[a].anchor[1])),i[a].origin)&&(r[a].origin=new google.maps.Point(i[a].origin[0],i[a].origin[1]));r.icon||(r.icon=new google.maps.MarkerImage,r.icon.url="http://maps.gstatic.com/intl/de_ALL/mapfiles/ms/micons/man.png",r.icon.anchor=new google.maps.Point(16,32)),r.shadow||(r.shadow=new google.maps.MarkerImage,r.shadow.url="http://maps.gstatic.com/intl/de_ALL/mapfiles/ms/micons/man.shadow.png",r.shadow.anchor=new google.maps.Point(16,32)),void 0===this.mapMarkers[t][s]&&(this.mapMarkers[t][s]={});var l,d,h=new google.maps.LatLng(i.position_latlng[0],i.position_latlng[1]);return this.mapMarkers[t][s][o]?(this.mapMarkers[t][s][o].setPosition(h),this.mapMarkers[t][s][o].setOptions({labelContent:i.title,optimized:!1}),this.mapMarkers[t][s][o].setIcon(r.icon),this.mapMarkers[t][s][o].setShadow(r.shadow)):(i.show_label?(this.mapMarkers[t][s][o]={},this.mapMarkers[t][s][o]=new MarkerWithLabel({icon:r.icon,shadow:r.shadow,optimized:!1,position:h,draggable:!1,labelContent:i.title,labelAnchor:new google.maps.Point(-10,20),labelClass:"marker-person marker-group marker-group-"+s})):(this.mapMarkers[t][s][o]={},this.mapMarkers[t][s][o]=new google.maps.Marker({icon:r.icon,shadow:r.shadow,optimized:!1,position:h,draggable:!1})),this.mapMarkers[t][s][o].setMap(this.maps[t]),l=this.options.globalObjectName,(d=new google.maps.OverlayView).draw=function(){},d.setMap(this.maps[t]),google.maps.event.addListener(this.mapMarkers[t][s][o],"mouseover",function(t){var e="<h3>"+i.title+"</h3>";e+='<div class="description">'+i.description+"</div>";t=d.getProjection().fromLatLngToContainerPixel(t.latLng);window[l].trigger("openInfoWindow",{index:o,groupKey:s,top:t.y,left:t.x,html:e})}),google.maps.event.addListener(this.mapMarkers[t][s][o],"mouseout",function(t){window[l].trigger("closeInfoWindow",{})})),!0},mapUpdatePersonMarker:function(t,e,i,s,o){var a,r,n="",l=!1,d=s.split_groups[s.global_info.active_group_key];if(i&&(a=0,isNaN(d.estimated_pos)?"finished"==d.estimated_pos?l=i.getPath().getAt(i.getPath().getLength()-1):"started"==d.estimated_pos?l=moveAlongPath(i,0):"not_started"==d.estimated_pos&&(l=i.getPath().getAt(0)):(l=moveAlongPath(i,1e3*d.estimated_pos),a=d.estimated_pos)),!l)return!1;for(r in this.data.containers[t].data.mappings.markers)if(this.data.containers[t].data.mappings.markers.hasOwnProperty(r)){var h=this.data.containers[t].data.mappings.markers[r];if(!(h.event_ids&&-1==h.event_ids.indexOf(s.event)||h.directions&&-1==h.directions.indexOf(l.direction)||h.sex&&-1==h.sex.indexOf(s.sex)||h.states&&-1==h.states.indexOf(d.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(0<a&&h.force_marker_id&&this.data.containers[t].data.tracks[e].force_tracking_marker){var p,c=this.data.containers[t].data.tracks[e].force_tracking_marker,u=!1;for(p in c)c.hasOwnProperty(p)&&c[p].from_km<a&&(u=c[p].marker_id);if(-1==h.force_marker_id.indexOf(u))continue}n=h.marker;break}}var g={};if(n&&this.data.containers[t].data.markers[n]){var m,f,_=this.data.containers[t].data.markers[n],v=["icon","shadow"];for(m in v)v.hasOwnProperty(m)&&_[f=v[m]]&&(g[f]=new google.maps.MarkerImage,_[f].url&&(g[f].url=_[f].url),_[f].width&&_[f].height&&(g[f].size=new google.maps.Size(_[f].width,_[f].height)),_[f].anchor&&(g[f].anchor=new google.maps.Point(_[f].anchor[0],_[f].anchor[1])),_[f].origin)&&(g[f].origin=new google.maps.Point(_[f].origin[0],_[f].origin[1]))}g.icon||(g.icon=new google.maps.MarkerImage,g.icon.url="http://maps.gstatic.com/intl/de_ALL/mapfiles/ms/micons/man.png",g.icon.anchor=new google.maps.Point(16,32)),g.shadow||(g.shadow=new google.maps.MarkerImage,g.shadow.url="http://maps.gstatic.com/intl/de_ALL/mapfiles/ms/micons/man.shadow.png",g.shadow.anchor=new google.maps.Point(16,32));var y,b=this.getPersonInfoStrings(s,this.data.containers[t].data.options.show_person_details,this.data.containers[t].data.options.show_person_details_short,o);return this.mapMarkersPersons[t][s.id]?(this.mapMarkersPersons[t][s.id].setPosition(l),this.mapMarkersPersons[t][s.id].setOptions({clusterSummary:b.summary,clusterSummaryClass:b.css_class+" summary",clusterSummaryDirection:l.direction,clusterSummaryPosition:d.estimated_pos,labelContent:b.label,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:l,draggable:!1,clusterSummary:b.summary,clusterSummaryClass:b.css_class+" summary",clusterSummaryDirection:l.direction,clusterSummaryPosition:d.estimated_pos,labelContent:b.label,labelAnchor:new google.maps.Point(-20,30),zIndex:999,labelZIndex:1e3,labelClass:b.css_class}),this.data.containers[t].data.options.clustering?this.mapMarkerCluster[t][e]&&"function"==typeof this.mapMarkerCluster[t][e].repaint&&(this.mapMarkerCluster[t][e]={}):this.mapMarkersPersons[t][s.id].setMap(this.maps[t]),y=this.options.globalObjectName,google.maps.event.addListener(this.mapMarkersPersons[t][s.id],"click",function(){window[y].trigger("selectFavoriteToggle",{id:this.favoriteId}),-1!=window[y].favoritesSelected.indexOf(this.favoriteId)?(this.setOptions({labelClass:b.css_class+" selected"}),this.setZIndex(9999)):(this.setOptions({labelClass:b.css_class}),this.setZIndex(void 0))})),s.tracker_data&&s.tracker_data.position_lonlat.length&&(i=new google.maps.LatLng(s.tracker_data.position_lonlat[1],s.tracker_data.position_lonlat[0]),o="<b>"+s.tracker_data.node_id+"</b>",o+="<br/>"+s.tracker_data.position[0]+","+s.tracker_data.position[1],this.mapMarkersPersons[t][s.id]?(this.mapMarkersPersons[t][s.id].setPosition(i),this.mapMarkersPersons[t][s.id].setOptions({clusterSummary:b.summary,clusterSummaryClass:b.css_class+" summary",clusterSummaryDirection:l.direction,clusterSummaryPosition:d.estimated_pos,labelContent:o,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:l,draggable:!1,clusterSummary:b.summary,clusterSummaryClass:b.css_class+" summary",clusterSummaryDirection:l.direction,clusterSummaryPosition:d.estimated_pos,labelContent:o,labelAnchor:new google.maps.Point(-20,30),labelClass:b.css_class,zIndex:999,labelZIndex:1e3}))),!0},mapCenter:function(t){var e,i=new google.maps.LatLngBounds;for(e in this.mapPolylines[t])if(this.mapPolylines[t].hasOwnProperty(e))for(var s=this.mapPolylines[t][e].getPath(),o=0;o<s.getLength();o++)i.extend(s.getAt(o));this.maps[t].fitBounds(i)},mapInitSliders:function(){this.replay_time||(this.replay_time=this.replay_time_max+60,jQuery(".replay-racetime").html(window[this.options.globalObjectName].ms2time(this.replay_time)));var t,i=this.options.globalObjectName,e=(this.slider_time=jQuery(".slider-time .slider").slider({value:this.replay_time,min:0,max:this.replay_time_max+6e4,step:this.data.global.options.replay_slider_step,animate:!0,slide:function(t,e){window[i].replay_time=e.value,window[i].refresh()}}),2);for(t in this.replay_speed||(this.replay_speed=2,jQuery(".replay-speed").html(this.replay_speed+"x")),this.data.global.options.replay_speeds)if(this.data.global.options.replay_speeds.hasOwnProperty(t)&&this.data.global.options.replay_speeds[t]==this.replay_speed){e=t;break}this.slider_speed=jQuery(".slider-speed .slider").slider({value:e,min:0,max:6,step:1,animate:!0,slide:function(t,e){window[i].replay_speed=window[i].getReplaySpeedFromIndex(e.value),jQuery(".replay-speed").html(window[i].getReplaySpeedFromIndex(e.value)+"x")}})}},"function"==typeof jQuery&&jQuery.noConflict();{function moveAlongPath(t,e,i){var s,o,a,r;return(i=i||0)<t.getPath().getLength()-1?(r=t.getPath().getAt(i),s=t.getPath().getAt(i+1),e<=(o=google.maps.geometry.spherical.computeDistanceBetween(r,s))?(a=!1,r.lng()<s.lng()?a="e":r.lng()>s.lng()&&(a="w"),(r=google.maps.geometry.spherical.computeOffset(r,e,google.maps.geometry.spherical.computeHeading(r,s))).direction=a,r):moveAlongPath(t,e-o,i+1)):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)}"object"==typeof google&&(ClusterIcon.prototype.onAdd=function(){var o,a,r=this;this.div_=document.createElement("div"),this.div_.className=this.className_,this.visible_&&this.show(),this.getPanes().overlayMouseTarget.appendChild(this.div_),this.boundsChangedListener_=google.maps.event.addListener(this.getMap(),"bounds_changed",function(){a=o}),google.maps.event.addDomListener(this.div_,"mousedown",function(){a=!(o=!0)}),google.maps.event.addDomListener(this.div_,"click",function(t){var e,i,s;o=!1,a||(s=r.cluster_.getMarkerClusterer(),google.maps.event.trigger(s,"click",r.cluster_),google.maps.event.trigger(s,"clusterclick",r.cluster_),s.getZoomOnClick()&&(i=s.getMaxZoom(),e=r.cluster_.getBounds(),s.getMap().fitBounds(e),setTimeout(function(){s.getMap().fitBounds(e),null!==i&&s.getMap().getZoom()>i&&s.getMap().setZoom(i+1)},100)),t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation())}),google.maps.event.addDomListener(this.div_,"mouseover",function(){var t=r.cluster_.getMarkerClusterer();google.maps.event.trigger(t,"mouseover",r.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",function(){var t=r.cluster_.getMarkerClusterer();google.maps.event.trigger(t,"mouseout",r.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(){var t;this.visible_&&(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(){var t,e,i,s;this.div_&&(t="",i=this.backgroundPosition_.split(" "),e=parseInt(i[0].trim(),10),i=parseInt(i[1].trim(),10),s=this.getPosFromLatLng_(this.center_),this.div_.style.cssText=this.createCss(s),t="<img src='"+this.url_+"' style='position: absolute; top: "+i+"px; left: "+e+"px; ",this.cluster_.getMarkerClusterer().enableRetinaIcons_||(t+="clip: rect("+-1*i+"px, "+(-1*e+this.width_)+"px, "+(-1*i+this.height_)+"px, "+-1*e+"px);"),t+="'>",this.sums_.html?this.div_.innerHTML=t+this.sums_.html:this.div_.innerHTML=t+"<div style='position: absolute;top: "+this.anchorText_[0]+"px;left: "+this.anchorText_[1]+"px;color: "+this.textColor_+";font-size: "+this.textSize_+"px;font-family: "+this.fontFamily_+";font-weight: "+this.fontWeight_+";font-style: "+this.fontStyle_+";text-decoration: "+this.textDecoration_+";text-align: center;width: "+this.width_+"px;line-height:"+this.height_+"px;'>"+this.sums_.text+"</div>",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;t=Math.max(0,t.index-1),t=Math.min(this.styles_.length-1,t),t=this.styles_[t];this.url_=t.url,this.height_=t.height,this.width_=t.width,this.anchorText_=t.anchorText||[0,0],this.anchorIcon_=t.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)],this.textColor_=t.textColor||"black",this.textSize_=t.textSize||11,this.textDecoration_=t.textDecoration||"none",this.fontWeight_=t.fontWeight||"bold",this.fontStyle_=t.fontStyle||"normal",this.fontFamily_=t.fontFamily||"Arial,sans-serif",this.backgroundPosition_=t.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){t=this.getProjection().fromLatLngToDivPixel(t);return t.x-=this.anchorIcon_[1],t.y-=this.anchorIcon_[0],t.x=parseInt(t.x,10),t.y=parseInt(t.y,10),t},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(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),i=0;i<e.length;i++)t.extend(e[i].getPosition());return t},Cluster.prototype.remove=function(){this.clusterIcon_.setMap(null),this.markers_=[],delete this.markers_},Cluster.prototype.addMarker=function(t){var e,i,s,o;if(this.isMarkerAlreadyAdded_(t))return!1;if(this.center_?this.averageCenter_&&(o=this.markers_.length+1,s=(this.center_.lat()*(o-1)+t.getPosition().lat())/o,o=(this.center_.lng()*(o-1)+t.getPosition().lng())/o,this.center_=new google.maps.LatLng(s,o),this.calculateBounds_()):(this.center_=t.getPosition(),this.calculateBounds_()),t.isAdded=!0,this.markers_.push(t),i=this.markers_.length,null!==(s=this.markerClusterer_.getMaxZoom())&&this.map_.getZoom()>s)t.getMap()!==this.map_&&t.setMap(this.map_);else if(i<this.minClusterSize_)t.getMap()!==this.map_&&t.setMap(this.map_);else if(i===this.minClusterSize_)for(e=0;e<i;e++)this.markers_[e].setMap(null);else t.setMap(null);return this.updateIcon_(),!0},Cluster.prototype.isMarkerInClusterBounds=function(t){return this.bounds_.contains(t.getPosition())},Cluster.prototype.calculateBounds_=function(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)},Cluster.prototype.updateIcon_=function(){var t=this.markers_.length,e=this.markerClusterer_.getMaxZoom();null!==e&&this.map_.getZoom()>e||t<this.minClusterSize_?this.clusterIcon_.hide():(e=this.markerClusterer_.getStyles().length,t=this.markerClusterer_.getCalculator()(this.markers_,e),this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.useStyle(t),this.clusterIcon_.show())},Cluster.prototype.isMarkerAlreadyAdded_=function(t){var e;if(this.markers_.indexOf)return-1!==this.markers_.indexOf(t);for(e=0;e<this.markers_.length;e++)if(t===this.markers_[e])return!0;return!1},MarkerClusterer.prototype.onAdd=function(){var t=this;this.activeMap_=this.getMap(),this.ready_=!0,this.repaint(),this.listeners_=[google.maps.event.addListener(this.getMap(),"zoom_changed",function(){t.resetViewport_(!1),this.getZoom()!==(this.get("minZoom")||0)&&this.getZoom()!==this.get("maxZoom")||google.maps.event.trigger(this,"idle")}),google.maps.event.addListener(this.getMap(),"idle",function(){t.redraw_()})]},MarkerClusterer.prototype.onRemove=function(){for(var t=0;t<this.markers_.length;t++)this.markers_[t].getMap()!==this.activeMap_&&this.markers_[t].setMap(this.activeMap_);for(t=0;t<this.clusters_.length;t++)this.clusters_[t].remove();for(this.clusters_=[],t=0;t<this.listeners_.length;t++)google.maps.event.removeListener(this.listeners_[t]);this.listeners_=[],this.activeMap_=null,this.ready_=!1},MarkerClusterer.prototype.draw=function(){},MarkerClusterer.prototype.setupStyles_=function(){var t,e;if(!(0<this.styles_.length))for(t=0;t<this.imageSizes_.length;t++)e=this.imageSizes_[t],this.styles_.push({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:e,width:e})},MarkerClusterer.prototype.fitMapToMarkers=function(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,i=0;i<t.length;i++)e.extend(t[i].getPosition());this.getMap().fitBounds(e)},MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_},MarkerClusterer.prototype.setGridSize=function(t){this.gridSize_=t},MarkerClusterer.prototype.getMinimumClusterSize=function(){return this.minClusterSize_},MarkerClusterer.prototype.setMinimumClusterSize=function(t){this.minClusterSize_=t},MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_},MarkerClusterer.prototype.setMaxZoom=function(t){this.maxZoom_=t},MarkerClusterer.prototype.getStyles=function(){return this.styles_},MarkerClusterer.prototype.setStyles=function(t){this.styles_=t},MarkerClusterer.prototype.getTitle=function(){return this.title_},MarkerClusterer.prototype.setTitle=function(t){this.title_=t},MarkerClusterer.prototype.getZoomOnClick=function(){return this.zoomOnClick_},MarkerClusterer.prototype.setZoomOnClick=function(t){this.zoomOnClick_=t},MarkerClusterer.prototype.getAverageCenter=function(){return this.averageCenter_},MarkerClusterer.prototype.setAverageCenter=function(t){this.averageCenter_=t},MarkerClusterer.prototype.getIgnoreHidden=function(){return this.ignoreHidden_},MarkerClusterer.prototype.setIgnoreHidden=function(t){this.ignoreHidden_=t},MarkerClusterer.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons_},MarkerClusterer.prototype.setEnableRetinaIcons=function(t){this.enableRetinaIcons_=t},MarkerClusterer.prototype.getImageExtension=function(){return this.imageExtension_},MarkerClusterer.prototype.setImageExtension=function(t){this.imageExtension_=t},MarkerClusterer.prototype.getImagePath=function(){return this.imagePath_},MarkerClusterer.prototype.setImagePath=function(t){this.imagePath_=t},MarkerClusterer.prototype.getImageSizes=function(){return this.imageSizes_},MarkerClusterer.prototype.setImageSizes=function(t){this.imageSizes_=t},MarkerClusterer.prototype.getCalculator=function(){return this.calculator_},MarkerClusterer.prototype.setCalculator=function(t){this.calculator_=t},MarkerClusterer.prototype.getBatchSizeIE=function(){return this.batchSizeIE_},MarkerClusterer.prototype.setBatchSizeIE=function(t){this.batchSizeIE_=t},MarkerClusterer.prototype.getClusterClass=function(){return this.clusterClass_},MarkerClusterer.prototype.setClusterClass=function(t){this.clusterClass_=t},MarkerClusterer.prototype.getMarkers=function(){return this.markers_},MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length},MarkerClusterer.prototype.getClusters=function(){return this.clusters_},MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length},MarkerClusterer.prototype.addMarker=function(t,e){this.pushMarkerTo_(t),e||this.redraw_()},MarkerClusterer.prototype.addMarkers=function(t,e){for(var i in t)t.hasOwnProperty(i)&&this.pushMarkerTo_(t[i]);e||this.redraw_()},MarkerClusterer.prototype.pushMarkerTo_=function(t){var e;t.getDraggable()&&(e=this,google.maps.event.addListener(t,"dragend",function(){e.ready_&&(this.isAdded=!1,e.repaint())})),t.isAdded=!1,this.markers_.push(t)},MarkerClusterer.prototype.removeMarker=function(t,e){t=this.removeMarker_(t);return!e&&t&&this.repaint(),t},MarkerClusterer.prototype.removeMarkers=function(t,e){for(var i,s=!1,o=0;o<t.length;o++)i=this.removeMarker_(t[o]),s=s||i;return!e&&s&&this.repaint(),s},MarkerClusterer.prototype.removeMarker_=function(t){var e,i=-1;if(this.markers_.indexOf)i=this.markers_.indexOf(t);else for(e=0;e<this.markers_.length;e++)if(t===this.markers_[e]){i=e;break}return-1!==i&&(t.setMap(null),this.markers_.splice(i,1),!0)},MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport_(!0),this.markers_=[]},MarkerClusterer.prototype.repaint=function(){var e=this.clusters_.slice();this.clusters_=[],this.resetViewport_(!1),this.redraw_(),setTimeout(function(){for(var t=0;t<e.length;t++)e[t].remove()},0)},MarkerClusterer.prototype.getExtendedBounds=function(t){var e=this.getProjection(),i=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),s=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),i=e.fromLatLngToDivPixel(i),s=(i.x+=this.gridSize_,i.y-=this.gridSize_,e.fromLatLngToDivPixel(s)),i=(s.x-=this.gridSize_,s.y+=this.gridSize_,e.fromDivPixelToLatLng(i)),e=e.fromDivPixelToLatLng(s);return t.extend(i),t.extend(e),t},MarkerClusterer.prototype.redraw_=function(){this.createClusters_(0)},MarkerClusterer.prototype.resetViewport_=function(t){for(var e,i=0;i<this.clusters_.length;i++)this.clusters_[i].remove();for(this.clusters_=[],i=0;i<this.markers_.length;i++)(e=this.markers_[i]).isAdded=!1,t&&e.setMap(null)},MarkerClusterer.prototype.distanceBetweenPoints_=function(t,e){var i=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,i=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2);return 6371*(2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i)))},MarkerClusterer.prototype.isMarkerInBounds_=function(t,e){return e.contains(t.getPosition())},MarkerClusterer.prototype.addToClosestCluster_=function(t){for(var e,i,s=4e4,o=null,a=0;a<this.clusters_.length;a++)(i=(e=this.clusters_[a]).getCenter())&&(i=this.distanceBetweenPoints_(i,t.getPosition()))<s&&(s=i,o=e);o&&o.isMarkerInClusterBounds(t)?o.addMarker(t):((e=new Cluster(this)).addMarker(t),this.clusters_.push(e))},MarkerClusterer.prototype.createClusters_=function(t){var e,i=this;if(this.ready_){0===t&&(google.maps.event.trigger(this,"clusteringbegin",this),void 0!==this.timerRefStatic)&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic);for(var s=3<this.getMap().getZoom()?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)),o=this.getExtendedBounds(s),a=Math.min(t+this.batchSize_,this.markers_.length),r=t;r<a;r++)!(e=this.markers_[r]).isAdded&&this.isMarkerInBounds_(e,o)&&(!this.ignoreHidden_||this.ignoreHidden_&&e.getVisible())&&this.addToClosestCluster_(e);a<this.markers_.length?this.timerRefStatic=setTimeout(function(){i.createClusters_(a)},0):(delete this.timerRefStatic,google.maps.event.trigger(this,"clusteringend",this))}},MarkerClusterer.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype[e]=t.prototype[e];return this}.apply(t,[e])},MarkerClusterer.CALCULATOR=function(t,e){for(var i=0,t=t.length.toString(),s=t;0!==s;)s=parseInt(s/10,10),i++;return{text:t,index:i=Math.min(i,e),title:""}},MarkerClusterer.BATCH_SIZE=2e3,MarkerClusterer.BATCH_SIZE_IE=500,MarkerClusterer.IMAGE_PATH="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/images/m",MarkerClusterer.IMAGE_EXTENSION="png",MarkerClusterer.IMAGE_SIZES=[53,56,66,78,90],"function"!=typeof String.prototype.trim)&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})}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)}var openQuicksearch,waitForRequireJsAndInjectQuicksearchFunction;function MikaResultsTfd(){}Array.indexOf||(Array.prototype.indexOf=function(t){for(var e=0;e<this.length;e++)if(this[e]==t)return e;return-1}),!function(o){o.extend({playSoundInit:function(t){for(var e in o("body").append('<span id="playSound"></span>'),t){var i,s;"active"!=e&&((i=document.createElement("audio")).id="sound"+e.replace("url_",""),i.autoplay=!1,i.loop=!1,i.volume=1,i.preload="auto",document.getElementById("playSound").appendChild(i),(s=document.createElement("source")).src=t[e],s.type="audio/wav",i.appendChild(s))}},playSound:function(t){document.getElementById("sound"+t)&&document.getElementById("sound"+t).play()}})}(jQuery),"function"!=typeof openQuicksearch&&(waitForRequireJsAndInjectQuicksearchFunction=function(){"function"==typeof require?require(["Mika/Quicksearch","Mika/Tools"],function(i,s){jQuery(document).ready(function(){var t=new s,e=document.createElement("input");e.className="hidden",document.getElementsByTagName("body")[0].appendChild(e),openQuicksearch=new i({input:t.identify(e)}).openQuicksearchDetailDialog})}):setTimeout(arguments.callee,200)},waitForRequireJsAndInjectQuicksearchFunction());var results_tfd_global={},tfd_object;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="?",key,i;for(key in vars)url+="&"+key+"="+vars[key];for(i in ids){var str="var callback"+i+" = function(result) { this.jq('"+ids[i]+"').update(result); ",str_url=(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+=""),options.focus&&(str+="document.getElementById('"+options.focus+"').focus();"),str+="};",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 e&&(e={}),(s="object"!=typeof s?{}:s).confirm&&!confirm(s.confirm))return!1;var o,a,r="?";for(o in e)r+="&"+o+"="+e[o];for(a in i){var n=encodeURI(r+"&ajax="+i[a]);document.forms[t].action=n,HTML_AJAX.formSubmit(t,i[a])}return!0}function open_popup(t,e){for(query="",i=0;i<t.elements.length;i++)"undefined"!=t.elements[i].name&&"Submit"!=t.elements[i].name&&"namedItem"!=t.elements[i].name&&"item"!=t.elements[i].name&&(query+="&"+t.elements[i].name+"="+t.elements[i].value);win=window.open(t.action+query,e,"width=760,height=600")}function open_print(t,e){e?win=window.open(t,e,"width=900,height=700,scrollbars=yes,resizable=yes,location=no,menubar=no"):window.print()}function debounce(s,o,a){var r;return function(){var t=this,e=arguments,i=a&&!r;clearTimeout(r),r=setTimeout(function(){r=null,a||s.apply(t,e)},o),i&&s.apply(t,e)}}function ResultsClientTools(){}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)for(i in t[1]=unescape(t[1]),favorites=t[1].split("|"))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)}),jQuery("#tfd-container").on("click",".tfd-row",function(t){if(!t.target.classList.contains("tfd-row"))return!0;jQuery(t.target).find(".tfd-pri").trigger("click")})},trackGA:function(t){},setData:function(t){if("timeout"==t.status)this.reload();else{for(var e in this.result=t,"update_filter"!=this.result.status&&(this.prev_result=this.result),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}"paused"==this.result.status?(this.render(!0),window.setTimeout(this.options.obj+".load()",3e4)):(this.hash=this.result.hash,this.render(!0),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={row:!0,update:!0,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!=(s=localStorage.getItem("mikatfd_"+this.options.obj+"_config_"+this.options.localSettings[t]))&&("false"==s?s=!1:"true"==s&&(s=!0),this[this.options.localSettings[t]]=s);var e=sessionStorage.getItem("mikatfd_"+this.options.obj+"_config_filters");if(e){var i,s,o=e.split(",");for(i in o)o.hasOwnProperty(i)&&null!=(s=sessionStorage.getItem("mikatfd_"+this.options.obj+"_config_field_"+o[i]))&&(this.options_submit.fields[o[i]]=s)}null!=(s=sessionStorage.getItem("mikatfd_"+this.options.obj+"_config_field_lpc"))&&(this.options_submit.fields.lpc=s),null!=(s=sessionStorage.getItem("mikatfd_"+this.options.obj+"_config_ack_favorites"))&&(this.ack_favorites=JSON.parse(s))}},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,i=[];for(e in this.options_submit.fields)(this.options_submit.fields.hasOwnProperty(e)||this.options_submit.fields[e])&&(sessionStorage.setItem("mikatfd_"+this.options.obj+"_config_field_"+e,this.options_submit.fields[e]),i.push(e));sessionStorage.setItem("mikatfd_"+this.options.obj+"_config_filters",i.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(){for(var t in jQuery("#"+this.options.target).removeClass("favorite-ack"),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(){jQuery("html").hasClass("tfd-fullscreen")?jQuery("html").removeClass("tfd-fullscreen"):jQuery("html").addClass("tfd-fullscreen"),this.updateFilterStatus()},resetAllFilters:function(){var e=this;jQuery.each(this.filter_fields[this.options.obj],function(t){delete e.filter_fields[e.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)},renderStatusButtons:function(){var t="",e={pause:this.paused?"pause-on":"pause-off",only_favorites:this.only_favorites?"pause-on":"pause-off"},t=(t=(t+='<a class="button-pause '+e.pause+'" onclick="'+this.options.obj+'.switchPause(); return false;" href="#">'+this.config.strings.pause+"</a>")+('<a class="button-fullscreen" onclick="'+this.options.obj+'.switchFullscreen(); return false;" href="#">'+this.config.strings.fullscreen_toggle+"</a>"))+('<a class="button-favorites '+e.only_favorites+'" onclick="'+this.options.obj+'.switchFavorites(); return false;" href="#">'+this.config.strings.only_favorites+"</a>");return this.config.sound&&(e.sound=this.sound?"sound-on":"sound-off",t+='<a class="button-favorites '+e.sound+'" onclick="'+this.options.obj+'.switchSound(); return false;" href="#">'+this.config.strings.sound+"</a>"),t+='<a class="button-favorites filters-reset" onclick="'+this.options.obj+'.resetAllFilters(); return false;" href="#">'+this.config.strings.reset_all_filters+"</a>"},renderFilterStatus:function(){var a,e,r="";return void 0!==this.result.filters&&(jQuery("#"+this.options.target+" #tfd-status-filters").addClass("num-filters-"+Object.keys(this.result.filters).length),a=this.options.obj,e=0,jQuery.each(this.result.filters,function(t,s){var o;"status-bar"==s.type&&(r=(r=(r+='<div class="status-container field-'+s.field+" num-filter-"+e+'">')+'<div class="legend">'+s.title+"</div>")+'<div class="status field field-'+s.field+'">',o="",jQuery.each(s.values,function(t,e){o="",e.has_data&&(o+=" active");var i="",t=(e.fav_count&&(i='<span class="badge">'+e.fav_count+"</span>"),e.selected&&(o+=" selected"),t==s.values.length-1&&(o+=" last"),s.classes&&(o+=" "+s.classes),"");e.subtext&&(t="<span>"+e.subtext+"</span>"),r+='<a onclick="'+a+".setFilter('"+s.field+"', '"+e.key+"', "+s.is_index+'); return false;" href="#" class="'+o+'">'+e.value+t+i+"</a>"}),r+="</div></div>",e++)}),r+='<div style="clear:both;"></div>'),r},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 i,c,u,g,m,f,_,v,y,b,k,w,e,s,o,j="",C="",M="",x=[],S=[],O=[];if(t||(j+='<div class="tfd-main" id="tfd-main"><div id="tfd-status" class="hideable-extended"><div id="tfd-status-buttons" class="status buttons"></div><div id="tfd-status-filters"></div></div><div class="tfd-legend-row status"></div><div class="tfd-content-wrap"><div id="tfd-content">'),void 0!==this.result.data&&("paused"==this.result.status?j+='<div class="tfd-row"><div class="tfd-pri"><div class="msg  paused">Stream pausiert. Wird automatisch fortgesetzt.</div></div>':this.result.data.length||"ok"!=this.result.status?(u=c=!1,this.options_submit.last_seq?this.result.data.length&&(jQuery("#"+this.options.target+" #tfd-content").removeClass("initial"),c=this.result.data.length):(void 0!==this.prev_result.data&&this.prev_result.data.length?(i=this.prev_result.data[0].seq,jQuery.each(this.result.data,function(t,e){if(e.seq==i)return c=t,!1})):i=!1,jQuery("#"+this.options.target+" #tfd-content").addClass("initial")),u=jQuery("#"+this.options.target+" .tfd-row").first().hasClass("highlight")?!(c%2):!!(c%2),g=this.config,m=this.favorites,f=this.options_submit.last_seq,_=0,v={},y=this.ids_on_screen,b={},k=this.options.obj,h=this.options,w=this.getTimeLabel(g),jQuery("#"+this.options.target+" .tfd-row").removeClass("created"),jQuery.each(this.result.data,function(t,o){if(void 0===o.seq)return!0;var e="",i="",s=!1,a="",r="",n="",l="",d=!1;if(b.row=!0,g.update_on_duplicates){var h=!1;for(p in y)if(y[p]==o.id){b.update=d=!0;break}}if(-1!=jQuery.inArray(o.id,m)?(s=!0,e+=" favorite"):o.fav&&(e+=" favorite",b.favorite=!0),o.css_class&&(e+=" "+o.css_class),u?(e+=" highlight",u=!1):(u=!0,e+=""),(c||f)&&(t<c||f)&&!d&&(e+=" newentry"),e+=" created",d&&(e+=" updated"),o.index&&(e+=" index-"+o.index,O.push(o.index)),void 0!==o.g.marker&&o.g.marker.length&&(e+=" has-marker marker-"+o.g.marker.length),void 0!==o.g.secondary&&o.g.secondary.length&&(e+=" twoline"),void 0!==o.g.tertiary&&o.g.tertiary.length&&(e+=" threeline"),o.hi?i+=" background-color:"+o.hi+";":s&&(e+=" fav-color i-"+jQuery.inArray(o.id,m)),g.quicksearch&&(i+="cursor:pointer;",a=" onclick=\"openQuicksearch('"+o.id+"', '"+o.event_id+"', '');\""),o.fav&&(i+="cursor:pointer;",r=" onmouseover=\"jQuery(this).addClass('rowbuttons');\"",n=" onmouseout=\"jQuery(this).removeClass('rowbuttons');\"",l='<div class="rowbuttons-buttons"><a href="javascript:;" onclick="'+k+".ackSwitchFavorite('"+o.id+"');\">ACK</a></div>"),_++,C='<div id="id-'+o.id+'" style="'+i+'" class="tfd-row '+e+'"'+r+n+">",l&&(C+=l),void 0!==o.g.marker&&(C+='<div class="tfd-marker"'+a+">",jQuery.each(o.g.marker,function(t,e){C+='<div title="'+e.v+'" class="marker field-'+e.n.toLowerCase()+" value-"+(null!==e.v?e.v.replace(" ","").toLowerCase():"")+'">',e.v,"cutoff"==e.n&&void 0!==e.o&&void 0!==e.o.cutoff_discipline&&null!=e.o.cutoff_discipline&&(C+='<div class="discipline">'+e.o.cutoff_discipline+"</div>"),C+="</div>",void 0!==e.o&&(v[o.id]={field:e.n.toLowerCase(),options:e.o})}),C+="</div>"),void 0!==o.g.primary&&(C+='<div class="tfd-pri"'+a+">",jQuery.each(o.g.primary,function(t,e){i=void 0!==e.o&&void 0!==e.o.width?'style="width:'+e.o.width+'"':"";var i,s="";e.n===w&&(s='data-field="time"'),C+="<div "+i+' class="field '+e.n.toLowerCase()+'" '+s+">",e.v&&(void 0!==e.o&&void 0!==e.o.is_countdown?void 0!==e.o.get_ready_text&&void 0!==e.o.get_ready_seconds?C+='<time data-get-ready-text="'+e.o.get_ready_text+'" data-get-ready-seconds="'+e.o.get_ready_seconds+'" data-direction="down" datetime="'+(new Date).toISOString().slice(0,10)+" "+e.v+'">'+e.v+"</time>":C+='<time data-direction="down" datetime="'+(new Date).toISOString().slice(0,10)+" "+e.v+'">'+e.v+"</time>":C+=e.v),C+="</div>",void 0!==e.o&&(v[o.id]={field:e.n.toLowerCase(),options:e.o})}),C+="</div>",t="",void 0!==o.g.marker&&o.g.marker.length&&(t+=" has-marker marker-"+o.g.marker.length),M='<div class="tfd-pri tfd-pri-legend '+t+'">',jQuery.each(o.g.primary,function(t,e){var i;i=void 0!==e.o&&void 0!==e.o.width?'style="width:'+e.o.width+'"':"",M+="<div "+i+' class="field '+e.n.toLowerCase()+'">',e.n&&(M+=e.n),M+="</div>"}),M+="</div>"),void 0!==o.g.secondary&&(C+='<div class="tfd-sec"'+a+">",jQuery.each(o.g.secondary,function(t,e){var i;i=void 0!==e.o&&void 0!==e.o.width?'style="width:'+e.o.width+'"':"",C=(C=(C+="<div "+i+' class="field '+e.n.toLowerCase()+'">')+'<div class="legend">'+e.n+"</div>")+e.v+"</div>",void 0!==e.o&&(v[o.id]={field:e.n.toLowerCase(),options:e.o})}),C+="</div>"),void 0!==o.g.tertiary&&(C+='<div class="tfd-tertiary"'+a+">",jQuery.each(o.g.tertiary,function(t,e){C=(C=(C+='<div class="field '+e.n.toLowerCase()+'">')+'<div class="legend">'+e.n+"</div>")+e.v+"</div>",void 0!==e.o&&(v[o.id]={field:e.n.toLowerCase(),options:e.o})}),C+="</div>"),C=C+'<div style="clear:both"></div>'+"</div>",g.update_on_duplicates){h=!1;for(p in y)if(y[p]==o.id){S.push({id:o.id,content:C}),h=!0;break}h||(x.push(C),j+=C)}else x.push(C),j+=C;if(y.push(o.id),g.close_on_duplicates&&is_close)for(var p in y)y[p]==o.id&&delete y[p]})):j=(j+='<div class="tfd-row"><div class="tfd-pri">')+'<div class="msg  empty-msg">'+this.config.strings.no_results+"</div></div>"),t||(j+='</div><div class="tfd-content-shadow"></div></div></div>'),this.options_submit.last_seq){if(void 0!==g&&"overview"==g.mode)for(var a in O)if(jQuery("#"+this.options.target+" .index-"+O[a]).replaceWith(x[a]).length)jQuery("#"+this.options.target+" .index-"+O[a]).removeClass("newentry"),jQuery("#"+this.options.target+" .index-"+O[a]).addClass("updated");else{var r=[];if(jQuery("#"+this.options.target+" .tfd-row").each(function(t){var e=jQuery(this).attr("class"),e=(e=e.substr(e.indexOf("index-")+6)).replace(" updated","");r.push(e)}),r.length){var n,l=r;for(n in l.push(O[a]),isNaN(l[0])?l.sort():l.sort(function(t,e){return t-e}),l)l[n]==O[a]&&(0<(n=parseInt(n))?jQuery("#"+this.options.target+" .index-"+l[n-1]).after(x[a]):jQuery("#"+this.options.target+" .index-"+l[n+1]).before(x[a]),jQuery("#"+this.options.target+" .index-"+O[a]).addClass("updated"))}else jQuery("#"+this.options.target+" #tfd-content").append(x[a])}else if(jQuery("#"+this.options.target+" #tfd-content").prepend(x.join("")),jQuery("#"+this.options.target+" #tfd-content div.tfd-row").length>this.result.max_entries)for(a=0;a<_;a++)jQuery("#"+this.options.target+" #tfd-content .tfd-row:last").remove();if(this.config.sound.active&&this.sound)for(a in b)void 0!==this.config.sound["url_"+a]&&this.config.sound["url_"+a]&&jQuery.playSound(a)}else(t?jQuery("#"+this.options.target+" #tfd-content"):jQuery("#"+this.options.target)).html(j);for(e in M&&jQuery("#"+this.options.target+" .tfd-legend-row").html(M),void 0!==g&&void 0!==g.highlight_animations&&void 0!==g.highlight_animations.created&&(o=g.highlight_animations.created,jQuery("#"+h.target+" .tfd-row.created  .field.message").animate({width:"show"},{duration:5e3,complete:function(){jQuery(this).animate({color:o.color},{duration:o.speed})}})),v)for(var d in v[e].options)switch(d){case"start_clock":v[e].options[d]&&this.clockStartForId(e,v[e].field);break;case"stop_clock":v[e].options[d]&&this.clockStopForId(e,v[e].field);break;case"call_trigger":s=!this.result.from_seq,this.callTrigger(v[e].options[d],e,{init:s});break;case"timer":s=this.result.from_seq?"false":"true",v[e].options[d].call_trigger&&v[e].options[d].timeout&&(this.timer["timer_"+e]=window.setTimeout(this.options.obj+".callTrigger('"+v[e].options[d].call_trigger+"', '"+e+"', {init:"+s+"});",v[e].options[d].timeout))}for(a in S)jQuery("#"+this.options.target+" #id-"+S[a].id).replaceWith(S[a].content);this.config.animation_speed&&("customTrigger"!==this.config.animation&&(jQuery("#"+this.options.target+" .newentry").slideDown(this.config.animation_speed),jQuery("#"+this.options.target+" .closed").hide()),this.config.highlight_animations)&&!(o=void 0!==this.config.highlight_animations.updated?this.config.highlight_animations.updated:this.config.highlight_animations.default).disabled&&jQuery("#"+this.options.target+" .updated").css({display:"block"}).effect("highlight",{color:o.color},o.speed),jQuery("#"+this.options.target+" .newentry").removeClass("newentry"),jQuery("#"+this.options.target+" .updated").removeClass("updated"),t||jQuery("#"+this.options.target+" #tfd-status-buttons").html(this.renderStatusButtons());var h=this.measureScrollbars(),t=document.querySelector(".tfd-legend-row"),t=(t&&t.style.setProperty("--tfd-scrollbar-offset",h+"px"),!1);jQuery("#"+this.options.target+" .status-container").length||(t=!0),this.hash_filters!=this.result.filters_hash&&(this.updateFilterStatus(),this.hash_filters=this.result.filters_hash),t&&this.updateFilterStatus(),this.reloadAckFavoritesMark(),MikaResultsRenderTrigger()},callTrigger:function(t,e,i){switch(t){case"open":this.config.highlight_animations&&(s=void 0!==this.config.highlight_animations.opened?this.config.highlight_animations.opened:this.config.highlight_animations.default,o=this.options.obj,i.init||jQuery("#"+this.options.target+" #id-"+e).animate({width:"show"},{duration:window[o].config.animation_speed,complete:function(){jQuery(this).effect("highlight",{color:s.color,duration:s.speed})}}));break;case"update1":this.config.highlight_animations&&(s=void 0!==this.config.highlight_animations.update1?this.config.highlight_animations.update1:this.config.highlight_animations.default,o=this.options.obj,i.init||jQuery("#"+this.options.target+" #id-"+e).animate({width:"show"},{duration:window[o].config.animation_speed,complete:function(){jQuery(this).effect("highlight",{color:s.color,duration:s.speed})}}));break;case"update2":this.config.highlight_animations&&(s=void 0!==this.config.highlight_animations.update2?this.config.highlight_animations.update2:this.config.highlight_animations.default,o=this.options.obj,i.init||jQuery("#"+this.options.target+" #id-"+e).animate({width:"show"},{duration:window[o].config.animation_speed,complete:function(){jQuery(this).effect("highlight",{color:s.color,duration:s.speed})}}));break;case"update3":this.config.highlight_animations&&(s=void 0!==this.config.highlight_animations.update3?this.config.highlight_animations.update3:this.config.highlight_animations.default,o=this.options.obj,i.init||jQuery("#"+this.options.target+" #id-"+e).animate({width:"show"},{duration:window[o].config.animation_speed,complete:function(){jQuery(this).effect("highlight",{color:s.color,duration:s.speed})}}));break;case"close":this.config.highlight_animations&&(s=void 0!==this.config.highlight_animations.closed?this.config.highlight_animations.closed:this.config.highlight_animations.default,o=this.options.obj,i.init?jQuery("#"+this.options.target+" #id-"+e).remove():jQuery("#"+this.options.target+" #id-"+e).effect("highlight",{color:s.color,duration:s.speed,complete:function(){jQuery(this).animate({width:"hide"},{duration:window[o].config.animation_speed,complete:function(){jQuery(this).remove()}})}}));break;case"close_timeout":var s,o;this.config.highlight_animations&&(s=void 0!==this.config.highlight_animations.closed_timeout?this.config.highlight_animations.closed_timeout:this.config.highlight_animations.default,o=this.options.obj,i.init?jQuery("#"+this.options.target+" #id-"+e).remove():jQuery("#"+this.options.target+" #id-"+e).effect("highlight",{color:s.color,duration:s.speed,complete:function(){jQuery(this).animate({width:"hide"},{duration:window[o].config.animation_speed,complete:function(){jQuery(this).remove()}})}}))}},clockStartForId:function(t,e){this.clocks[t]={field:e,time:0},this.clockUpdate(t),void 0!==this.timer[t]&&window.clearInterval(this.timer[t]),this.timer[t]=window.setInterval(this.options.obj+".clockUpdate('"+t+"')",100)},clockStopForId:function(t){delete this.clocks[t],window.clearInterval(this.timer[t]),delete this.timer[t]},clockUpdate:function(t){var e,i,s;void 0!==this.clocks[t]&&((e=jQuery("#"+this.options.target+" #id-"+t+" .field."+this.clocks[t].field)).length?(this.clocks[t].time+=100,(i=this.parseSeconds(this.clocks[t].time,!0)).hours<10&&(i.hours="0"+i.hours),i.minutes<10&&(i.minutes="0"+i.minutes),i.seconds<10&&(i.seconds="0"+i.seconds),i.milliseconds=i.milliseconds/10,0==i.milliseconds&&(i.milliseconds="00"),s="",s=(s=(s=(s+=i.hours+":")+i.minutes+":")+i.seconds+".")+i.milliseconds/10,e.html(s)):this.clockStopForId(t))},clockClearTimers:function(){for(var t in this.clocks)window.clearInterval(this.timer[t]),delete this.timer[t];this.clocks=[]},setOptions:function(t){this.options=t},parseSeconds:function(t,e){var i={},e=(e||(t*=1e3),i.days=Math.floor(t/864e5),t%864e5);return i.hours=Math.floor(e/36e5),e%=36e5,i.minutes=Math.floor(e/6e4),e%=6e4,i.seconds=Math.floor(e/1e3),i.milliseconds=e%1e3,i},getTimeLabel:function(t){return t&&t.fields&&t.fields.primary&&(t=t.fields.primary.race_time_ceil_str||t.fields.primary.race_time_floor_str)&&t.title?t.title:null},measureScrollbars:()=>{var t=document.querySelector("#tfd-content");return t?t.offsetWidth-t.clientWidth:0}},MikaResultsSearch.prototype={jq:{},options:{},requester:{},data:{},targetElement:{},strings:{},timer:{},options_submit:{},branches:{},payload_branch_reset:null,setOptions:function(t){this.options=t},getPayloadBranchReset:function(){var s;return null===this.payload_branch_reset&&(s={},Object.entries(this.options.mapping).forEach(function(t){var e={},i=t[0];t[1].forEach(function(t){void 0===e[t.field]&&(e[t.field]=null)}),s[i]=e}),this.payload_branch_reset=s),this.payload_branch_reset},setJQ:function(t){this.jq=t},createSearchFields:function(t){if("function"!=typeof this.jq&&"function"==typeof jQuery)this.jq=jQuery.noConflict();else if("function"!=typeof this.jq)return void console.log("no jQuery found!");this.reload()},makeRequest:function(t,e,i){this.requester[t]=this.jq.ajax({type:"GET",url:"index.php",data:{content:"ajax2",func:t,options:e},success:i,complete:function(){res2.unlockForm()}})},load:function(){var e=new this.jq.Deferred;return this.options_submit.lang=this.options.lang,this.options_submit.pid=this.options.pid,this.makeRequest("getSearchFields",this.options_submit,function(t){res2.setData(t),e.resolve()}),e.promise()},synchronizeEventMainGroup:function(e,i){var t=Object.keys(this.options.mapping);t.length<1||"object"!=typeof e||null===e||"string"!=typeof i||(t.filter(function(t){return void 0!==e[t]}).forEach(function(t){e[t].event_main_group=i}),this.jq('select[name="event_main_group"]').each((t,e)=>{e=this.jq(e);e.find('option[value="'+i+'"]').length&&e.val(i)}))},reload:function(t,e,i,s){var o,a=new this.jq.Deferred;if(this.options_submit.b=this.getPayloadBranchReset(),t&&"event_main_group"==t.attr("name"))for(var e in this.options.mapping)for(var r in this.options.mapping[e]){var n=this.options.mapping[e][r],l=this.jq(n.parent+" "+n.element);"event"!=n.field&&"event_main_group"!=n.field&&"%"!=l.val()&&""!=l.val()&&(l.is("select")?l.val("%"):l.val(""))}for(o in t&&"event_main_group"===t.attr("name")&&this.synchronizeEventMainGroup(this.options_submit.b,s.value),this.options.mapping){for(var r in this.options.mapping[o]){n=this.options.mapping[o][r];e!=o&&i&&i!=n.parent||"%"!=(l=this.jq(n.parent+" "+n.element)).val()&&""!=l.val()&&("event"==n.field&&t&&"event_main_group"==t.attr("name")?this.options_submit.b[o][n.field]="":this.options_submit.b[o][n.field]=l.val())}this.lockForm(o)}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]){var i,s;this.options.mapping[t].hasOwnProperty(e)&&(e=this.options.mapping[t][e],i=this.jq(e.parent+" "+e.element),"ok"==(s=this.branches[t].fields[e.field]).state&&s.data.length?this.generateSelectFromField(i,s.data,i.val(),e,t):this.generateField(i,i.val()),1==this.branches[t].fields[e.field].data.length)&&this.branches[t].fields[e.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]){i=this.options.mapping[e][i];this.jq(i.parent+" "+i.element).attr("disabled","disabled")}window.clearTimeout(res2.timer[t]),res2.timer[t]=window.setTimeout("res2.showIndicator('"+t+"')",400)}var s=Object.keys(this.options.mapping);jQuery(s.map(t=>".branch-"+t).join(", ")).find(":button, :submit, .btn").not("[disabled]").addClass("disabled-while-calling").attr("disabled","disabled")},showIndicator:function(t){jQuery(".branch-"+t+" .box-content");jQuery(".panel-loading").css("display","block")},unlockForm:function(){for(var t in jQuery(".panel-loading").css("display","none"),jQuery(".disabled-while-calling").removeClass("disabled-while-calling").removeAttr("disabled"),res2.timer)window.clearTimeout(res2.timer[t])},generateSelectFromField:function(t,e,i,s,o){t.attr("placeholder")||t.attr("placeholder","");var a,r=this.jq("<select></select>");for(a in r.attr({placeholder:t.attr("placeholder"),class:t.attr("class"),name:t.attr("name"),id:t.attr("id")}),i=i||"%",e){var n,l="object"==typeof e[a].v?(n=e[a].v[0],1!=e[a].n&&e[a].n&&null!=e[a].n?e[a].v[1]+" ("+e[a].n+")":e[a].v[1]):(n=e[a].v,1!=e[a].n&&e[a].n&&null!=e[a].n?e[a].v+" ("+e[a].n+")":e[a].v),d=this.jq("<option>");d.html(l),i==n?d.attr({value:n,selected:"selected"}):d.attr({value:n}),r.append(d)}r.change(function(){res2.reload(t,o,s.parent,this)}),t.replaceWith(r)},generateField:function(t,e){t.attr("placeholder")||t.attr("placeholder","");var i=this.jq("<input>");i.attr({placeholder:t.attr("placeholder"),class:t.attr("class"),name:t.attr("name"),id:t.attr("id"),value:e}),i.change(function(){res2.reload()}),t.replaceWith(i)}},mouseX=0,mouseX=0,ResultsClientTools.prototype={id:"",fields:{},request:{},selected:{},path:"",labels:{},type:"",data:{},strings:{},syncProxy:{},init:function(){},setData:function(t){this.data=t,this.replaceElementsWithDistinctData(this.fields)},setImagePath:function(t){this.imagePath=t},setLanguage:function(t){this.language=t},setStrings:function(t){this.strings=t},render:function(){this.request&&("list"==this.type?this.syncProxy=new ResultsServer({getDistinctResults:function(t){rObj_list.setData(t)}}):this.syncProxy=new ResultsServer({getDistinctResults:function(t){rObj.setData(t)}}),this.syncProxy.getDistinctResults(this.fields,this.request,this.language,this.type))},replaceElementsWithDistinctData:function(t){var s=this.data;t.each(function(t,e){var i=!1;void 0!==t.disable_all&&(i=t.disable_all),"object"==typeof s.data[e]?this.generateSelectFromElement(t.element,s.data[e],this.selected[t.field],i):this.generateElementFromSelect(t.element,this.selected[t.field])},this)},generateSelectFromElement:function(t,e,i,s){$(t).placeholder||($(t).placeholder="");var o=new Element("select",{placeholder:$(t).placeholder,class:$(t).class,name:$(t).name,id:$(t).id}),a=(this.labels[$(t).id]=$(t).placeholder,"list"==this.type?o.observe("change",function(){rObj_list.reload(this.id)}):o.observe("change",function(){rObj.reload(this.id)}),!1);i&&e.each(function(t,e){option_value="object"==typeof t.v?(option_key=t.v[0],1!=t.n&&t.n&&null!=t.n?t.v[1]+" ("+t.n+")":t.v[1]):(option_key=t.v,1!=t.n&&t.n&&null!=t.n?t.v+" ("+t.n+")":t.v),i==option_key&&(a=!0)},this),$(t).name,s||(!a&&i&&"%"!=i?(o.insert(new Element("option",{value:"%"}).update(this.strings.all)),o.insert(new Element("option",{selected:"selected",value:escapeHtml(i)}).update(this.strings.all_containing+' "'+escapeHtml(i)+'"'+(e.length?" ...":"")))):o.insert({top:new Element("option",{value:"%"}).update(this.strings.all+(e.length?" ...":""))})),e.each(function(t,e){option_value="object"==typeof t.v?(option_key=t.v[0],1!=t.n&&t.n&&null!=t.n?t.v[1]+" ("+t.n+")":t.v[1]):(option_key=t.v,1!=t.n&&t.v&&null!=t.n?t.v+" ("+t.n+")":t.v),option=(i==option_key?new Element("option",{value:option_key,selected:"selected"}):new Element("option",{value:option_key})).update(option_value),o.insert(option)},this),Element.replace(t,o),s=i&&"%"!=i?new Element("img",{class:"clearButton",style:"display:inline",id:$(t).id+"clearButton",src:this.imagePath+"/icon_undo.gif",alt:this.strings.reset,title:this.strings.reset}):new Element("img",{class:"clearButton",style:"display:none",id:$(t).id+"clearButton",src:this.imagePath+"/icon_undo.gif",alt:this.strings.reset,title:this.strings.reset}),"list"==this.type?s.observe("click",function(){rObj_list.clear($(t).id)}):s.observe("click",function(){rObj.clear($(t).id)}),null!=$($(t).id+"clearButton")?Element.replace($($(t).id+"clearButton"),s):o.insert({after:s})},generateElementFromSelect:function(t,e){"%"==e&&(e=""),$(t).placeholder||($(t).placeholder=this.labels[$(t).id]),"undefined"==$(t).placeholder&&($(t).placeholder="");var i=new Element("input",{type:"text",class:$(t).class,placeholder:$(t).placeholder,name:$(t).name,id:$(t).id,value:e});"list"==this.type?i.observe("change",function(){rObj_list.reload(this.id)}):i.observe("change",function(){rObj.reload(this.id)}),Element.replace(t,i),e=e&&"%"!=e?new Element("img",{class:"clearButton",style:"display:inline",id:$(t).id+"clearButton",src:this.imagePath+"/icon_undo.gif",alt:this.strings.reset,title:this.strings.reset}):new Element("img",{class:"clearButton",style:"display:none",id:$(t).id+"clearButton",src:this.imagePath+"/icon_undo.gif",alt:this.strings.reset,title:this.strings.reset}),"list"==this.type?e.observe("click",function(){rObj_list.clear($(t).id)}):e.observe("click",function(){rObj.clear($(t).id)}),null!=$($(t).id+"clearButton")?Element.replace($($(t).id+"clearButton"),e):i.insert({after:e})},reload:function(t){this.selected={},this.fields.each(function(t){this.selected[t.field]=$(t.element).value,$(t.element).id,""!=$(t.element).value&&(this.request[t.field]=$(t.element).value)},this),this.render()},clear:function(e){this.fields.each(function(t){$(t.element).id==e&&(this.selected[t.field]="%",this.request[t.field]="%")},this),this.render()},setFields:function(t){this.fields=t},setType:function(t){this.type=t}};