Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ajaxloadingdelay = false;
- var ajaxloadingarchivemsg = false;
- var block_hiding_loadinglayer_when_loading = false;
- var graphwidth = 0;
- var keydown = 0;
- var no_reload = true;
- var last_param_id = 0;
- var images=[]; // buffers for preloading loop images
- var gifimages=[]; // buffers for preloading gif images
- var gifonce = true;
- var gifimages_loaded=0;
- var loaded_image_sources = [];
- var images_loaded =0;
- var images_waiting=0;
- var images_speed=5; // 0-10 different speeds
- var images_delay=[1000,750,400,200,160,140,120,100,90,80,70];
- var images_extend_max =8;
- var images_extend =1;
- var images_islast =0;
- var compact_interval=3;
- var loading=0;
- var popover_status = [];
- var favtoggle_status = 'hide';
- var adblock_txt = '<div class="abtextout"><div class="abtext"><p>Liebe Benutzerinnen und Benutzer von kachelmannwetter.com</p><p>Unsere Seite hat viele Angebote, die es nirgendwo anders gibt: Stormtracking, Blitzanalyse, Hagelalarm für Deutschland, Schweiz, Österreich und Luxemburg, das SuperHD-Modell mit 1x1 km Auflösung, weltweit viele Parameter des ECMWF-Modells und vieles mehr.</p><p>Dass es das anderswo nicht gibt, hat seinen Grund. Es ist uns was wert, tolle Menschen in der Firma zu haben, die das können, und Daten einzukaufen, die andere nicht haben und damit einen noch besseren Service zu bieten.</p></div><div class="abtext"><p>Das Ganze beruht irgendwie auf der Annahme, dass die User ahnen, dass wir Daten und Gehälter, die das möglich machen, irgendwie finanzieren müssen. Wir werden deshalb in naher Zukunft drei Dinge tun, damit alle etwas beitragen können.</p><p>1. Die Seite wird weiterhin Werbung haben.</p><p>2. Wer keine Werbung mag, wird für wenig Geld eine werbefreie Seite bekommen und für etwas mehr als wenig, aber immer noch wenig Geld eine werbefreie Seite mit zusätzlichen exklusiven Funktionen bekommen.</p></div><div class="abtext"><p>3. Wer einen Adblocker hat und sich nicht solidarisch in unserem UnterstützerInnen-Kollektiv engagieren möchte, wird unsere Seite leider nicht mehr sehen können.</p><p>Wir freuen uns auf alle, die bei uns bleiben - es ändert sich fast nichts und das Angebot wird wie bisher laufend ausgebaut. Wir sind noch lange nicht fertig und voller Ideen und Tatendrang.</p><p>Herzlich<br />Team Kachelmann GmbH</p></div><div style="clear:both;"></div></div>';
- var adblock_txt2 = '<div class="abtextout"><p>Werbefläche</p></div>';
- var download_image = null;
- var is_playing_first = true;
- var chartcounter=2;
- var xclicksvalue=0;
- var open_dd_div1='';
- var open_dd_div2='';
- var open_dd_tab_valids='';
- var open_dd_tab_models='';
- var open_dd_tab_params='';
- var open_dd_valids='';
- var open_dd_start=true;
- /**
- * jQuery Unveil
- * A very lightweight jQuery plugin to lazy load images
- * http://luis-almeida.github.com/unveil
- *
- * Licensed under the MIT license.
- * Copyright 2013 Luís Almeida
- * https://github.com/luis-almeida
- */
- ;(function($) {
- $.fn.unveil = function(threshold, callback) {
- var $w = $(window),
- th = threshold || 0,
- retina = window.devicePixelRatio > 1,
- attrib = retina? "data-src-retina" : "data-src",
- images = this,
- loaded;
- this.one("unveil", function() {
- var source = this.getAttribute(attrib);
- source = source || this.getAttribute("data-src");
- if (source) {
- this.setAttribute("src", source);
- if (typeof callback === "function") callback.call(this);
- }
- });
- function unveil() {
- var inview = images.filter(function() {
- var $e = $(this);
- if ($e.is(":hidden")) return;
- var wt = $w.scrollTop(),
- wb = wt + $w.height(),
- et = $e.offset().top,
- eb = et + $e.height();
- return eb >= wt - th && et <= wb + th;
- });
- loaded = inview.trigger("unveil");
- images = images.not(loaded);
- }
- $w.on("scroll.unveil resize.unveil lookup.unveil", unveil);
- unveil();
- return this;
- };
- })(window.jQuery || window.Zepto);
- $(document).ready(function () {
- var tmp = parseInt($('#xclicksvalue').attr('data-value'));
- if (tmp>0) {
- xclicksvalue=tmp;
- chartcounter=tmp;
- }
- smartphoneStartupTracks();
- resizeWidgets();
- $('.dkpw').each(function() {
- if (!$(this).is(":visible")) {
- $(this).html('');
- }
- } );
- $('.kwadtest').each(function() {
- $(this).parent().css('background-color','#dfdfdf');
- $(this).parent().html('Placeholder for advertising');
- });
- $('.freestar-iotest').each(function() {
- $(this).parent().css('background-color','#dfdfdf');
- $(this).parent().html('Placeholder for advertising');
- });
- var infocounter=0;
- $('.mdtest').each(function() {
- infocounter++;
- if(document.getElementById('gSxn2hs93hjs2hAhDRb')) {
- $(this).css('background-color','#dfdfdf');
- //$(this).css('height','100%');
- $(this).css('font-size','13px');
- $(this).html('<small>Placeholder for advertising:</small><br /><h2>'+$(this).attr('data-nx-container')+'</h2>');
- $(this).removeAttr("data-nx-container");
- var data = $(this).attr('data-twiago');
- if (typeof data !== 'undefined' && data) {
- var dat = data.split('|');
- if (parseInt(dat[0])>0 && parseInt(dat[1])>0 && parseInt(dat[2])>0) {
- $(this).css('width',parseInt(dat[0]));
- $(this).css('height',parseInt(dat[1]));
- $(this).removeAttr("data-twiago");
- $(this).removeClass('twiagoad');
- }
- }
- }
- else {
- $(this).css('background-color','#f7284b');
- $(this).css('color','#ffffff');
- $(this).css('height','100%');
- $(this).css('font-size','13px');
- $(this).removeAttr("data-nx-container");
- if (!isGoogle()) {
- $(this).html(adblock_txt);
- }
- else {
- $(this).html(adblock_txt2);
- }
- if (infocounter>=2) {
- return false;
- }
- }
- });
- $('ins').each(function() {
- try {
- (adsbygoogle = window.adsbygoogle || []).push({});
- }
- catch(err) {}
- });
- if($('#noadblock-info').attr('data-value') === 'true') {
- $('.md, .mdtest').hide();
- }
- a457c035a6dd2ca7c69(function(ret, triggerCode) {
- var adblocker = 'Unknown';
- if(ret) {
- adblocker = 'Enabled';
- var infocounter=0;
- $('.md').each(function() {
- infocounter++;
- $(this).css('background-color','#f7284b');
- $(this).css('color','#ffffff');
- $(this).css('height','100%');
- $(this).css('font-size','13px');
- $(this).removeAttr("data-nx-container");
- if (!isGoogle()) {
- $(this).html(adblock_txt);
- }
- else {
- $(this).html(adblock_txt2);
- }
- if (infocounter>=2) {
- return false;
- }
- });
- }
- else {
- adblocker = 'Disabled';
- }
- if(typeof ga !=='undefined'){
- ga('send', 'event', 'Adblocker', adblocker, 'Trigger-Code: ' + triggerCode, { nonInteraction: true});
- } else if(typeof _gaq !=='undefined'){
- _gaq.push(['_trackEvent','Adblocker',adblocker,'Trigger-Code: ' + triggerCode,undefined,true]);
- }
- //console.log({adblocker: adblocker, trigger: triggerCode, isAdblockInfoSite: $('#noadblock-info').attr('data-value') === 'true'});
- var urlpath = get_url_path();
- if (urlpath.length == 0) { urlpath = '/'; }
- if (adblocker === 'Enabled' && $('#stop-redirect').attr('data-value') !== 'true' && $('#noadblock-info').attr('data-value') !== 'true' && !isGoogle()) {
- if(location.href.indexOf('adpreview=true') !== -1)
- location.href = get_url_path()+'/site/adblockuser/'+triggerCode+'/?adpreview=true';
- else
- location.href = get_url_path()+'/site/adblockuser/'+triggerCode+'/';
- }
- else if (adblocker === 'Disabled' && $('#noadblock-info').attr('data-value') === 'true' && !isGoogle()) {
- if(location.href.indexOf('adpreview=true') !== -1)
- location.href = urlpath + '?adpreview=true';
- else
- location.href = urlpath;
- }
- else if($('#stop-redirect').attr('data-value') !== 'true' && checkCookie() === 'cookiefail' && !isGoogle()) {
- showCookieFail();
- }
- else if ($('#nocookies-info').attr('data-value') === 'true' && checkCookie() !== 'cookiefail' && !isGoogle()) {
- location.href = urlpath;
- }
- });
- moment.locale(displayLanguageLowerCase());
- var legendDate = $('#legende-date').text();
- $('#legende-date').text(moment(legendDate, getTimezoneFormat('date')).format(getTimezoneFormat('date', true)));
- checkOwnAds();
- setDropDownListener();
- setZoomListener();
- place_obs();
- resize_video();
- setShareListener();
- showOrHideOpenStreetMapInfo();
- checkHash();
- initSatTemp();
- initDatePicker();
- initTracks();
- initFloods();
- rdfcPrognose();
- initModelSwitcher();
- initVarSettings();
- initiOSzoomfix();
- loadingForecasts();
- initOpenDivs();
- setModelSelectorListener();
- setKlimaVergleichListener();
- setVhstationListener();
- setPhaenologieListener(true);
- $("img").unveil();
- if ($('#unwetterzentrale').attr('data-location') === 'true' && $('#unwetterzentrale').is(":visible")) {
- gps_locating_uwz();
- }
- $('.favtoggle').on('click', function() {
- if (favtoggle_status == 'show') {
- favtoggle_status = 'hide';
- }
- else {
- favtoggle_status = 'show';
- $('#myfavcontent').html(loadingMsg());
- if (checkCookie() === 'cookiefail') {
- $.get(get_url_path()+'/ajax/mylocationsmobile', {'nocookies':true}, function (data) { $('#myfavcontent').html(data);initiOSzoomfix();},'html');
- }
- else {
- $.get(get_url_path()+'/ajax/mylocationsmobile', {}, function (data) { $('#myfavcontent').html(data);initiOSzoomfix();},'html');
- }
- }
- });
- $('.close-addhistory').on('click', function(){
- addHistory(3);
- });
- $('.settings-close').on('click', function(){
- if ($('#settings-changed').attr('data-value') !== '0') {
- var tld = $('#settings-deftld').attr('data-value');
- $.get(get_url_path()+'/ajax/urlchanger', {
- 'location': location.href,
- 'tld': tld
- }, function (data) {
- if (data == location.href) {
- location.reload();
- }
- else if (data) {
- location.href = data;
- }
- },'html');
- }
- });
- if (History.Adapter) {
- History.Adapter.bind(window,'statechange',function(){
- var State = History.getState();
- if (State && no_reload == false) {
- location.reload();
- }
- no_reload = false;
- });
- setTimeout(function(){ no_reload = false; }, 1000);
- }
- $(window).resize(function() {
- resizeWidgets();
- place_obs();
- resize_video();
- Highcharts.charts.forEach(function(v,a,ar){v.reflow();});
- });
- if (displayCountry() !== 'de' && displayCountry() !== 'vh') {
- $(window).on('scroll', function() {
- var y=window.pageYOffset-$('#top-wrapper').offset().top+110; // 110px upper sticky boundary (top-wrapper offset to detect possible advert)
- if(y<35)y=35; // lower limit for top margin in non sticky case
- if(y>$('#top-wrapper')[0].clientHeight-$('.kw-ad-right')[0].clientHeight)
- y=$('#top-wrapper')[0].clientHeight-$('.kw-ad-right')[0].clientHeight; // upper limit for top-margin (aligned to top-wrapper)
- $('.kw-ad-right')[0].style.marginTop=y+"px";
- });
- }
- var server_response = $('#server-response').attr("data-value");
- if (server_response === 'unavailable') {
- messageLayer(503,'#error-msg','#error-modal');
- }
- else if (server_response === 'nologin') {
- messageLayer(513,'#error-msg','#error-modal');
- }
- else {
- var blitz = $('#blitz-id-start').attr("data");
- if (blitz) {
- $('#blitzortung').modal('show');
- showLgt(blitz,false);
- }
- var track_url = $('#track-url-start').attr("data");
- if (track_url) {
- $('#stormtracking').modal('show');
- showTrackDetailByURL(track_url, false);
- }
- var flood_url = $('#flood-url-start').attr("data");
- if (flood_url) {
- $('#stormtracking').modal('show');
- showFloodDetailByURL(flood_url, false);
- }
- var pollen = $('#pollen-id-start').attr("data");
- if (pollen) {
- $('#pollen_detail').modal('show');
- showPollen(pollen,false);
- }
- }
- $('.tldselect').on('click', function(e){
- e.preventDefault();
- $.get(get_url_path()+'/ajax/cookieset', {
- 'element_id': 'cs-tld',
- 'id' : $(this).attr('data-select')
- }, function(data) {
- if (data) {
- document.location.href = data;
- }
- });
- });
- if ($('#register-form-country').html()) {
- $('#register-form-hider').hide();
- $('#register-form-hider2').hide();
- $('#register-form-shower').show();
- }
- graphTabOnClick();
- plotGraph();
- plotGraphCompact();
- if(typeof ensemble_load != 'undefined')
- loadGraphEnsembleLong();
- else
- plotGraphEnsembleLong();
- $('[data-toggle="offcanvas"]').on('click', function () {
- $('.row-offcanvas').toggleClass('active')
- });
- hoverPopover();
- $('*[data-pocontent]').on('click', function() {
- var e=$(this);
- if (popover_status[$(this).data('pocontent')] == 'show') {
- e.popover('hide');
- }
- else {
- var poparams = {};
- if (checkCookie() == 'cookiefail' && e.data('pocontent') == 'mylocations') {
- poparams = {'nocookies':true};
- }
- e.popover({ 'html': true,
- 'placement': 'bottom',
- 'trigger':'manual',
- 'content': '<div id="poajax_'+e.data('pocontent')+'" style="min-width:246px;">'+loadingMsg()+'</div>',
- 'template': '<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-otitle"><a class="pointer poclose" onclick="popoverClose(\''+e.data('pocontent')+'\');"><span class="popover-otclose">×<span></a><h3 class="popover-title"></h3></div><div class="popover-content"></div></div>'
- }).popover('show');
- $.get(get_url_path()+'/ajax/'+e.data('pocontent'),poparams, function(d) {
- $('#poajax_'+e.data('pocontent')).html(d);
- },'html');
- }
- });
- $('*[data-pocontent]').on('show.bs.popover', function() {
- popover_status[$(this).data('pocontent')] = 'show';
- });
- $('*[data-pocontent]').on('hide.bs.popover', function() {
- popover_status[$(this).data('pocontent')] = 'hide';
- });
- $('[data-toggle="tooltip"]').tooltip();
- $('#kachelmann-faq h5>a').on("click", function(e){
- var url = $(this).attr('href');
- setTimeout(function(){$('#kachelmann-faq .in').removeClass('in');},300);
- if($(this).attr('data-faq') && $(this).attr('data-target')) {
- var obj = $($(this).attr('data-target')+'>div');
- if (obj.html() === '...') {
- obj.html('Wird geladen!');
- $.get(get_url_path()+'/ajax/faqs', {
- 'faqid': $(this).attr('data-faq')
- }, function (data) {
- obj.html(data);
- if (url) {
- pushHistory(url);
- }
- },'html');
- }
- }
- e.preventDefault();
- });
- $('.source-marker').on("click", function(e){
- $('#'+$(this).attr('data-id')).select();//.select();
- e.preventDefault();
- });
- $('#forecast-form-0').on('submit', function(e) {
- e.preventDefault();
- forecast_search0();
- });
- $('#forecast-form-1').on('submit', function(e) {
- e.preventDefault();
- forecast_search1();
- });
- }).on("keydown", function(e) {
- var model_val = $('#model').val();
- if (typeof model_val !== 'undefined') {
- if(keydown==0){
- keydown=1;
- if ((e.which || e.keyCode) == 116) refresh(e);
- var model = $('#model-flag').val()
- if (model) { // support cursor keys (reversed direction in model section)
- if ((e.which || e.keyCode) == 39) model_hour_prev();
- if ((e.which || e.keyCode) == 37) model_hour_next();
- if ((e.which || e.keyCode) == 40) model_member_next(e);
- if ((e.which || e.keyCode) == 38) model_member_prev(e);
- }
- else{
- if ((e.which || e.keyCode) == 37) model_hour_prev();
- if ((e.which || e.keyCode) == 39) model_hour_next();
- }
- }
- }
- if(((e.which || e.keyCode) == 39 || (e.which || e.keyCode) == 37) && $('#weather-fccompact-page').length >=1) {
- var availableModels = $('.mod-fc-essentials');
- var currentSelectedIndex = availableModels.index(availableModels.filter('.btn-active'));
- if(currentSelectedIndex === -1) return;
- var nextSelectedIndex = currentSelectedIndex;
- if ((e.which || e.keyCode) == 39) nextSelectedIndex++;
- if ((e.which || e.keyCode) == 37) nextSelectedIndex--;
- if(nextSelectedIndex >= availableModels.length)
- nextSelectedIndex = 0;
- if(nextSelectedIndex < 0)
- nextSelectedIndex = availableModels.length - 1;
- availableModels.get(nextSelectedIndex).click();
- }
- });
- $(document).on("keyup", function(e){keydown=0;});
- var forecast_search0 = function () {
- if (forecast_search_setting(0)) {
- $('#forecast-form-0').off('submit');
- $('#forecast-form-0').submit();
- }
- };
- var wetter_search0 = function () {
- $('#forecast-form-0').submit();
- };
- var forecast_search_setting = function(id) {
- var tab = $('#tab-url').attr("data-src");
- if (typeof tab !== 'undefined') {
- $('#forecast-tab-'+id).val(tab);
- }
- var model = $('#forecast-model').val();
- var action = $('#forecast-action-'+id).val();
- if (typeof action !== 'undefined' && action) {
- var tmp = action.split('#');
- if (typeof model !== 'undefined' && model) {
- $('#forecast-action-'+id).val(tmp[0].replace("kompakt1x1","kompakt")+'#'+model);
- }
- }
- /*else {
- $('#forecast-action-'+id).val(tmp[0]);
- }*/
- return true;
- };
- var forecast_search1 = function () {
- if (forecast_search_setting(1)) {
- $('#forecast-form-1').off('submit');
- $('#forecast-form-1').submit();
- }
- };
- var wetter_search1 = function () {
- $('#forecast-form-1').submit();
- };
- var forecast_search_nav = function () {
- $('#forecast-form-nav').submit();
- };
- var forecast_search_fav = function () {
- $('#forecast-form-fav').submit();
- };
- var setShareListener = function() {
- $('.mouse-overlay').hide();
- $('#content-image').hover(
- function(){
- $('.mouse-overlay').show();
- },
- function(){
- $('.mouse-overlay').hide();
- }
- );
- };
- var setModelSelectorListener = function() {
- $('.mod-fc').off('click').
- on('click', function(e) {
- $('#forecast-model').val($(this).attr('data-value'));
- e.preventDefault();
- forecastModel();
- });
- $('.mod-fc-trend').off('click').
- on('click', function(e) {
- $('#forecast-model').val($(this).attr('data-value'));
- e.preventDefault();
- forecastModelTrend();
- });
- $('.mod-fc-switch').off('click').
- on('click', function(e) {
- e.preventDefault();
- switchForecast($(this).attr('data-out'));
- });
- /*$('.mod-fc-essentials').off('click').
- on('click', function(e) {
- e.preventDefault();
- $('#forecast-model').val($(this).attr('data-value'));
- forecastModelEssentials();
- });*/
- $('.mod-fc-ensemble').off('click').
- on('click', function(e) {
- e.preventDefault();
- $('#forecast-model').val($(this).attr('data-value'));
- forecastModelEnsemble();
- });
- };
- var setZoomListener = function() {
- $('#click-overlay').off('click').
- on('click', function(e) {
- model_player_stop();
- images=[]; // clear buffers for preloading loop images
- loaded_image_sources=[];
- images_loaded=0; // reset loader
- loading=0;
- images_extend=1;
- //closeMarker();
- var left = parseInt($('#top-wrapper').position().left);
- var top = parseInt($('#top-wrapper').position().top)+get_abstandY();
- var factor = 760 / (parseInt(getImageWidth())+1);
- var params = {
- 'posX' : Math.round((e.pageX-($('#content-image').position().left+get_abstand())-left)*factor),
- 'posY' : Math.round((e.pageY-($('#content-image').position().top)-top)*factor),
- 'area_id' : get_selected_area(),
- 'area_hierarchy' : get_area_hierarchy(),
- 'model' : $('#model').val(),
- 'model_valid' : $('#model-valid').val(),
- 'model_run' : $('#model-run').val(),
- 'model_param' : $('#model-param').val(),
- 'model_location' : $('#model-location').val(),
- 'model_member' : $('#model-member').val(),
- 'geo_lat' : $('#geo-lat').val(),
- 'geo_long' : $('#geo-long').val(),
- 'fl_newest' : $('#newest-flag').val(),
- 'fl_param' : $('#param-flag').val(),
- 'fl_model' : $('#model-flag').val(),
- };
- if ($('#model').val() === 'blitze' && $('#blitze-5minonly').prop('checked')) {
- params.blitze_5minonly = 'true';
- }
- if ($('#model').val() === 'cyclone') {
- params.model_filter_storm = $('#model-filter-storm').val();
- }
- //$('.lp_param').html($('.container').width()+' left: '+$('#content-image').position().left+' top:'+$('#content-image').position().top+' factor: '+factor+' posX:'+Math.round((e.pageX-($('#content-image').position().left+get_abstand())-left)*factor)+ ' posY:'+Math.round((e.pageY-($('#content-image').position().top)-top)*factor));
- ajaxLoaderShowDelay();
- $.post(get_url_path()+'/ajax/zoomall', params, function (data) {
- ajaxLoaderHide();
- if (data === 'SURVIVAL') {
- messageLayer(101,'#error-msg','#error-modal');
- }
- else if (data === 'NOT_ALLOWED') {
- messageLayer(403,'#error-msg','#error-modal');
- }
- else if (data === 'UNAVAILABLE') {
- messageLayer(503,'#error-msg','#error-modal');
- }
- else if (data !== 'FALSE') {
- if (data === 'not_allowed') {
- messageLayer(102,'#error-msg','#error-modal');
- }
- else {
- $('#drop-downs').html(data);
- setDropDownListener();
- changeImage();
- showOrHideOpenStreetMapInfo();
- place_obs();
- reloadIframeAds();
- initDatePicker();
- initOpenDivs();
- }
- }
- },'html');
- }
- );
- };
- var getImageWidth = function() {
- return $('#click-overlay').width();
- }
- var zoom_out = function() {
- model_player_stop();
- images=[]; // buffers for preloading loop images
- loaded_image_sources=[];
- images_loaded=0;
- loading=0;
- var areas = getAreaArray();
- ajaxLoaderShowDelay();
- $.post(get_url_path()+'/ajax/zoomout', {
- 'area_id' : get_selected_area(),
- 'areas_1' : areas[1],
- 'areas_2' : areas[2],
- 'areas_3' : areas[3],
- 'areas_4' : areas[4],
- 'areas_5' : areas[5],
- 'areas_6' : areas[6],
- 'areas_7' : areas[7],
- 'areas_8' : areas[8],
- 'areas_9' : areas[9],
- 'model' : $('#model').val(),
- 'model_param' : $('#model-param').val(),
- 'model_location' : $('#model-location').val(),
- 'model_valid' : $('#model-valid').val()
- }, function (data) {
- ajaxLoaderHide();
- if (data === 'not_allowed') {
- messageLayer(103,'#error-msg','#error-modal');
- }
- else if (data === 'NOT_ALLOWED') {
- messageLayer(403,'#error-msg','#error-modal');
- }
- else if (data === 'UNAVAILABLE') {
- messageLayer(503,'#error-msg','#error-modal');
- }
- else {
- findAndSetArea(get_selected_area());
- //closeMarker();
- refreshDropdowns();
- }
- },'html');
- };
- var findAndSetArea = function(area_id) {
- var fieldname = '';
- var counter = 0;
- for (i=1;i<=9;i++) {
- counter = counter * 1000;
- fieldname = '#form-areaid-'+i;
- $(fieldname+' option').each(function(){
- counter++;
- if (parseInt($(this).attr('value')) === parseInt(area_id) && counter > 1000) {
- $(fieldname).val('0');
- return fieldname;
- }
- });
- }
- };
- var cookieSettings = function() {
- $('#settings-msg').html(loadingGif());
- $('#settings-modal').modal('show');
- var poparams = {};
- if (checkCookie() == 'cookiefail') {
- poparams = {'nocookies':true};
- }
- $.get(get_url_path()+'/ajax/settings', poparams, function(data) {
- $('#settings-msg').html(data);
- $('#cookie-settings-form select').off('change').
- on('change', function(e) {
- cookiesave($(this).attr('id'));
- e.preventDefault();
- }
- );
- },'html');
- };
- var cookiesave = function(element_id) {
- var value = $('#'+element_id).val();
- if (typeof value !== 'undefined' && typeof element_id !== 'undefined') {
- $.get(get_url_path()+'/ajax/cookieset', {
- 'element_id': element_id,
- 'id' : value
- }, function(data) {
- if (element_id === 'cs-tld') {
- $('#settings-deftld').attr('data-value',value);
- }
- $('#settings-changed').attr('data-value','1');
- });
- }
- return false;
- };
- var loadingGif = function() {
- var loadingImageURL = $('#loading-image-url').attr('data-value');
- if (typeof loadingImageURL === 'undefinded' || !loadingImageURL) {
- loadingImageURL = '/images/ajax-loader.gif';
- }
- return '<p style="text-align:center;margin-top:10px;"><img src="'+loadingImageURL+'" alt="Loading" /></p>';
- };
- var radarus_is_dyn = function(param) {
- if (typeof param === 'undefined') {
- param = $('#model-mode').val();
- }
- return (param === 'RADARUS_DYN' || param === 'RADARUS_DYN_HI' || param === 'RADARUS_DYN_AK' || param === 'RADARUS_DYN_NC');
- };
- var setDropDownListener = function() {
- $('#drop-downs select').off('change').
- on('change', function() {
- //closeMarker();
- if ($(this).attr('id') !== 'model-player-interval') {
- refreshDropdowns(null, null, null, null, $(this));
- }
- }
- );
- $('#drop-downs select').off('focus').
- on('focus', function() {
- //model_player_stop();
- }
- );
- setElementHiders();
- setAccListener();
- $('#blitze-5minonly').off('change').on('change', function(e){e.preventDefault();lightning5min();});
- initAutoRefresh();
- };
- var closeAccLayer = function (obj) {
- var id = obj.attr('id');
- $('[data-id='+id+']').each(
- function() {
- if ($(this).hasClass('acc-btn-on')) {
- $(this).addClass('acc-btn-active');
- }
- else {
- $(this).removeClass('acc-btn-active');
- }
- }
- );
- obj.slideUp();
- }
- var closeAcc2Layer = function (obj) {
- var id = obj.attr('id');
- $('.acc2-layer').each(
- function() {
- if ($(this).hasClass('acc2-btn-active')) {
- $(this).removeClass('acc2-btn-active');
- }
- }
- );
- obj.slideUp();
- }
- var openAccLayer = function (obj) {
- var id = obj.attr('data-id');
- $('[data-id='+id+']').each(
- function() {
- if ($(this).hasClass('acc-btn-on')) {
- $(this).removeClass('acc-btn-active');
- }
- else {
- $(this).addClass('acc-btn-active');
- }
- }
- );
- $('#'+id).slideDown();
- scrollTopParam();
- }
- var openAccLayerDirect = function (obj) {
- var id = obj.attr('data-id');
- $('[data-id='+id+']').each(
- function() {
- if ($(this).hasClass('acc-btn-on')) {
- $(this).removeClass('acc-btn-active');
- }
- else {
- $(this).addClass('acc-btn-active');
- }
- }
- );
- $('#'+id).show();
- scrollTopParam();
- }
- var scrollTopParam = function() {
- var scrolling = $('#ac-id-param').offset();
- var start = $('#param-autoscroll-all').offset();
- if (typeof scrolling !== 'undefined' && typeof start !== 'undefined') {
- //alert(start.top + ' ' + scrolling.top);
- $('#param-autoscroll-all').animate({scrollTop:scrolling.top-start.top}, 0);
- }
- }
- var openAcc2Layer = function (obj) {
- var id = obj.attr('data-id');
- var previousVisibleLayer = $('.acc2-btn-active').next('.acc2-layer:visible');
- $('.acc2-layer').each(
- function() {
- if ($(this).hasClass('acc2-btn-active')) {
- $(this).removeClass('acc2-btn-active');
- }
- }
- );
- obj.addClass('acc2-btn-active');
- $('#'+id).slideDown();
- //Die angeklickte Kategorie nach oben scrollen, so dass sie nicht außerhalb des sichtbaren Bereichs ist
- var parentContainer = obj.closest('div');
- var offsetTop = parentContainer.offset().top;
- var scrollOffsetTop = $('#param-autoscroll-all').offset().top;
- var scrollTop = $('#param-autoscroll-all').scrollTop();
- var previousHeight = 0;
- if(previousVisibleLayer.length > 0 && previousVisibleLayer.offset().top < offsetTop)
- previousHeight = previousVisibleLayer.height();
- $('#param-autoscroll-all').animate({scrollTop: scrollTop - (scrollOffsetTop - offsetTop) - previousHeight}, 400);
- }
- var setAccListener = function() {
- $('.acc-btn').off('click').
- on('click', function(e) {
- e.preventDefault();
- var id = $(this).attr('data-id');
- if ($(this).hasClass('acc-btn-on') && $('#'+id).is(":visible")) {
- $('.acc-layer').each(function() {
- if ($(this).is(":visible")) {
- closeAccLayer($(this));
- }
- });
- open_dd_div1 = '';
- }
- else if ($(this).hasClass('acc-btn-on') && !$('#'+id).is(":visible")) {
- $('.acc-layer').each(function() {
- if ($(this).is(":visible") && $(this).attr('data-id') !== id) {
- closeAccLayer($(this));
- }
- });
- openAccLayer($(this));
- open_dd_div1 = id;
- }
- else {
- $('.acc-layer').each(function() {
- if ($(this).is(":visible")) {
- closeAccLayer($(this));
- }
- });
- open_dd_div1 = '';
- }
- }
- );
- $('.acc2-btn').off('click').
- on('click', function(e) {
- e.preventDefault();
- var id = $(this).attr('data-id');
- if ($('#'+id).is(":visible")) {
- $('.acc2-layer').each(function() {
- if ($(this).is(":visible")) {
- closeAcc2Layer($(this));
- }
- });
- open_dd_div2 = '';
- }
- else {
- console.log(2);
- $('.acc2-layer').each(function() {
- if ($(this).is(":visible") && $(this).attr('data-id') !== id) {
- closeAcc2Layer($(this));
- }
- });
- openAcc2Layer($(this));
- open_dd_div2 = id;
- }
- }
- );
- $('.ac-btn').off('click').
- on('click', function(e) {
- e.preventDefault();
- var tabid = $(this).parents('.tab-pane').attr('id');
- if (typeof tabid !== 'undefined' && tabid) {
- if (tabid === 'tab-param-top' || tabid === 'tab-param-daily' || tabid === 'tab-param-all' || tabid === 'tab-param-ens' || tabid === 'tab-param-prob' || tabid === 'tab-param-spagh' || tabid === 'tab-param-meta') {
- open_dd_tab_params=tabid;
- }
- if (tabid === 'tab-dates-date' || tabid === 'tab-dates-hour') {
- open_dd_tab_valids=tabid;
- }
- if (tabid === 'tab-models-all' || tabid === 'tab-models-switch' || tabid === 'tab-models-archive') {
- open_dd_tab_models=tabid;
- }
- }
- if (checkChartcounter()) {
- var model = $(this).attr('data-model');
- if (isModelCard(model)) {
- return switch2model(model);
- }
- var id = $(this).attr('data-id');
- var value = $(this).attr('data-value');
- var jqobj = $('#'+id).val();
- if (typeof jqobj !== 'undefined' && typeof value !== 'undefined') {
- $('#'+id).val(value);
- return refreshDropdowns(null,null,null,null,$('#'+id));
- }
- }
- //alert('test');
- });
- $('.ac-btn-disabled').off('click').
- on('click', function(e) {
- e.preventDefault();
- });
- $('.pay-btn-disabled').off('click').
- on('click', function(e) {
- e.preventDefault();
- showExtraNotice();
- $('#faq-modal').modal('show');
- });
- $('.valid-btn').off('click').
- on('click', function(e) {
- e.preventDefault();
- var id = $(this).attr('data-value');
- if (id) {
- if ($('.valid-btn').hasClass("btn-active")) {
- $('.valid-btn').removeClass("btn-active");
- }
- $(this).addClass("btn-active");
- open_dd_valids = id;
- $('.valids-all').hide();
- $('.valids-all').addClass('valids-hide');
- $('.'+id).show();
- $('.'+id).removeClass('valids-hide');
- }
- });
- $('.btn-fc-neighbour').off('click').
- on('click', function() {
- var new_loc=$(this).attr('data-value');
- var old_loc=$('#forecast-loc').attr('data-value');
- var new_url = $('#forecast-url').attr("data");
- if (typeof new_url !== 'undefined') {
- new_url = new_url.replace(old_loc, new_loc);
- var tab = $('#tab-url').attr("data-src");
- if (tab) {
- new_url = new_url+'/'+tab;
- }
- goto(new_url);
- }
- });
- $('.btn-fc-tab').off('click').
- on('click', function() {
- var new_loc=$(this).attr('data-value');
- var old_loc=$('#forecast-loc').attr('data-value');
- var new_url = $('#forecast-url').attr("data");
- if (typeof new_url !== 'undefined') {
- new_url = new_url.replace(old_loc, new_loc);
- if (new_url.indexOf('/kompakt') >= 0) {
- new_url = new_url+'/'+$('#forecast-model').val();
- }
- var tab = $('#tab-url').attr("data-src");
- if (tab) {
- if (new_url.indexOf('/ensemble') >= 0 || new_url.indexOf('/xl') >= 0 ) {
- new_url = new_url+'/'+$('#forecast-model').val();
- }
- new_url = new_url+'/'+tab;
- }
- //console.log(new_url);
- goto(new_url);
- }
- });
- $('.btn-map-gps').off('click').
- on('click', function() {
- $('.btn-map-gps').removeClass('tab-current');
- $(this).addClass('tab-current');
- var lat=$(this).attr('data-lat');
- var long=$(this).attr('data-long');
- set_to_latlong(lat,long);
- });
- $('.switch-map').off('click').
- on('click', function(e) {
- e.preventDefault();
- if (checkChartcounter()) {
- var params = {
- 'switcher': 'grid',
- 'model' : $('#model').val(),
- 'model_valid' : $('#model-valid').val(),
- 'model_member' : $('#model-member').val(),
- 'model_run' : $('#model-picked-date').val(),
- 'model_param' : $('#model-param').val(),
- 'model_location' : $('#model-location').val(),
- 'area_id': get_selected_area(),
- 'geo_lat' : $('#geo-lat').val(),
- 'geo_long' : $('#geo-long').val()
- };
- if ($(this).hasClass('map-country')) {
- params.switcher = 'country';
- }
- refreshDropdowns(false, false, params);
- }
- });
- if ($('#animation-player-mobile').is(':visible')) {
- var html = $('#animation-player-mobile').html();
- if (typeof html !== 'undefined' && html.length === 0) {
- $('#animation-player-mobile').html($('#animation-player-desktop').html());
- $('#animation-player-desktop').html('');
- }
- }
- else {
- $('#animation-player-mobile').html('');
- }
- if ($('#animation-player-desktop').is(':visible')) {
- var html = $('#animation-player-desktop').html();
- if (typeof html !== 'undefined' && html.length === 0) {
- $('#animation-player-desktop').html($('#animation-player-mobile').html());
- $('#animation-player-mobile').html('');
- }
- }
- else {
- $('#animation-player-desktop').html('');
- }
- }
- var get_selected_area = function(jqobj) {
- var area_id = 0;
- for (i=1;i<=10;i++) {
- fieldname = '#form-areaid-'+i;
- if ($(fieldname).val() && parseInt($(fieldname).val()) > 0) {
- area_id = $(fieldname).val();
- if (jqobj && '#'+jqobj.attr('id') === fieldname) {
- break;
- }
- }
- else {
- break;
- }
- }
- return area_id;
- };
- var get_area_hierarchy = function() {
- var area_id = new Array(10);
- for (i=1;i<=10;i++) {
- fieldname = '#form-areaid-'+i;
- if ($(fieldname).val() && parseInt($(fieldname).val()) > 0) {
- area_id[i-1] = $(fieldname).val();
- }
- else {
- break;
- }
- }
- return area_id;
- };
- var get_selected_model_path = function() {
- if ($('#model').val()==='px250' || $('#model').val()==='px250blau' || $('#model').val()==='wwanalyze' || $('#model').val()==='radar'|| $('#model').val()==='radarus' || $('#model').val()==='radarde' || $('#model').val()==='radarpre' || $('#model').val()==='singlepx' || $('#model').val()==='plraw' || $('#model').val()==='storms' || $('#model').val()==='floods' || $('#model').val()==='pl' || $('#model').val()==='blitze' || $('#model').val()==='regen' || $('#model').val()==='hagel' || $('#model').val()==='radial' || $('#model').val()==='sweeps' || $('#model').val()==='radar3d' || $('#model').val()==='zsweeps' || $('#model').val()==='sat') {
- var model = $('#model-valid').val();
- var formModel = model.split('/');
- var run_hour = formModel[1];
- var run_date = formModel[0].split('-');
- var ret = new Array(2);
- ret[0] = run_date[0]+'_'+run_date[1]+'_'+run_date[2];
- ret[1] = run_hour;
- return ret;
- }
- var model = $('#model-run').val();
- if (typeof model === 'undefined') {
- return '';
- }
- else {
- var formModel = model.split('/');
- var run_hour = formModel[1];
- var run_date = formModel[0].split('-');
- return run_date[0]+'_'+run_date[1]+'_'+run_date[2]+'_'+run_hour;
- }
- };
- var get_model_image_path = function(satdl, set_model, set_param, set_model_valid, set_location) {
- var area = get_selected_area();
- var model = $('#model').val();
- if (model === 'modvhshd') {
- return false;
- }
- if (typeof set_model !== 'undefined') {
- model = set_model;
- }
- var model_param = $('#model-param').val();
- if (typeof set_param !== 'undefined') {
- model_param = set_param;
- }
- var model_valid = $('#model-valid').val();
- if (typeof set_model_valid !== 'undefined') {
- model_valid = set_model_valid;
- }
- if (model_valid && model === 'cyclone') {
- var filter_storm = $('#model-filter-storm').val();
- if (typeof filter_storm !== 'undefined' && filter_storm) {
- filter_storm = filter_storm + '-'
- }
- else {
- filter_storm = '';
- }
- var param = $('#model-param').val();
- return extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+$('#model-selector').val()+'_'+$('#model-run').val()+'_'+area+'_'+param+'_'+filter_storm+$('#model-valid').val()+'.png');
- }
- else if (model_valid) {
- var formModel = model_valid.split('/');
- var run_hour = formModel[1];
- var run_date = formModel[0].split('-');
- if (model.substring(0,3) !=='mod') {
- var datum = run_date[0]+'_'+run_date[1]+'_'+run_date[2];
- var uhrzeit = run_hour;
- datum = datum.replace(/-/g, "_");
- uhrzeit = uhrzeit.replace(/:/g, "_");
- }
- if (model === 'radarpre') {
- uhrzeit = uhrzeit.replace(/_/g, "");
- var futuremin = '000';
- if (formModel[2]) {
- futuremin = formModel[2];
- }
- if ($('#model-valid-fcspecial').val() == 'RADARAT_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- if ($('#model-valid-fcspecial').val() == 'RADARCH_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- if ($('#model-valid-fcspecial').val() == 'RADARNL_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- return extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+uhrzeit+'_'+futuremin+'.png');
- }
- else if (model === 'px250' || model === 'px250blau' || model === 'wwanalyze' || model === 'radarde' || model === 'radar' || model === 'singlepx' || model === 'pl' || model === 'plraw' || model === 'blitze'
- || (model === 'radarus' && $('#model-mode').val() === 'RADARUS')) {
- uhrzeit = uhrzeit.replace(/_/g, "");
- return extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+uhrzeit+'.png');
- }
- else if (model === 'radarus' && $('#model-mode').val() === 'RADARUS_PARAM') {
- uhrzeit = uhrzeit.replace(/_/g, "");
- return extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+model_param+'_'+uhrzeit+'.png');
- }
- else if (model === 'radarus') {
- uhrzeit = uhrzeit.replace(/_/g, "");
- var model_location = $('#model-location').val();
- if (typeof set_location !== 'undefined') {
- model_location = set_location;
- }
- return extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+model_location+'_'+model_param+'_'+uhrzeit+'.png');
- }
- else if (model === 'hagel') {
- return extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit+'_'+area+'_'+model_param+'.png');
- }
- else if (model === 'sat' || model === 'globus') {
- if (satdl === 'PNG') {
- return extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit+'_'+area+'_'+model_param+'.png');
- }
- else {
- return extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit+'_'+area+'_'+model_param+'.jpg');
- }
- }
- else if (isModelCard(model)) {
- var selected_index = $('#model-valid').prop("selectedIndex");
- $('#model-valid-hidden').prop("selectedIndex", selected_index);
- var model_valid_hidden = $('#model-valid-hidden').val();
- var model_member = $('#model-member').val();
- var member_string = '';
- if (typeof model_member !== 'undefined' && model_member.length>0 && parseInt(model_member)>=0) {
- member_string = '_m'+model_member;
- }
- var run_date = model_valid_hidden.split('#');
- var lang = '';
- if (model_param == 155 || model_param == 213 || model_param == 352 || model_param == 353) {
- lang = '-'+displayLanguage().toString().toLowerCase();
- }
- var modelstring = 'model';
- if (model === 'modezseason') {
- modelstring = 'season';
- }
- else if (model === 'modezwkly') {
- modelstring = 'weekly';
- }
- return extServer(url_path+'/images/data/cache/'+modelstring+'/'+modelstring+lang+'_'+model+'_'+run_date[0]+'_'+run_date[1]+'_'+area+'_'+model_param+member_string+'.png');
- }
- else {
- var axel = Math.random() + "";
- var num = axel * 1000000000000000000;
- var returnurl = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit+'_'+area+'_'+model_param+'.png');
- if (isObsMode(model)) {
- returnurl = returnurl + '?'+num;
- }
- return returnurl;
- }
- }
- };
- var get_model_overlay_path = function(trans) {
- var domain = '';
- if (trans === 'zz') {
- domain = $('#overlay-nonames').attr('data-value');
- }
- else {
- domain = $('#overlay-withnames').attr('data-value');
- }
- var area = get_selected_area();
- if (area === 500000000 || area == 500000001 || area == 500000002) {
- area = 2;
- }
- var path = Math.floor(area/100)*100;
- return domain+path+'/'+area+'.png';
- };
- var changeImage = function() {
- replaceOverlay();
- replaceImage();
- initSatTemp();
- addHistory();
- };
- var replaceOverlay = function() {
- if ($('#model').val() !== 'globus' && $('#model').val() !== 'plraw') {
- $('.map-overlay>img').attr('src', get_model_overlay_path('zz'));
- $('.map-overlay-trans>img').attr('src', get_model_overlay_path(displayCountry()));
- }
- initVarSettings();
- };
- var showOrHideOpenStreetMapInfo = function() {
- showHide('#odbl_visibility','#odbl', 'hide');
- showHide('#model_image_visibility','#model-image', 'show');
- var show = $('#legends_visibility').attr('data');
- if ( show === 'PX250' || show === 'RADARDE' || show === 'RADAR' || show === 'RADAR_CH' || show === 'RADAR_AT' || show === 'RADARNL' || show === 'RADAR_SWE_PRO' ||
- show === 'RADAR_ESTONIA' || show === 'NORWAY_RR' || show === 'FINLAND_DBZH_COMPOSITE' || show === 'UK_RAINRATE' || show === 'SLOVENIA_RR' || show === 'RADAR_SOUTHTYROL' || show === 'RADAR_FRANCE' ||
- show === 'PL' || show === 'PLRAW' || show === 'PLRAW_DE' || show === 'PL_AT' || show === 'PL_NOL' || show === 'PL_AT_NOL' ||
- show === 'FLOODS' || show === 'FLOODWARNAT' || show === 'STORMS' || show === 'STORMSAT' ||
- show === 'RADARSD' || show === 'PLDBZ' || show === 'RADIAL' || show === 'SWEEPS' || show === 'ZSWEEPS' ||
- (show && isObsMode($('#model').val())) ||
- //show === 'HAIL' || show === 'HAIL_AT' || show === '685' || show === '686' || show === '687' || show === '688' || show === '689' || show === '690' ||
- $('#model').val() === 'hagel' ||
- show === 'BLITZWORLD' || show === 'BLITZE' ||
- (show && $('#model').val() == 'regen')) {
- $('#scale-overlay>img').attr('src', scalePath()+show+'.png');
- }
- };
- var showHide = function(id_data, id_image, toggle) {
- var show = $(id_data).attr('data');
- if(show === toggle) {
- $(id_image).hide();
- }
- else {
- $(id_image).show();
- }
- };
- var replaceImage = function(refresh) {
- var model = $('#model').val();
- if (model === 'modvhshd' || model === 'modvhrpd' || model === 'modvhez' || model === 'modvhezwkly' || model === 'modvhanalyze' || model === 'modvhsoil') {
- var lang = displayLanguage().toString().toLowerCase();
- var width = 600;
- var height = 100;
- var mode = $('#acc-layer-model .btn-active').data('model');
- var param = $('#model-param option:selected').val();
- $('#legend').attr('src', '/images/modelscale/'+lang+'/'+mode+'/'+param+'_'+width+'_'+height+'.png');
- return false;
- }
- var image = get_model_image_path();
- var areas = getAreaArray();
- var area_id = get_selected_area();
- var leer = url_path+'/images/overlay/trans.png';
- if (model === 'storms' || model === 'floods') {
- var hidden_model = $('#hidden-model').val();
- if (hidden_model === 'empty') {
- $('#model-image>img').attr('src',leer);
- $('#tstorm-image>img').attr('src',leer);
- $('#stormtrack-image>img').attr('src',image);
- }
- else if (hidden_model == 'pl') {
- $('#model-image>img').attr('src',get_model_image_path('',hidden_model));
- if ($('#hide-lightning-image').attr('data-value') !== 'false') {
- $('#tstorm-image>img').attr('src',get_model_image_path('',hidden_model).replace(/pl/g,"tstorm"));
- }
- $('#stormtrack-image>img').attr('src',image);
- }
- else if (hidden_model == 'px250blau') {
- $('#model-image>img').attr('src',get_model_image_path('',hidden_model));
- if ($('#hide-lightning-image').attr('data-value') !== 'false') {
- $('#tstorm-image>img').attr('src',get_model_image_path('',hidden_model).replace(/px250blau/g,"tstorm"));
- }
- $('#stormtrack-image>img').attr('src',image);
- }
- else {
- var tmp = hidden_model.split("#");
- if (parseInt(tmp[1]) > 0) {
- $('#model-image>img').attr('src',get_model_image_path('',tmp[0], tmp[1]));
- }
- else {
- $('#model-image>img').attr('src',get_model_image_path('',tmp[0]));
- }
- $('#tstorm-image>img').attr('src',leer);
- $('#stormtrack-image>img').attr('src',image);
- }
- }
- else if (model !== 'blitze' && !isObsMode(model)) {
- $('#model-image>img').attr('src', image);
- $('#stormtrack-image>img').attr('src',leer);
- }
- else {
- $('#stormtrack-image>img').attr('src',leer);
- }
- if (model === 'pl' && $('#hide-lightning-image').attr('data-value') !== 'false') {
- $('#tstorm-image>img').attr('src', image.replace(/pl/g,"tstorm"));
- }
- else if (model !== 'storms' && model !== 'floods') {
- $('#tstorm-image>img').attr('src',leer);
- }
- var params = {
- 'model' : $('#model').val(),
- 'model_run' : $('#model-run').val(),
- 'model_param' : $('#model-param').val(),
- 'model_location' : $('#model-location').val(),
- 'image_width' : $('#map-overlay').width(),
- 'model_member' : $('#model-member').val(),
- 'area_id' : area_id,
- 'areas_1' : areas[1],
- 'areas_2' : areas[2],
- 'areas_3' : areas[3],
- 'areas_4' : areas[4],
- 'areas_5' : areas[5],
- 'areas_6' : areas[6],
- 'areas_7' : areas[7],
- 'areas_8' : areas[8],
- 'areas_9' : areas[9],
- 'real_refresh' : 0
- };
- if (refresh !== true) {
- params.model_valid = $('#model-valid').val();
- }
- if (isModelCard(model)) {
- params.mvh = $('#model-valid-hidden').val();
- }
- if (is_playing !== 1) {
- $.get(get_url_path()+'/ajax/legende', params
- , function (data) {
- $('#text-overlay').html(data);
- place_obs();
- var model = $('#model').val();
- $('#copyright_text').html('');
- if (model ==='radarus') {
- if ($('#legends_visibility').attr('data') === 'RADARUS_COMP') {
- $('#scale-overlay>img').attr('src', scalePath()+"RADARUS_COMP.png");
- }
- else if (radarus_is_dyn() || ($('#model-mode').val() === 'RADARUS_PARAM' && $('#model-param').val() !== '358' && $('#model-param').val() !== '432')) {
- replaceScale();
- }
- else {
- $('#scale-overlay>img').attr('src', scalePath()+"RADARUS.png");
- }
- }
- else if (model==='regen' || model==='blitze' || model==='pl' || model==='cyclone' || isObsMode(model) ||
- model === 'sat' || model === 'globus' || isModelCard(model)) {
- replaceScale();
- }
- else if (model === 'px250') {
- var text = $('#copyright_hidden').attr('data');
- if (!text) { text=''; }
- $('#copyright_text').html(text);
- }
- if ((model === 'blitze' || isObsMode(model)) && $('#model_image_visibility').attr('data') !== 'show') {
- $('#model-image>img').attr('src', image);
- }
- var legendDate = $('#legende-date').text();
- $('#legende-date').text(moment(legendDate, getTimezoneFormat('date')).format(getTimezoneFormat('date', true)));
- initTracks();
- initFloods();
- rdfcPrognose();
- lightning5min();
- setTimeout(checkLoader,300);
- hoverPopover();
- });
- }
- else {
- var model_run = $('#model-run').val().split("-");
- $('#legende-date').html(model_run[2]+'.'+model_run[1]+'.'+model_run[0]);
- $('#legende-time').html($('#model-valid').val());
- }
- };
- var checkLoader=function(){
- var loader=$('#model-image>img')[0];
- if (typeof loader !== 'undefined') {
- if(!$('#model-image>img')[0].complete){
- ajaxLoaderShow();
- setTimeout(checkLoader,100);
- }
- else {
- ajaxLoaderHide();
- }
- }
- }
- var replaceText = function() {
- var area_id = get_selected_area();
- var areas = getAreaArray();
- $.post(get_url_path()+'/ajax/overlay', {
- 'model' : $('#model').val(),
- 'model_run' : $('#model-run').val(),
- 'model_valid' : $('#model-valid').val(),
- 'model_param' : $('#model-param').val(),
- 'model_location' : $('#model-location').val(),
- 'area_id' : area_id,
- 'areas_1' : areas[1],
- 'areas_2' : areas[2],
- 'areas_3' : areas[3],
- 'areas_4' : areas[4],
- 'areas_5' : areas[5],
- 'areas_6' : areas[6],
- 'areas_7' : areas[7],
- 'areas_8' : areas[8],
- 'areas_9' : areas[9]
- }, function (data) {
- $('#text-overlay').html(data);
- place_obs();
- replaceScale('overlay');
- });
- };
- var getTimezoneFormat = function(type, addDayname) {
- var tzformatInt = +$('#display-tzformat').attr('data-value');
- if(typeof tzformatInt === 'undefined') {
- tzformatInt = 1;
- }
- var dateStr = '';
- var timeStr = '';
- var formatStr = '';
- switch (tzformatInt) {
- case 0:
- case 3:
- case 5:
- case 6:
- case 8:
- timeStr = 'hh:mma';
- break;
- case 1:
- case 2:
- case 4:
- case 7:
- case 9:
- timeStr = 'HH:mm';
- break;
- }
- switch (tzformatInt) {
- case 0:
- case 2:
- dateStr = 'MM/DD/YYYY';
- break;
- case 1:
- case 5:
- dateStr = 'DD.MM.YYYY';
- break;
- case 3:
- case 4:
- dateStr = 'DD/MM/YYYY';
- break;
- case 6:
- case 7:
- dateStr = 'YYYY-MM-DD';
- break;
- case 8:
- case 9:
- dateStr = 'DD-MM-YYYY';
- break;
- }
- formatStr = dateStr + ', ' + timeStr;
- if(addDayname)
- dateStr = 'ddd ' + dateStr;
- formatStr = dateStr + ', ' + timeStr;
- if(type == 'time')
- return timeStr;
- if(type == 'date')
- return dateStr;
- return formatStr;
- };
- var model_hour_prev = function() {
- if (checkChartcounter()) {
- $('#model-year-block').val('blockyear');
- model_x_change_index_prev('#model-valid','prev');
- }
- };
- var model_date_prev = function() {
- if (checkChartcounter()) {
- $('#model-year-block').val('blockyear');
- model_x_change_index_prev('#model-run','prev');
- }
- };
- var model_year_prev = function() {
- if (checkChartcounter()) {
- model_x_change_index_prev('#model-year', 'prevyear');
- }
- };
- var model_x_change_index_prev = function(mid, prev) {
- var selected = model_player_get_selected_index(mid);
- var items = model_player_get_item_count(mid+" option");
- var newsel = selected + 1;
- if($(mid+" .valids-hide").length>0) {
- var valclass = $('.valid-btn.btn-active').data('value');
- newsel = selected + $(mid+' option:selected').nextUntil('.'+valclass).length + 1;
- console.log(newsel);
- }
- if (selected < items) {
- $(mid).prop("selectedIndex", newsel);
- $(mid).trigger('change');
- }
- else {
- refreshDropdowns(null, null, null, prev);
- }
- };
- var model_x_change_index_next = function (mid) {
- var selected = model_player_get_selected_index(mid);
- var items = model_player_get_item_count(mid+" option");
- var newsel = selected - 1;
- if($(mid+" .valids-hide").length>0) {
- var valclass = $('.valid-btn.btn-active').data('value');
- newsel = selected - $(mid+' option:selected').prevUntil('.'+valclass).length - 1;
- console.log(newsel);
- }
- if (selected > 0) {
- $(mid).prop("selectedIndex", newsel);
- $(mid).trigger('change');
- }
- else {
- refreshDropdowns(null, null, null, 'next');
- }
- };
- var model_hour_next = function() {
- if (checkChartcounter()) {
- $('#model-year-block').val('blockyear');
- model_x_change_index_next('#model-valid');
- }
- };
- var model_date_next = function() {
- if (checkChartcounter()) {
- $('#model-year-block').val('blockyear');
- model_x_change_index_next('#model-run');
- }
- };
- var model_year_next = function() {
- if (checkChartcounter()) {
- model_x_change_index_next('#model-year');
- }
- };
- var model_x_prev = function(mid) {
- var selected = model_player_get_selected_index(mid);
- var items = model_player_get_item_count(mid+" option");
- if (selected < items) {
- $(mid).prop("selectedIndex", selected + 1);
- if (selected+1 < items) {
- images_islast = 0;
- }
- else {
- images_islast = 1;
- }
- }
- else {
- $(mid).prop("selectedIndex", 0);
- }
- if (is_playing === 1) {
- replacePlayerImage(mid);
- }
- else {
- changePlayerImage(mid);
- }
- };
- var model_x_next = function(mid) {
- var selected = model_player_get_selected_index(mid);
- var items = model_player_get_item_count(mid+" option");
- if (selected > 0) {
- $(mid).prop("selectedIndex", selected - 1);
- if (selected-1 > 0) {
- images_islast = 0;
- }
- else {
- images_islast = 1;
- }
- }
- else {
- $(mid).prop("selectedIndex", items);
- }
- if (is_playing === 1) {
- replacePlayerImage(mid);
- }
- else {
- changePlayerImage(mid);
- }
- };
- var changePlayerDropdowns = function() {
- var data = $("#radar-animation").val();
- var opt = data.split('/');
- $('#model-run').val(opt[0]);
- $('#model-valid').val(opt[1]);
- };
- var changePlayerImage = function(domid) {
- replacePlayerImage(domid, true);
- initSatTemp();
- };
- var replacePlayerImage = function(domid, flag_skip) {
- var model = $('#model').val();
- if (model === 'modvhshd') {
- return false;
- }
- //changePlayerDropdowns();
- var meta_data = $(domid).val();
- if (meta_data) {
- var meta_data_split = meta_data.split('#');
- var data = meta_data_split[0];
- var opt = data.split('/');
- var area = get_selected_area();
- if (model.substring(0,3)!=="mod") {
- var datum = opt[0].replace(/-/g, "_");
- var uhrzeit = opt[1].replace(/:/g, "");
- }
- if (model === 'radial' || model === 'sweeps' || model === 'radar3d' || model === 'zsweeps' || isObsMode(model)) {
- var uhrzeit2 = opt[1].replace(/:/g, "_");
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit2+'_'+area+'_'+$('#model-param').val()+'.png');
- }
- else if (model === 'radarus' && $('#model-mode').val() === 'RADARUS_PARAM') {
- uhrzeit = uhrzeit.replace(/_/g, "");
- var model_param = $('#model-param').val();
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+model_param+'_'+uhrzeit+'.png');
- }
- else if (model === 'radarus' && radarus_is_dyn()) {
- uhrzeit = uhrzeit.replace(/_/g, "");
- var model_location = $('#model-location').val();
- var model_param = $('#model-param').val();
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+model_location+'_'+model_param+'_'+uhrzeit+'.png');
- }
- else if (model === 'sat' || model === 'globus') {
- var uhrzeit2 = opt[1].replace(/:/g, "_");
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit2+'_'+area+'_'+$('#model-param').val()+'.jpg');
- }
- else if (model === 'hagel') {
- var uhrzeit2 = opt[1].replace(/:/g, "_");
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit2+'_'+area+'_'+$('#model-param').val()+'.png');
- }
- else if (model === 'radarpre') {
- var uhrzeit2 = opt[1].replace(/:/g, "");
- var futuremin = '000';
- if (opt[2]) {
- futuremin = opt[2];
- }
- if ($('#model-valid-fcspecial').val() == 'RADARAT_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- if ($('#model-valid-fcspecial').val() == 'RADARCH_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- if ($('#model-valid-fcspecial').val() == 'RADARNL_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- if (parseInt(futuremin)>0) {
- $('#rdfc-button').show();
- $('#legend-parameter').html('Niederschlagsradar (Prognose) (mm/h)');
- }
- else {
- $('#rdfc-button').hide();
- $('#legend-parameter').html('Niederschlagsradar (mm/h)');
- }
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+uhrzeit2+'_'+futuremin+'.png');
- }
- else if(model.substring(0,3)=="mod"){
- var model_param = $('#model-param').val();
- var model_valid_hidden = $(domid).val();
- var model_member = $('#model-member').val();
- var member_string = '';
- if (typeof model_member !== 'undefined' && model_member.length>0 && parseInt(model_member)>=0) {
- member_string = '_m'+model_member;
- }
- var run_date = model_valid_hidden.split('#');
- var lang = '';
- if (model_param == 155 || model_param == 213 || model_param == 352 || model_param == 353) {
- lang = '-'+displayLanguage().toString().toLowerCase();
- }
- var m = 'model';
- if (model === 'modezseason') {
- m = 'season';
- }
- else if (model === 'modezwkly') {
- m = 'weekly';
- }
- var image = extServer(url_path+'/images/data/cache/'+m+'/'+m+lang+'_'+model+'_'+run_date[0]+'_'+run_date[1]+'_'+area+'_'+model_param+member_string+'.png');
- }
- else {
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+uhrzeit+'.png');
- }
- //console.log('flag_skip'+flag_skip+' includes: '+loaded_image_sources.includes(image)+ ' -- '+image);
- if (flag_skip === true || loaded_image_sources.indexOf(image) != -1) {
- $('#model-image>img').attr('src', image);
- }
- if (model === 'pl') {
- $('#tstorm-image>img').attr('src', image.replace(/pl/g,"tstorm"));
- }
- else {
- $('#tstorm-image>img').attr('src',url_path+'/images/overlay/trans.png');
- }
- if (model !== 'storms' && model !== 'floods') {
- $('#stormtrack-image>img').attr('src',url_path+'/images/overlay/trans.png');
- }
- if(model.substring(0,3)!=="mod"){
- var momentDate = moment(meta_data_split[1], 'YYYY-MM-DD/HH:mm');
- var dateString = momentDate.format(getTimezoneFormat('date', true));
- var timeString = momentDate.format(getTimezoneFormat('time'));
- if(displayLanguage() == 'DE')
- timeString += ' Uhr';
- $('#legende-date').html(dateString);
- $('#legende-time').html(timeString);
- if (model === 'radarpre') {
- $('#rdfc-time').html(timeString);
- }
- }
- else {
- var momentDate = moment(meta_data_split[3], 'DD.MM.YYYY, HH:mm [Uhr]');
- var dayString = momentDate.format('ddd');
- $('#legende-complete-date').html(dayString + ' ' + meta_data_split[3]);
- $('#legende-modelrun').html(meta_data_split[2].replace(", ", "/"));
- }
- }
- };
- var model_player_first = function() {
- var items = model_player_get_item_count("#radar-animation option");
- $("#radar-animation").prop("selectedIndex", items);
- changePlayerImage();
- };
- var model_player_last = function() {
- $("#radar-animation").prop("selectedIndex", 0);
- changePlayerImage();
- };
- var model_player_prev = function(domid) {
- if($('#model').val().substring(0,3) === 'mod') {
- model_x_next(domid);
- }
- else {
- model_x_prev(domid);
- }
- };
- var model_player_next = function(domid) {
- if($('#model').val().substring(0,3) === 'mod') {
- model_x_prev(domid);
- }
- else {
- model_x_next(domid);
- }
- };
- var model_player_get_selected_index = function(name) {
- return $(name).prop("selectedIndex");
- };
- var model_player_get_item_count = function(name) {
- if(name.substring(0,16)=="#radar-animation"){
- var ret = ($(name).length*images_extend/images_extend_max)-1;
- }
- else{
- var ret = ($(name).length)-1;
- }
- return ret;
- };
- var animate = null;
- var is_playing = 0;
- var current_image = 0;
- var max_images;
- var model_player_start = function(nohistory) {
- if (is_playing === 1) {
- return false;
- };
- //stopAutoRefresh();
- if (isObsMode($('#model').val())) {
- var show = $('#model_image_visibility').attr('data');
- if (show === 'show') {
- $('#model-image').show();
- $('.obs').hide();
- }
- }
- current_image = model_player_get_selected_index('#model-valid');
- var images_counter=12;
- if ($('#model').val() === 'radarpre') {
- $('#radar-animation').prop("selectedIndex", 24);
- images_counter=48;
- }
- if (nohistory != 2) {
- trackPlayer('#radar-animation',images_counter.toString());
- }
- if (nohistory != 1) {
- addHistory(1);
- }
- max_images = model_player_get_item_count("#radar-animation option");
- ajaxLoaderShow();
- model_player_load();
- };
- var modelcharts_player_start = function(nohistory) {
- if (is_playing === 1) {
- return false;
- };
- if (nohistory != 1) {
- addHistory(1);
- }
- var intervall = $('#model-player-interval').val();
- max_images = model_player_get_item_count("#modelcharts-animation-"+intervall+" option");
- trackPlayer("#modelcharts-animation-"+intervall,max_images);
- current_image = model_player_get_selected_index('#model-valid');
- addHistory(1);
- ajaxLoaderShow(true);
- modelcharts_player_load();
- };
- var modelcharts_player_stop = function() {
- is_playing = 0;
- is_playing_first = true;
- images=[]; // buffers for preloading loop images
- loaded_image_sources=[];
- images_loaded=0;
- loading=0;
- refreshDropdowns();
- };
- var model_player_stop = function() {
- is_playing = 0;
- is_playing_first = true;
- images=[]; // buffers for preloading loop images
- loaded_image_sources=[];
- images_loaded=0;
- loading=0;
- clearInterval(player_load_session);
- player_load_session = null;
- initSatTemp();
- if (isObsMode($('#model').val())) {
- var show = $('#model_image_visibility').attr('data');
- if (show === 'show') {
- $('#model-image').hide();
- var mapmarker = $('#map-marker').css('display');
- $('.obs').show();
- $('#map-marker').css('display',mapmarker);
- }
- }
- };
- var model_player_stop_button = function() {
- model_player_stop();
- var starttime = $('#player-start-time').attr('data-value');
- if(typeof starttime !== 'undefined' && starttime.length>0) {
- refreshDropdowns(false);
- }
- else {
- refreshDropdowns(1);
- }
- }
- var frame_count_orig=-1;
- var model_player_extend_button = function() {
- if (loading==1 || images_extend===images_extend_max) {
- return false;
- };
- model_player_stop();
- var images_counter = 12;
- if(frame_count_orig<0){
- frame_count_orig=images_extend_max*document.getElementById('frame_count').innerHTML;
- }
- if (images_extend==1){images_extend=2; images_counter=24;}
- else if(images_extend==2){images_extend=4; images_counter=48;}
- else if(images_extend==3){images_extend=6; images_counter=72;}
- else if(images_extend==4){images_extend=8; images_counter=96;}
- else {images_extend=1;}
- $('#frame_count').html((frame_count_orig*images_extend/images_extend_max));
- //console.log(frame_count_orig+" "+images_extend+" "+images_extend_max);
- images=[]; // buffers for preloading loop images
- loaded_image_sources=[];
- images_loaded=0;
- loading=0;
- $('#radar-animation').prop("selectedIndex", 0);
- trackPlayer('#radar-animation', images_counter.toString());
- model_player_start(2);
- }
- var model_player_extend_level = function(level) {
- images_extend=level;
- model_player_stop();
- if(frame_count_orig<0 && document.getElementById('frame_count')){
- frame_count_orig=images_extend_max*document.getElementById('frame_count').innerHTML;
- }
- $('#frame_count').html((frame_count_orig*images_extend/images_extend_max));
- images=[]; // buffers for preloading loop images
- loaded_image_sources=[];
- images_loaded=0;
- loading=0;
- model_player_start(2);
- }
- var model_player_speed = function() {
- if (is_playing == 0) {
- model_player_start();
- }
- else {
- model_player_stop_button();
- }
- }
- var model_player_load = function() {
- images=[];
- preload_image_animation("#radar-animation");
- };
- var modelcharts_player_load = function() {
- images=[];
- var intervall = $('#model-player-interval').val();
- preload_image_animation("#modelcharts-animation-"+intervall);
- };
- var player_load_session = null;
- var preload_image_animation = function(domid, isGif) {
- $('#ajax-loading-progress .progress-bar').css('width', '0%');
- clearInterval(player_load_session);
- player_load_session = null;
- var parallel_proc = $('#parallel-proc').attr('data-value');
- if (typeof parallel_proc === 'undefined') {
- parallel_proc = 1;
- }
- parallel_proc = parseInt(parallel_proc);
- //Fill Image Url Array
- var image_url_array = [];
- var model = $('#model').val();
- var area = get_selected_area();
- var is_obs_mode = isObsMode(model);
- var is_radarus_dyn = radarus_is_dyn();
- var max_preload_images = model_player_get_item_count(domid+" option") + 1;
- $(domid).find('option').each(function(index) {
- if(image_url_array.length >= max_preload_images) return;
- var optionEl = $(this);
- var meta_data = optionEl.val();
- var meta_data_split = meta_data.split('#');
- var data = meta_data_split[0];
- var opt = data.split('/');
- var image = null;
- if (model.substring(0,3)!=="mod") {
- var datum = opt[0].replace(/-/g, "_");
- var uhrzeit = opt[1].replace(/:/g, "");
- }
- if (model === 'radial' || model === 'sweeps' || model === 'radar3d' || model === 'zsweeps' || is_obs_mode) {
- var uhrzeit2 = opt[1].replace(/:/g, "_");
- image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit2+'_'+area+'_'+$('#model-param').val()+'.png');
- }
- else if (model === 'radarus' && $('#model-mode').val() === 'RADARUS_PARAM') {
- uhrzeit = uhrzeit.replace(/_/g, "");
- var model_param = $('#model-param').val();
- image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+model_param+'_'+uhrzeit+'.png');
- }
- else if (model === 'radarus' && is_radarus_dyn) {
- uhrzeit = uhrzeit.replace(/_/g, "");
- var model_location = $('#model-location').val();
- var model_param = $('#model-param').val();
- image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+model_location+'_'+model_param+'_'+uhrzeit+'.png');
- }
- else if (model === 'sat' || model === 'globus') {
- var uhrzeit2 = opt[1].replace(/:/g, "_");
- image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit2+'_'+area+'_'+$('#model-param').val()+'.jpg');
- }
- else if (model === 'hagel') {
- var uhrzeit2 = opt[1].replace(/:/g, "_");
- image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit2+'_'+area+'_'+$('#model-param').val()+'.png');
- }
- else if (model === 'radarpre') {
- var uhrzeit2 = opt[1].replace(/:/g, "");
- var futuremin = '000';
- if (opt[2]) {
- futuremin = opt[2];
- }
- if ($('#model-valid-fcspecial').val() == 'RADARAT_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- if ($('#model-valid-fcspecial').val() == 'RADARCH_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- if ($('#model-valid-fcspecial').val() == 'RADARNL_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+uhrzeit2+'_'+futuremin+'.png');
- }
- else if(model.substring(0,3)=="mod"){
- var model_param = $('#model-param').val();
- var model_valid_hidden = optionEl.val();
- var model_member = $('#model-member').val();
- var member_string = '';
- if (typeof model_member !== 'undefined' && model_member.length>0 && parseInt(model_member)>=0) {
- member_string = '_m'+model_member;
- }
- var run_date = model_valid_hidden.split('#');
- var lang = '';
- if (model_param == 155 || model_param == 213 || model_param == 352 || model_param == 353) {
- lang = '-'+displayLanguage().toString().toLowerCase();
- }
- var m = 'model';
- if (model === 'modezseason') {
- m = 'season';
- }
- else if (model === 'modezwkly') {
- m = 'weekly';
- }
- image = extServer(url_path+'/images/data/cache/'+m+'/'+m+lang+'_'+model+'_'+run_date[0]+'_'+run_date[1]+'_'+area+'_'+model_param+member_string+'.png');
- }
- else {
- image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+uhrzeit+'.png');
- }
- if(image)
- image_url_array.push(image);
- });
- var images_loaded = 0;
- var images_to_load = parallel_proc;
- var loading_in_process = false;
- $('img.animation-cache-image').remove();
- player_load_session = setInterval(function() {
- if(player_load_session == null) return;
- //Exit intervall loop - All images are loaded
- if(images_loaded >= max_preload_images) {
- $('#ajax-loading-progress .progress-bar').css('width', '100%');
- clearInterval(player_load_session);
- player_load_session = null;
- if(!isGif) {
- is_playing = 1;
- setTimeout(function() {
- ajaxLoaderHide();
- model_player_play(domid);
- }, 300);
- } else {
- setTimeout(function() {
- ajaxLoaderHide();
- produceGif(domid);
- }, 300);
- }
- }
- if(images_loaded < images_to_load && !loading_in_process) {
- loading_in_process = true;
- for (var image_index = images_loaded; image_index < images_to_load && image_index < image_url_array.length; image_index++) {
- var bild = new Image();
- bild.setAttribute("data-url", image_url_array[image_index]);
- bild.onload = function(){ images_loaded_increment(); loaded_image_sources.push(this.getAttribute('data-url')); };
- bild.onerror = function(){ images_loaded_increment(); };
- bild.src = image_url_array[image_index];
- bild.className = 'animation-cache-image';
- bild.style.display = 'none';
- $(bild).appendTo($(domid).parent());
- }
- }
- }, 10);
- var images_loaded_increment = function() {
- if(player_load_session == null)
- return;
- images_loaded++;
- if(Math.ceil(model_player_get_item_count(domid+" option") + 1) == image_url_array.length) {
- var percentage = (images_loaded / image_url_array.length * 100).toFixed(3);
- $('#ajax-loading-progress .progress-bar').css('width', percentage + '%');
- }
- if(images_loaded >= images_to_load) {
- loading_in_process = false;
- images_to_load += parallel_proc;
- }
- }
- }
- var raw_model_player_load = function(domid, tmploading, images_waiting, parallel, new_limit, checkeronly) {
- var parallel_proc = $('#parallel-proc').attr('data-value');
- if (typeof parallel_proc === 'undefined') {
- parallel_proc = 1;
- }
- parallel_proc = parseInt(parallel_proc);
- if (typeof parallel === 'undefined') {
- parallel=1;
- }
- if (typeof checkeronly === 'undefined') {
- checkeronly=false;
- }
- if (typeof new_limit === 'undefined') {
- new_limit=parallel_proc;
- }
- if (typeof images_waiting === 'undefined') {
- images_waiting=0;
- }
- if (typeof tmploading === 'undefined') {
- tmploading=0;
- $(domid).prop("selectedIndex", 0);
- }
- //console.log({domid, tmploading, images_waiting, parallel, new_limit, checkeronly});
- var items = model_player_get_item_count(domid+" option");
- if(tmploading===0){
- if (!checkeronly) {
- //for(var i=0;i<=max_images;i++){
- // retrieve path to image
- var meta_data = $(domid).val();
- var meta_data_split = meta_data.split('#');
- var data = meta_data_split[0];
- var opt = data.split('/');
- var model = $('#model').val();
- var area = get_selected_area();
- if (model.substring(0,3)!=="mod") {
- var datum = opt[0].replace(/-/g, "_");
- var uhrzeit = opt[1].replace(/:/g, "");
- }
- if (model === 'radial' || model === 'sweeps' || model === 'radar3d' || model === 'zsweeps' || isObsMode(model)) {
- var uhrzeit2 = opt[1].replace(/:/g, "_");
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit2+'_'+area+'_'+$('#model-param').val()+'.png');
- }
- else if (model === 'radarus' && $('#model-mode').val() === 'RADARUS_PARAM') {
- uhrzeit = uhrzeit.replace(/_/g, "");
- var model_param = $('#model-param').val();
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+model_param+'_'+uhrzeit+'.png');
- }
- else if (model === 'radarus' && radarus_is_dyn()) {
- uhrzeit = uhrzeit.replace(/_/g, "");
- var model_location = $('#model-location').val();
- var model_param = $('#model-param').val();
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+model_location+'_'+model_param+'_'+uhrzeit+'.png');
- }
- else if (model === 'sat' || model === 'globus') {
- var uhrzeit2 = opt[1].replace(/:/g, "_");
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit2+'_'+area+'_'+$('#model-param').val()+'.jpg');
- }
- else if (model === 'hagel') {
- var uhrzeit2 = opt[1].replace(/:/g, "_");
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+uhrzeit2+'_'+area+'_'+$('#model-param').val()+'.png');
- }
- else if (model === 'radarpre') {
- var uhrzeit2 = opt[1].replace(/:/g, "");
- var futuremin = '000';
- if (opt[2]) {
- futuremin = opt[2];
- }
- if ($('#model-valid-fcspecial').val() == 'RADARAT_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- if ($('#model-valid-fcspecial').val() == 'RADARCH_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- if ($('#model-valid-fcspecial').val() == 'RADARNL_PRO_FX' && futuremin == '000') {
- futuremin = '005';
- }
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+uhrzeit2+'_'+futuremin+'.png');
- }
- else if(model.substring(0,3)=="mod"){
- var model_param = $('#model-param').val();
- var model_valid_hidden = $(domid).val();
- var model_member = $('#model-member').val();
- var member_string = '';
- if (typeof model_member !== 'undefined' && model_member.length>0 && parseInt(model_member)>=0) {
- member_string = '_m'+model_member;
- }
- var run_date = model_valid_hidden.split('#');
- var lang = '';
- if (model_param == 155 || model_param == 213 || model_param == 352 || model_param == 353) {
- lang = '-'+displayLanguage().toString().toLowerCase();
- }
- var m = 'model';
- if (model === 'modezseason') {
- m = 'season';
- }
- else if (model === 'modezwkly') {
- m = 'weekly';
- }
- var image = extServer(url_path+'/images/data/cache/'+m+'/'+m+lang+'_'+model+'_'+run_date[0]+'_'+run_date[1]+'_'+area+'_'+model_param+member_string+'.png');
- }
- else {
- var image = extServer(url_path+'/images/data/cache/'+model+'/'+model+'_'+datum+'_'+area+'_'+uhrzeit+'.png');
- }
- // move selected item one step forward
- var bild = new Image();
- bild.onload = function(){images_loaded++; loaded_image_sources.push(image);};
- bild.onerror = function(){images_loaded++; };
- bild.src=image;
- images.push(bild);
- }
- //console.log('parallel '+parallel+ ' new_limit '+new_limit+ ' checkeronly'+checkeronly+ ' imageswaiting'+images_waiting);
- if (parallel === parallel_proc) {
- checkeronly=true;
- if (images_loaded < new_limit) {
- var tout = 100;
- if(isAutoRefreshActive())
- tout = 10;
- setTimeout(function() {
- raw_model_player_load(domid,0,0,parallel, new_limit, true);
- },tout);
- }
- else {
- new_limit+=parallel_proc;
- parallel = 0;
- checkeronly=false;
- }
- }
- if (!checkeronly) {
- var selected = model_player_get_selected_index(domid);
- if (selected < items) {
- if (is_playing !== 1) {
- $(domid).prop("selectedIndex", selected + 1);
- raw_model_player_load(domid,0,0,parallel+1, new_limit, false);
- }
- }
- }
- }
- if (!checkeronly) {
- if(images_loaded<items && images_waiting<10000) {
- setTimeout(function(){raw_model_player_load(domid, 1, images_waiting+1);},200);
- }
- else {
- //console.log('images_loaded '+images_loaded+' # items '+items+ ' # images_waiting '+images_waiting);
- tmploading=2;
- }
- if (tmploading === 2 && is_playing==0){
- is_playing = 1;
- ajaxLoaderHide();
- //stopAutoRefresh();
- model_player_play(domid);
- }
- }
- };
- var model_player_play = function(domid) {
- //console.log(images);
- if (is_playing === 1) {
- if (is_playing_first === true) {
- is_playing_first = false;
- $(domid).prop("selectedIndex", 0);
- }
- model_player_next(domid);
- if(images_islast==0){
- setTimeout(function() { model_player_play(domid); }, images_delay[images_speed]);
- }
- else{
- setTimeout(function() { model_player_play(domid); }, 8*images_delay[images_speed]);
- images_islast=0;
- }
- }
- else {
- return false;
- }
- };
- var place_obs = function(retry) {
- // Geolocation
- var geo_x = $('#geo-x').val(); geo_x = parseInt(geo_x)-10;
- var geo_y = $('#geo-y').val(); geo_y = parseInt(geo_y)-20;
- if (parseInt(geo_x)>0 && parseInt(geo_y)>0) {
- $('#map-marker').attr("data-left", geo_x);
- $('#map-marker').attr("data-top", geo_y);
- $('#map-marker').show();
- }
- var factor = parseInt($('#map-overlay').width());
- $('#text-overlay').css('width', factor);
- // Chrome's too fast, so retry a little bit later
- if (retry !== true) {
- setTimeout(function(){place_obs(true);}, 500);
- }
- var abstand = get_abstand();
- $('.ap').each(function(){
- var left = parseInt($(this).attr('data-left'));
- var top = parseInt($(this).attr('data-top'));
- if (left < 2 || left > 725 || top < 0 || top > 600) {
- $(this).css('display', 'none');
- }
- else {
- $(this).css('left', ((left/760)*factor+abstand)+'px');
- $(this).css('top', ((top/760)*factor)+'px');
- }
- });
- $('.lp').each(function(){
- var left = parseInt($(this).attr('data-left'));
- var top = parseInt($(this).attr('data-top'));
- if (left < 0) {
- $(this).css('right', ((left/760)*factor*(-1))+'px');
- }
- else {
- $(this).css('left', (((left/760)*factor+abstand))+'px');
- }
- $(this).css('top', ((top/760)*factor)+'px');
- if (factor < 260) {
- $(this).css('display', 'none');
- }
- else if (factor < 321) {
- if (!block_hiding_loadinglayer_when_loading) {
- $(this).css('display', 'block');
- }
- $(this).css('font-size', '8px');
- $('.lp_valid').css('font-size', '7px');
- $('.lp_valid_small').css('font-size', '6px');
- $('.lp_param').css('font-size', '10px');
- $('.faq-button-param').css('font-size', '10px');
- $('.faq-button-param').css('margin-left', '5px');
- }
- else if (factor < 400) {
- if (!block_hiding_loadinglayer_when_loading) {
- $(this).css('display', 'block');
- }
- $(this).css('font-size', '8px');
- $('.lp_valid').css('font-size', '8px');
- $('.lp_valid_small').css('font-size', '6px');
- $('.lp_param').css('font-size', '11px');
- $('.faq-button-param').css('font-size', '12px');
- $('.faq-button-param').css('margin-left', '5px');
- }
- else if (factor < 460) {
- if (!block_hiding_loadinglayer_when_loading) {
- $(this).css('display', 'block');
- }
- $(this).css('font-size', '9px');
- $('.lp_valid_small').css('font-size', '7px');
- $('.lp_param').css('font-size', '14px');
- }
- else if (factor < 540) {
- if (!block_hiding_loadinglayer_when_loading) {
- $(this).css('display', 'block');
- }
- $(this).css('font-size', '10px');
- $('.lp_valid_small').css('font-size', '8px');
- $('.lp_param').css('font-size', '16px');
- }
- else if (factor < 620) {
- if (!block_hiding_loadinglayer_when_loading) {
- $(this).css('display', 'block');
- }
- $(this).css('font-size', '11px');
- $('.lp_valid_small').css('font-size', '9px');
- $('.lp_param').css('font-size', '18px');
- }
- else if (factor < 760) {
- if (!block_hiding_loadinglayer_when_loading) {
- $(this).css('display', 'block');
- }
- $(this).css('font-size', '12px');
- $('.lp_valid_small').css('font-size', '10px');
- $('.lp_param').css('font-size', '20px');
- }
- else {
- if (!block_hiding_loadinglayer_when_loading) {
- $(this).css('display', 'block');
- }
- $(this).css('font-size', '14px');
- $('.lp_valid_small').css('font-size', '10px');
- $('.lp_param').css('font-size', '24px');
- }
- });
- $('.lp_updatetimes').css('font-size','11px');
- if (!block_hiding_loadinglayer_when_loading) {
- $('.lp_wait').css('display','none');
- }
- $('#sld_model_player_speed').slider({min:0, max:10, value:images_speed, slide:function(event,ui){images_speed=ui.value;}});
- showOrHideOpenStreetMapInfo();
- };
- var get_abstandY = function() {
- if (displayCountry() == 'vh') {
- if (parseInt($('.container').width())<=720) {
- return -50;
- }
- /*else if (parseInt($('.app-content').width()) <= 874) {
- return -65;
- */
- return 0;
- }
- return 30;
- };
- var get_abstand = function() {
- var abstand = 10;
- if (displayCountry() == 'vh') {
- if (parseInt($('.container').width()) < 945) {
- abstand = 15;
- }
- return abstand;
- }
- else {
- if (parseInt($('.container').width()) < 940) {
- abstand = 15;
- }
- return abstand;
- }
- };
- var resize_video = function() {
- //resize_video_all(1.778, '.youtube-video');
- resize_video_all(1.778, '.youtube-video');
- if ($('body').width()>= 992) {
- $('.youtube-index-video').each(function() {
- $( this ).replaceWith('<iframe class="youtube-index-video-ifr" width="267" height="150" src="https://www.youtube.com/embed/'+$( this ).attr('data-src')+'" frameborder="0" allowfullscreen></iframe>');
- });
- }
- resize_video_all(1.778, '.youtube-index-video-ifr');
- var faktor1 = 1;
- var faktor2 = 1;
- var htmlwidth=$(document).width();
- if (htmlwidth >= 1200) {
- faktor1 = 1.333;
- faktor2 = 1.778;
- }
- else if (htmlwidth >= 998) {
- faktor1 = 1.5;
- faktor2 = 1.778;
- };
- resize_video_all(faktor1, '.vine-video-detail');
- resize_video_all(faktor2, '.vine-video');
- };
- var resize_video_all = function(fact, select) {
- $(select).each(function(){
- var size = parseInt($(this).parent('div').width());
- var modal = parseInt($('#faq-modal>div').width())-40;
- if (select === '.youtube-video') {
- size = modal;
- }
- $(this).attr('width', size);
- $(this).attr('height', (size/fact));
- });
- };
- var replaceScale = function(test) {
- $('#copyright_text').html('');
- var model = $('#model').val();
- if (model !== 'blitze' && model !== 'pl' && !isModelCard(model) && model !== 'regen' && !isObsMode(model)) {
- $('#scale-overlay>img').attr('src', scalePath()+$('#model-param').val()+".png");
- }
- if (isModelCard(model)) {
- $('#scale-overlay>img').attr('src', scalePath('model/'+displayCountry())+model+".png");
- }
- if (isObsMode(model) || model === 'sat' || model === 'blitze' || model === 'pl' || model === 'px250' || model === 'cyclone' || isModelCard(model)) {
- var text = $('#copyright_hidden').attr('data');
- if (!text) {
- text='';
- }
- $('#copyright_text').html(text);
- }
- }
- var model_addons = function(model) {
- var ret = model;
- var lang = $('#display-language').attr('data-value');
- var tz = $('#display-timezone').attr('data-value');
- var tzf = $('#display-tzformat').attr('data-value');
- var overlay = $('#map-overlay-setting').attr('data-value');
- if (lang.length == 2) {
- ret = ret + '-' +lang;
- if (tz.length == 3) {
- ret = ret + '-' +tz;
- if (parseInt(tzf)>=0 && parseInt(tzf)<10) {
- ret = ret + '-' +tzf;
- if (overlay === '0') {
- ret = ret + '-zz';
- }
- else if (overlay === '2') {
- ret = ret + '-xz';
- }
- }
- }
- }
- return ret;
- }
- var save_as = function(blitz) {
- if ($('#model').val() !== 'sat' && $('#model').val() !== 'globus') {
- var path = get_model_image_path();
- }
- else {
- var path = get_model_image_path('PNG');
- }
- if (!Array.isArray(path) && typeof path !== 'undefined') {
- var model = $('#model').val();
- var model_param = $('#model-param').val();
- if (model === 'modezseason') {
- model = 'season';
- }
- else if (model === 'modezwkly') {
- model = 'weekly';
- }
- else if (model.substring(0,3) === 'mod') {
- model = 'model';
- }
- var download = path.replace("data/cache/"+model+"/"+model+'_', "data/cache/"+model+"/download_"+model_addons(model)+'_');
- if (model_param == 155 || model_param == 213 || model_param == 352 || model_param == 353) {
- download = path.replace("data/cache/"+model+"/"+model+'-'+displayLanguage().toString().toLowerCase()+'_', "data/cache/"+model+"/download_"+model_addons(model)+'_');
- }
- var blitz_id = $('#blitz-id-modal').attr("data");
- if (blitz && blitz_id) {
- download = url_path+'/images/data/cache/blitz/download_'+model_addons('blitz')+'_'+get_selected_area()+'_'+blitz_id+'.png';
- }
- document.location.href = download;
- }
- else {
- alert('Download nicht möglich!');
- }
- };
- var toggle_lightnings = function() {
- $('#lightning-image').toggle();
- };
- var setLastParamId = function() {
- if ($('#model').val() === 'sat') {
- last_param_id = parseInt( $('#model-param').val());
- }
- }
- var switch2radar = function() {
- model_player_stop(); setLastParamId();
- $('#model').val('px250');
- refreshDropdowns(2);
- };
- var switch2wwanalyze = function() {
- model_player_stop(); setLastParamId();
- $('#model').val('wwanalyze');
- $('#legends_visibility').attr('data','');
- $('#scale-overlay>img').attr('src', scalePath()+'WWANALYZE.png');
- refreshDropdowns(2);
- };
- var switch2radarde = function() {
- model_player_stop(); setLastParamId();
- $('#model').val('radarde');
- $('#legends_visibility').attr('data','');
- refreshDropdowns(2);
- //$('#scale-overlay>img').attr('src', scalePath()+'RADARDE.png');
- };
- var switch2radarsd = function() {
- model_player_stop(); setLastParamId();
- $('#model').val('radar');
- $('#legends_visibility').attr('data','');
- refreshDropdowns(2);
- //$('#scale-overlay>img').attr('src', scalePath()+'RADARSD.png');
- };
- var switch2hagel = function(paramid) {
- model_player_stop(); setLastParamId();
- $('#model').val('hagel');
- $('#legends_visibility').attr('data','');
- refreshDropdowns(false, paramid);
- };
- var switch2radar3d = function(paramid) {
- model_player_stop(); setLastParamId();
- $('#model').val('radar3d');
- $('#legends_visibility').attr('data','');
- $('#scale-overlay>img').attr('src', scalePath('model/'+displayCountry())+'neutral.png');
- refreshDropdowns(false, paramid);
- };
- var switch2radarpre = function() {
- model_player_stop(); setLastParamId();
- $('#model').val('radarpre');
- $('#legends_visibility').attr('data','');
- refreshDropdowns(1);
- //$('#scale-overlay>img').attr('src', scalePath()+'RADAR.png');
- };
- var switch2model = function(model) {
- model_player_stop();
- $('#model').val(model);
- $('#legends_visibility').attr('data','')
- refreshDropdowns();
- };
- var switch2singlepx = function() {
- model_player_stop();
- $('#model').val('singlepx');
- $('#legends_visibility').attr('data','')
- refreshDropdowns(2);
- //$('#scale-overlay>img').attr('src', scalePath()+'ZSWEEPS.png');
- };
- var switch2plraw = function() {
- model_player_stop();
- $('#model').val('plraw');
- $('#legends_visibility').attr('data','')
- $('#map-overlay-trans').hide();
- $('#map-overlay').hide();
- $('#map-underlay-trans').hide();
- $('#map-underlay').hide();
- refreshDropdowns(2);
- };
- var switch2sweeps = function() {
- model_player_stop();
- $('#model').val('sweeps');
- $('#legends_visibility').attr('data','')
- refreshDropdowns(2);
- //$('#scale-overlay>img').attr('src', scalePath()+'SWEEPS.png');
- };
- var switch2zsweeps = function() {
- model_player_stop();
- $('#model').val('zsweeps');
- $('#legends_visibility').attr('data','')
- refreshDropdowns(2);
- //$('#scale-overlay>img').attr('src', scalePath()+'ZSWEEPS.png');
- };
- var switch2tracking = function() {
- model_player_stop(); setLastParamId();
- $('#model').val('storms');
- refreshDropdowns(2);
- };
- var switch2floods = function() {
- model_player_stop(); setLastParamId();
- $('#model').val('floods');
- refreshDropdowns(2);
- };
- var switch2regen = function() {
- model_player_stop(); setLastParamId();
- $('#model').val('regen');
- refreshDropdowns(3,264);
- };
- var switch2radarlight = function() {
- model_player_stop(); setLastParamId();
- $('#model').val('pl');
- refreshDropdowns(2);
- };
- var switch2lightnings = function() {
- model_player_stop(); setLastParamId();
- $('#model').val('blitze');
- $('#legends_visibility').attr('data','')
- refreshDropdowns(2);
- };
- var switch2obs = function() {
- model_player_stop();
- $('#model').val('obs');
- $('#legends_visibility').attr('data','')
- refreshDropdowns();
- };
- var switch2obsama = function() {
- model_player_stop();
- $('#model').val('obsama');
- $('#legends_visibility').attr('data','')
- refreshDropdowns();
- };
- var switch2pollen = function() {
- model_player_stop();
- $('#model').val('pollen');
- $('#legends_visibility').attr('data','')
- refreshDropdowns(2);
- };
- var switch2gma = function() {
- model_player_stop();
- $('#model').val('gma');
- $('#legends_visibility').attr('data','')
- refreshDropdowns();
- };
- var switch2radarus = function(param) {
- model_player_stop();
- $('#model').val('radarus');
- $('#legends_visibility').attr('data','')
- if (parseInt(param)>0) {
- refreshDropdowns(false, param);
- }
- else {
- refreshDropdowns(2);
- }
- };
- var switch2radial = function(standort) {
- model_player_stop(); setLastParamId();
- if (standort && standort === 'b') {
- standort = 80;
- }
- else {
- standort = 79;
- }
- $('#model').val('radial');
- $('#legends_visibility').attr('data','')
- refreshDropdowns(false, standort);
- //$('#scale-overlay>img').attr('src', scalePath()+'RADIAL.png');
- };
- var switch2sat = function() {
- switch2sat_raw(131);
- };
- var switch2sat15 = function() {
- switch2sat_raw(132);
- };
- var switch2sat_raw = function(id) {
- if (last_param_id > 0) {
- id = last_param_id;
- }
- //closeMarker();
- model_player_stop();
- $('#model').val('sat');
- $('#legends_visibility').attr('data','')
- refreshDropdowns(false, id);
- };
- var checkHash = function() {
- var hash = window.location.hash;
- var flag_player = ($('#player-flag').attr('data-value') === 'true' ? true : false);
- if (hash.substr(0,4) == '#geo') {
- var data = hash.replace("#","").split(/_/,3);
- $.post(get_url_path()+'/ajax/geoxy', {
- 'area_id' : get_selected_area(),
- 'lat' : data[1],
- 'long' : data[2]
- }, function (data) {
- if (typeof data.x !== 'undefined' && typeof data.y !== 'undefined' &&
- parseInt(data.x)>=0 && parseInt(data.x)<=760 &&
- parseInt(data.y)>=0 && parseInt(data.y)<=616) {
- // Geolocation
- $('#geo-x').val(parseInt(data.x));
- $('#geo-y').val(parseInt(data.y));
- $('#geo-lat').val(data.lat);
- $('#geo-long').val(data.long);
- place_obs();
- }
- },'json');
- }
- else if (hash == '#play' && isModelCard($('#model').val()) && flag_player) {
- block_hiding_loadinglayer_when_loading = true;
- modelcharts_player_start(1);
- }
- else if (hash == '#play' && modelWithPlayer($('#model').val()) && flag_player) {
- block_hiding_loadinglayer_when_loading = true;
- model_player_start(1);
- }
- else if (hash == '#play2' && modelWithPlayer($('#model').val()) && flag_player) {
- block_hiding_loadinglayer_when_loading = true;
- trackPlayer('#radar-animation', '24');
- model_player_extend_level(2);
- }
- else if (hash == '#play4' && modelWithPlayer($('#model').val()) && flag_player) {
- block_hiding_loadinglayer_when_loading = true;
- trackPlayer('#radar-animation', '48');
- model_player_extend_level(4);
- }
- else if (hash == '#play6' && modelWithPlayer($('#model').val()) && flag_player) {
- block_hiding_loadinglayer_when_loading = true;
- trackPlayer('#radar-animation', '72');
- model_player_extend_level(6);
- }
- else if (hash == '#play8' && modelWithPlayer($('#model').val()) && flag_player) {
- block_hiding_loadinglayer_when_loading = true;
- trackPlayer('#radar-animation', '96');
- model_player_extend_level(8);
- }
- else if (hash == '#locateme') {
- gps_locating_wetter();
- }
- };
- var focus_search = function() {
- $('#forecast-input-0').focus();
- };
- var focus_search0 = function() {
- $('#forecast-input-0').focus();
- };
- var focus_search1 = function() {
- $('#forecast-input-1').focus();
- };
- var focus_search8 = function() {
- $('#forecast-input-8').focus();
- };
- var shareWhatsapp = function(blitz, station) {
- document.location.href = 'whatsapp://send?text='+encodeURIComponent(directURL(blitz, station));
- };
- var shareCanonicalFB = function() {
- return shareForecast('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent($('link[rel=canonical]').attr('href')), '_kwFacebook');
- };
- var shareCanonicalTwitter = function() {
- return shareForecast('https://twitter.com/share?url='+encodeURIComponent($('link[rel=canonical]').attr('href')), '_kwTwitter');
- };
- var shareForecastFB = function(tab) {
- var url = $('#forecast-url').attr('data');
- var tab2 = $('#tab-url').attr('data-src');
- if (typeof tab !== 'undefined' && tab.length) {
- url = url + '/' + tab;
- }
- else if (typeof tab2 !== 'undefined' && tab2.length) {
- url = url + '/' + tab2;
- }
- return shareForecast('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(url), '_kwFacebook');
- };
- var shareForecastTwitterPlain = function() {
- var url = $('#forecast-url').attr('data');
- return shareForecast('https://twitter.com/share?url='+encodeURIComponent(url), '_kwTwitter');
- };
- var shareForecastFBPlain = function() {
- var url = $('#forecast-url').attr('data');
- return shareForecast('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(url), '_kwFacebook');
- };
- var shareForecastTwitter = function(tab) {
- var url = $('#forecast-url').attr('data');
- var tab2 = $('#tab-url').attr('data-src');
- if (typeof tab !== 'undefined' && tab.length) {
- url = url + '/' + tab;
- }
- else if (typeof tab2 !== 'undefined' && tab2.length) {
- url = url + '/' + tab2;
- }
- return shareForecast('https://twitter.com/share?url='+encodeURIComponent(url), '_kwTwitter');
- };
- var shareForecast = function(url, windowname) {
- if (url) {
- window.open(url,windowname,'width=600, height=300');
- }
- return false;
- }
- var shareFB = function(blitz, station) {
- return shareURL('https://www.facebook.com/sharer/sharer.php?u=','_kwFacebook',blitz);
- };
- var shareTwitter = function(blitz, station) {
- return shareURL('https://twitter.com/share?url=','_kwTwitter',blitz, station);
- };
- var copyToClipboard = function(blitz, station) {
- console.log(directURL(blitz, station));
- };
- var directURL = function(blitz, station) {
- var url = $('#share-path').val();
- if (!url) {
- url = '';
- }
- var file = $('#share-file').val();
- if (file && file.length) {
- file = file+"/";
- }
- else {
- file = '';
- }
- return addHash2Url(url+file,blitz, station);
- };
- var shareURL = function(share_url, window_name, blitz, station) {
- completeurl = directURL(blitz, station);
- var hash = window.location.hash;
- var hash_url = completeurl;
- if (hash == '#play' || hash == '#play2' || hash == '#play4' || hash == '#play6' || hash == '#play8') {
- hash_url = window.location.href;
- }
- if ($('#model').val().length) {
- window.open(share_url+encodeURIComponent(hash_url),window_name,'width=600, height=300');
- }
- else {
- window.open(share_url+encodeURIComponent(hash_url),window_name,'width=600, height=300');
- }
- return false;
- };
- var addHash2Url = function(url,blitz, station) {
- var timeurl = '';
- var day = $('#model-valid').val();
- if ($('#model').val() == 'cyclone') {
- timeurl = $('#model-run').val();
- if (day) {
- timeurl = timeurl+'-'+day;
- }
- var filter = $('#model-filter-storm').val();
- if (filter) {
- timeurl = timeurl+'-'+filter;
- }
- timeurl = timeurl+'.html';
- }
- else if (day) {
- day = day.replace(/-/g,'');
- day = day.replace(/:/g,'');
- day = day.replace("/","-");
- timeurl = day;
- if ($('#model').val() == 'radarpre') {
- timeurl = '';
- }
- if ($('#model').val() === 'radarus' && radarus_is_dyn()) {
- timeurl = $('#model-location').val()+'_'+timeurl;
- }
- if (timeurl.length || isObsMode($('#model').val())) {
- timeurl = timeurl+'z';
- var blitz_id = $('#blitz-id-modal').attr("data");
- var track_url = $('#track-url').attr("data");
- var flood_url = $('#flood-url').attr("data");
- if (blitz === 1 && blitz_id) {
- timeurl = timeurl +'-' +blitz_id;
- }
- else if (blitz === 3 && track_url) {
- timeurl = track_url;
- }
- else if (blitz === 4 && flood_url) {
- timeurl = flood_url;
- }
- timeurl = timeurl +'.html';
- }
- }
- else {
- day = $('#model-run').val();
- if (day) {
- timeurl = day;
- if (timeurl.length) {
- if (station) {
- timeurl = station + '-' + timeurl;
- }
- timeurl = timeurl +'.html';
- }
- }
- }
- var hash = window.location.hash;
- var hash_url = '';
- if (hash.substr(0,4) == '#geo') {
- hash_url = hash;
- }
- return url+timeurl+hash_url;
- };
- var showLgt = function(blitzid,counter) {
- $('#map-wrapper').hide();
- $('#map-ajax-loader').show();
- var c = true;
- if (counter === false) {
- c = false;
- }
- $.get(get_url_path()+'/ajax/blitzortung', {
- 'blitz_id' : blitzid,
- 'counter' : c,
- 'lang' : displayLanguage(),
- 'area_id' : get_selected_area()
- }, function (data) {
- $('#map-ajax-loader').hide();
- $('#map-wrapper').show();
- $('#map-wrapper').html(data);
- if (c) { addHistory(null, 1); }
- },'html');
- };
- var showPollen = function(pollen,counter) {
- $('#pollen-detail').modal('show');
- pollen_detail(pollen,counter);
- };
- var obs_detail = function (value, station, timestamp) {
- $('#obs-detail-label').html(station);
- $('#obs-detail-wrapper>h1').html(value);
- $('#obs-detail-wrapper>p>span').html(timestamp);
- return false;
- };
- var obs_detail_3h = function (value, station, timestamp, id, timestamp2, counter) {
- $('#obs-detail-3h-table').html('');
- $('#obs-detail-3h-label').html(station);
- $('#obs-detail-3h-js>h1').html(value);
- $('#obs-detail-3h-js>p>span').html(timestamp);
- var c = true;
- if (counter === false) {
- c = false;
- }
- $.get(get_url_path()+'/ajax/obsdetail', {
- 'station_id' : id,
- 'timestamp' : timestamp2,
- 'param_id' : $('#model-param').val(),
- 'model' : $('#model').val(),
- 'area_id' : get_selected_area(),
- 'counter' : c,
- 'lang' : displayLanguage()
- }, function (data) {
- if (data === 'NOT_ALLOWED') {
- messageLayer(403,'#error-msg','#error-modal');
- }
- else if (data !== 'FALSE') {
- $('#obs-detail-3h-table').html(data);
- if (c) { addHistory(null, 1); }
- }
- },'html');
- };
- var pollen_detail = function (station, counter) {
- $('#pollen-detail-content').html('');
- var c = true;
- if (counter === false) {
- c = false;
- }
- $.post(get_url_path()+'/ajax/pollenmonitor', {
- 'model' : 'pollen_detail',
- 'station_id' : station,
- 'date' : $('#model-run').val(),
- 'counter' : c
- }, function (data) {
- $('#pollen-detail-content').html(data);
- },'html');
- return false;
- };
- var refresh = function(e) {
- model_player_stop();
- if ($('#model').val()) {
- if (e) {
- e.preventDefault();
- }
- refreshDropdowns(1);
- }
- };
- var autoRefresh = function() {
- var areas = getAreaArray();
- var area_id = get_selected_area();
- params = {
- 'model' : $('#model').val(),
- 'model_param' : $('#model-param').val(),
- 'model_member' : $('#model-member').val(),
- 'model_location' : $('#model-location').val(),
- 'area_id' : area_id,
- 'areas_1' : areas[1],
- 'areas_2' : areas[2],
- 'areas_3' : areas[3],
- 'areas_4' : areas[4],
- 'areas_5' : areas[5],
- 'areas_6' : areas[6],
- 'areas_7' : areas[7],
- 'areas_8' : areas[8],
- 'areas_9' : areas[9],
- 'geo_lat' : $('#geo-lat').val(),
- 'geo_long' : $('#geo-long').val(),
- 'fl_newest' : $('#newest-flag').val(),
- 'fl_param' : $('#param-flag').val(),
- 'fl_model' : $('#model-flag').val(),
- 'real_refresh' : 1//,
- };
- $.ajax(
- {
- url: get_url_path() + '/ajax/dropdown',
- data: params,
- cache: false,
- dataType: 'html'
- }
- ).success(function(data) {
- if (data === 'NOT_ALLOWED') {
- resetDropdowns();
- messageLayer(403,'#error-msg','#error-modal');
- }
- else if (data === 'UNAVAILABLE') {
- resetDropdowns();
- messageLayer(503,'#error-msg','#error-modal');
- }
- else if (data === 'NO_MODEL_DATA') {
- $('.ac-btn[data-model]').each(function(){
- if ($(this).hasClass('btn-active') && isModelCard($(this).attr('data-model'))) {
- $('#model').val($(this).attr('data-model'));
- }
- });
- messageLayer(121,'#error-msg','#error-modal');
- }
- else {
- if(data) {
- var newDataTimestamp = $(data).find('#model-valid').val();
- var currentDataTimestamp = $('#autorefresh-last-timestamp').val();
- //console.log({currentDataTimestamp: currentDataTimestamp, newDataTimestamp: newDataTimestamp, newDataAvailable: newDataTimestamp > currentDataTimestamp});
- if(newDataTimestamp > currentDataTimestamp) {
- if(player_load_session == null) {
- var tempIsPlaying = is_playing;
- if(tempIsPlaying)
- model_player_stop();
- $('#drop-downs').html(data);
- $('#autorefresh-info > .glyphicon').addClass('glyphicon-spin');
- setDropDownListener();
- changeImage();
- place_obs();
- reloadIframeAds();
- initDatePicker();
- initVarSettings();
- initOpenDivs();
- if(displayCountry() === 'vh'){
- $('#model')[0].data=data;
- $('#model').trigger('change');
- }
- }
- if(tempIsPlaying)
- model_player_extend_level(images_extend);
- }
- $('#autorefresh-info > .glyphicon').removeClass('glyphicon-spin');
- }
- }
- });
- }
- var autoRefreshHandle = null;
- var currentAutoRefreshParam = null;
- var initAutoRefresh = function(intervalSeconds) {
- intervalSeconds = intervalSeconds || +$('#autorefresh-interval').data('value');
- if(typeof intervalSeconds !== 'number')
- intervalSeconds = 30;
- if($('#model').val() == 'radarpre' && intervalSeconds != -1)
- intervalSeconds = 150;
- var modelRestrictions = [
- 'px250',
- 'wwanalyze',
- 'radar',
- 'pl',
- 'hagel',
- 'blitze',
- 'storms',
- 'floods',
- 'radial',
- 'sat',
- 'regen',
- 'singlepx',
- 'zsweeps',
- 'sweeps',
- 'radar3d',
- 'plraw',
- 'globus',
- 'radarus',
- 'radarpre'
- ];
- var initAutoRefreshResult = true;
- var debugMessage = '';
- if (initAutoRefreshResult && intervalSeconds === -1) {
- initAutoRefreshResult = false;
- debugMessage = 'Survival Mode active';
- }
- if (initAutoRefreshResult && modelRestrictions.indexOf($('#model').val()) === -1) {
- initAutoRefreshResult = false;
- debugMessage = 'Model is not allowed';
- }
- if (initAutoRefreshResult && ($('#paywall-account-type').attr('data-value') !== 'payaccount') && $('#autorefresh-last-timestamp').length == 0) {
- initAutoRefreshResult = false;
- debugMessage = 'Account no payaccount';
- }
- if (initAutoRefreshResult && !$('#autorefresh-last-timestamp').val() || !$('#model-valid').val()) {
- initAutoRefreshResult = false;
- debugMessage = 'Model is not allowed / Not in model view';
- }
- if (initAutoRefreshResult && is_playing == 1 && false) {
- initAutoRefreshResult = false;
- debugMessage = 'Model player is playing';
- }
- if (initAutoRefreshResult && $('#model-valid').val() !== $('#autorefresh-last-timestamp').val()) {
- initAutoRefreshResult = false;
- debugMessage = 'Not latest data timestamp';
- }
- currentAutoRefreshParam = $('#model').val() + ($('#model-param').val() ? '/' + $('#model-param').val() : '');
- if(isAutoRefreshActive()) {
- if(!initAutoRefreshResult) {
- clearInterval(autoRefreshHandle);
- autoRefreshHandle = null;
- $('#autorefresh-info').show().fadeOut(500);
- //console.log('AutoRefresh stopped: ' + debugMessage);
- return false;
- } else {
- $('#autorefresh-info').show();
- return true;
- }
- } else {
- if(!initAutoRefreshResult) {
- //console.log('AutoRefresh init result: Refused starting autorefresh - ' + debugMessage);
- clearInterval(autoRefreshHandle);
- autoRefreshHandle = null;
- $('#autorefresh-info').hide();
- return false;
- } else {
- //console.log('AutoRefresh init result: Started autorefresh with ' + intervalSeconds + 'sec interval');
- $('#autorefresh-info').fadeIn(500);
- }
- }
- clearInterval(autoRefreshHandle);
- autoRefreshHandle = setInterval(function() {
- //DEBUG
- //console.log('AutoRefresh interval');
- $('#autorefresh-info > .glyphicon').addClass('glyphicon-spin');
- autoRefresh();
- }, intervalSeconds * 1000);
- return true;
- }
- var stopAutoRefresh = function() {
- console.log('AutoRefresh force stopped');
- var debugBox = 'auto_refresh = <b>off</b><br>Grund: <em>Force Stop (Probably Model Player)</em>';
- $('.debug#auto-refresh').html(debugBox);
- clearInterval(autoRefreshHandle);
- autoRefreshHandle = null;
- }
- var isAutoRefreshActive = function() {
- return autoRefreshHandle !== null;
- }
- var refreshDropdowns = function(real_refresh, standort, params2, prevnext, jqobj) {
- model_player_stop();
- var so = $('#model-param').val();
- if (standort) {
- so = standort;
- }
- if (!prevnext) {
- prevnext = null;
- }
- var jahr = null;
- if ($('#model-year-block').val() !== 'blockyear' && $('#model-year').val() !== $('#model-year-def').val()) {
- jahr = $('#model-year').val();
- }
- var areas = getAreaArray(jqobj);
- var area_id = get_selected_area(jqobj);
- op = parseInt($('#current-regen-param').attr('data-param'));
- if ((parseInt(so) === 264 || parseInt(so) === 265) && op !== 264 && op !== 265 && $('#current-regen-now').attr('data-param') === 'true') {
- real_refresh = 1;
- }
- var params = {}
- params = {
- 'model' : $('#model').val(),
- 'model_member' : $('#model-member').val(),
- 'model_location' : $('#model-location').val(),
- 'area_id' : area_id,
- 'areas_1' : areas[1],
- 'areas_2' : areas[2],
- 'areas_3' : areas[3],
- 'areas_4' : areas[4],
- 'areas_5' : areas[5],
- 'areas_6' : areas[6],
- 'areas_7' : areas[7],
- 'areas_8' : areas[8],
- 'areas_9' : areas[9],
- 'geo_lat' : $('#geo-lat').val(),
- 'geo_long' : $('#geo-long').val(),
- 'fl_newest' : $('#newest-flag').val(),
- 'fl_param' : $('#param-flag').val(),
- 'fl_model' : $('#model-flag').val(),
- 'real_refresh' : 0//,
- };
- if (real_refresh) {
- params.real_refresh=1;
- if (real_refresh === 1) {
- params.model_param = $('#model-param').val();
- }
- else if (real_refresh === 2) {
- params.model_valid = $('#model-valid').val();
- params.model_run = $('#model-run').val();
- params.model_year = jahr;
- }
- else if (real_refresh === 3) {
- params.model_param = so;
- params.model_valid = $('#model-valid').val();
- params.model_run = $('#model-run').val();
- params.model_year = jahr;
- }
- }
- else {
- params.model_valid = $('#model-valid').val();
- params.model_run = $('#model-run').val();
- params.model_year = jahr;
- params.model_param = so;
- if (prevnext === 'prevyear') {
- params.prevnext = 'prev';
- params.prevyear = 'true';
- }
- else {
- params.prevnext = prevnext;
- }
- }
- if (params2) {
- params = params2;
- }
- //Check für Modell- oder Param-Switch und löschen des model_valid properties, damit der neueste Zeitpunkt geladen wird und AutoRefresh aktiv bleibt.
- if(isAutoRefreshActive() && currentAutoRefreshParam != params.model + (params.model_param ? '/' + params.model_param : '')) {
- delete params.model_valid;
- //console.log(params);
- }
- if ($('#model').val() === 'blitze' && $('#blitze-5minonly').prop('checked')) {
- params.blitze_5minonly = 'true';
- }
- if ($('#model').val() === 'cyclone') {
- params.model_filter_storm = $('#model-filter-storm').val();
- }
- if (parseInt($('#model-player-interval').val()) > 0) {
- params.model_player_interval = $('#model-player-interval').val();
- }
- ajaxLoaderShowDelay(jqobj);
- $.get(get_url_path()+'/ajax/dropdown', params, function (data) {
- ajaxLoaderHide(jqobj);
- if (data === 'NOT_ALLOWED') {
- resetDropdowns();
- messageLayer(403,'#error-msg','#error-modal');
- }
- else if (data === 'UNAVAILABLE') {
- resetDropdowns();
- messageLayer(503,'#error-msg','#error-modal');
- }
- else if (data === 'NO_MODEL_DATA') {
- $('.ac-btn[data-model]').each(function(){
- if ($(this).hasClass('btn-active') && isModelCard($(this).attr('data-model'))) {
- $('#model').val($(this).attr('data-model'));
- }
- });
- messageLayer(121,'#error-msg','#error-modal');
- }
- else {
- $('#drop-downs').html(data);
- setDropDownListener();
- changeImage();
- place_obs();
- reloadIframeAds();
- initDatePicker();
- initVarSettings();
- initOpenDivs();
- images_extend=1;
- frame_count_orig=-1;
- if(displayCountry() === 'vh'){
- $('#model')[0].data=data;
- $('#model').trigger('change');
- }
- }
- },'html');
- }
- var rdfcPrognose = function() {
- if ($('#model').val() === 'radarpre') {
- if ($('#rdfc_prognose').attr('data') === 'true') {
- $('#rdfc-button').show();
- var uhrzeit = $('#legende-time').html();
- $('#rdfc-time').html(uhrzeit.replace(" Uhr",""));
- }
- else {
- $('#rdfc-button').hide();
- }
- }
- }
- var addHistory = function(player, blitz, station) {
- // player: 1=play, 2=entferne Geohash, 3=skip GA view
- var completeurl = get_complete_share_url(player,blitz, station);
- if (player == 2) {
- var dat2 = completeurl.split('#');
- if (dat2[0]){
- completeurl = dat2[0];
- }
- }
- pushHistory(completeurl);
- if (typeof ga !== 'undefined' && player != 1 && player != 3) {
- var count_url = completeurl.replace($('#full-base').val(),"");
- ga("send", "pageview", count_url);
- }
- };
- var getFlagPlayer = function () {
- var starttime = $('#player-start-time').attr('data-value');
- var flag_player = true;
- if (parseInt(starttime)>0) {
- flag_player= false;
- }
- return flag_player;
- };
- var get_complete_share_url = function(player,blitz, station) {
- var model = $('#model').val();
- var url = $('#share-path').val();
- var file = $('#share-file').val();
- var completeurl = directURL(blitz, station);
- var param_id = $('#model-param').val();
- var flag_player = getFlagPlayer();
- if (completeurl.match(/NaN/g) != null || (player == 1 && flag_player)) {
- if (!file) {
- file = '';
- }
- else if(file.length) {
- if (isObsMode(model) || model === 'regen' || model === 'radial' || model === 'sweeps' || model === 'radar3d' || model === 'zsweeps' ||
- model === 'sat' || model === 'globus' || isModelCard(model) ||
- model === 'storms' || model === 'floods') {
- file = file+".html";
- }
- else if (!(model === 'radarus' && player == 1 && !radarus_is_dyn())) {
- file = file+"/";
- }
- }
- if (player == 1) {
- if (model === 'radarus' && !radarus_is_dyn() && file.length>0) {
- file = file+".html";
- }
- else if (model === 'radarus' && radarus_is_dyn()) {
- file=file+$('#model-location').val()+'.html';
- }
- if(images_extend==1) {
- completeurl = url+file;
- var ohne_hash = completeurl.split("#");
- completeurl = ohne_hash[0]+'#play';
- }
- else {
- completeurl = url+file;
- var ohne_hash = completeurl.split("#");
- completeurl = ohne_hash[0]+'#play'+images_extend;
- }
- }
- else {
- completeurl = url+file;
- }
- }
- if (player == 1 && !flag_player) {
- if(images_extend==1) {
- var ohne_hash = completeurl.split("#");
- completeurl = ohne_hash[0]+'#play';
- }
- else {
- var ohne_hash = completeurl.split("#");
- completeurl = ohne_hash[0]+'#play'+images_extend;
- }
- }
- return completeurl;
- };
- var get_url_path = function() {
- var ret = url_path;
- var tld = $('#tld').val();
- if (typeof tld !== 'undefined' && tld !== 'us') {
- ret = ret + '/' + tld;
- }
- return ret;
- };
- var set_to_latlong = function(lat, long) {
- gps_success({'coords':{'latitude':lat,'longitude':long}});
- }
- var gps_error = function () {
- messageLayer(201,'#error-msg','#error-modal');
- };
- var gps_success = function(pos) {
- var x = pos.coords.longitude;
- var y = pos.coords.latitude;
- var areas = getAreaArray();
- $.post(get_url_path()+'/ajax/locating', {
- 'lat' : y,
- 'long' : x,
- 'model' : $('#model').val(),
- 'model_param' : parseInt($('#model-param').val()),
- 'model_location' : $('#model-location').val(),
- }, function (data) {
- if (data) {
- var area_id = get_selected_area();
- if (parseInt(data.area_id)) {
- area_id = parseInt(data.area_id);
- };
- refreshDropdowns(null,null, {
- 'model' : $('#model').val(),
- 'model_valid' : $('#model-valid').val(),
- 'model_run' : $('#model-run').val(),
- 'model_param' : $('#model-param').val(),
- 'model_location' : $('#model-location').val(),
- 'area_id' : area_id,
- 'areas_1' : areas[1],
- 'areas_2' : areas[2],
- 'areas_3' : areas[3],
- 'areas_4' : areas[4],
- 'areas_5' : areas[5],
- 'areas_6' : areas[6],
- 'areas_7' : areas[7],
- 'areas_8' : areas[8],
- 'areas_9' : areas[9],
- 'geo_lat' : data.lat,
- 'geo_long' : data.long
- });
- }
- else {
- $('#error-msg').html("<p>Der passende Kartenausschnitt konnte nicht ermittelt werden.</p>");
- $('#error-modal').modal('show');
- }
- }, "json");
- };
- var gps_locating = function () {
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(gps_success, gps_error, {
- enableHighAccuracy: true,
- timeout: 20000,
- maximumAge: 600000
- });
- } else {
- gps_not_supported();
- }
- };
- var gps_locating_forecast = function () {
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(gps_success_forecast, gps_error, {
- enableHighAccuracy: true,
- timeout: 20000,
- maximumAge: 600000
- });
- } else {
- gps_not_supported();
- }
- };
- var gps_locating_wetter = function () {
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(gps_success_wetter, gps_error, {
- enableHighAccuracy: true,
- timeout: 20000,
- maximumAge: 600000
- });
- } else {
- gps_not_supported();
- }
- };
- var gps_locating_uwz = function () {
- if (navigator.geolocation) {
- $('#unwetterzentrale').html('<p>Sie werden jetzt automatisch geortet. Bitte kurz warten.</p>');
- navigator.geolocation.getCurrentPosition(gps_success_uwz, gps_error_uwz, {
- enableHighAccuracy: true,
- timeout: 20000,
- maximumAge: 600000
- });
- } else {
- gps_not_supported_uwz();
- }
- };
- var gps_locating_hpwetter = function () {
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(gps_success_hpwetter, gps_error, {
- enableHighAccuracy: true,
- timeout: 20000,
- maximumAge: 600000
- });
- } else {
- gps_not_supported();
- }
- };
- var gps_success_forecast = function(pos) {
- return gps_success_global(pos,'/ajax/locatingfc');
- };
- var gps_success_wetter = function(pos) {
- return gps_success_global(pos,'/ajax/locatingwt');
- };
- var gps_success_hpwetter = function(pos) {
- return gps_success_global(pos,'/ajax/locatinghp');
- };
- var gps_success_global = function(pos, url) {
- var x = pos.coords.longitude;
- var y = pos.coords.latitude;
- $.post(get_url_path()+url, {
- 'lat' : y,
- 'long' : x,
- 'model' : $('#model').val(),
- 'forecast_action' : $('#forecast-action-0').val()
- }, function (data) {
- if (data) {
- document.location.href=data;
- }
- else {
- gps_not_supported();
- }
- });
- };
- var gps_not_supported = function() {
- $('#error-msg').html("<p>Ihr Standort befindet sich außerhalb unseres Vorhersagegebiets.</p>");
- $('#error-modal').modal('show');
- };
- var closeMarker = function() {
- $('#map-marker').hide();
- $('#geo-x').val('');
- $('#geo-y').val('');
- $('#geo-lat').val('');
- $('#geo-long').val('');
- addHistory(2);
- };
- var forecastDayTable = function(city_id, idate, imodel) {
- if (typeof imodel === 'undefined') {
- imodel=$('#forecast-model').val();
- }
- $('#forecast-daytable').html('<p>Wird geladen...</p>');
- $.post(get_url_path()+'/ajax/forecastdaytable', {
- 'city_id' : city_id,
- 'date' : idate,
- 'model' : imodel
- }, function (data) {
- $('#forecast-daytable').html(data);
- scrollToAnchor('daytable');
- });
- };
- var forecastDayTableHash = function(daytable) {
- scrollToAnchor(daytable);
- };
- var forecastModel = function() {
- forecastMT('fcxl');
- };
- var forecastModelTrend = function() {
- forecastMT('fcxl');
- }
- var forecastMT = function(url) {
- var params = {
- 'city_id' : $('#city-id').val(),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat(),
- 'model':$('#forecast-model').val(),
- 'func':$('#weather-fcxl-page').attr('data-func')
- };
- $('#forecast-full').html('<p>Wird geladen...</p>');
- $.get(get_url_path()+'/ajax/'+url, params, function (data) {
- $('#forecast-full').html(data);
- reloadIframeAds();
- setModelSelectorListener();
- var new_url = $('#forecast-url').attr('data');
- if (new_url) {
- if ($('#tab-url').attr("data-src")) {
- new_url+='/'+$('#tab-url').attr("data-src");
- }
- pushHistory(new_url);
- if (ga) {
- var count_url = new_url.replace($('#full-base').val(),"");
- ga("send", "pageview", count_url);
- }
- }
- });
- };
- var forecastModelEssentials = function(url) {
- var params = {
- 'url' : $('#forecast-url').attr("data"),
- 'model' : $('#forecast-model').val()
- };
- goto(params['url']+'/'+params['model']);
- };
- var forecastModelEnsemble = function(url) {
- var params = {
- 'url' : $('#forecast-url-sw').attr("data"),
- 'model' : $('#forecast-model').val(),
- 'tab_url' : $('#tab-url').attr('data-src')
- };
- var url_ensemble = params['url']+'/'+params['model'];
- if (params['tab_url']) {
- url_ensemble = url_ensemble + '/' +params['tab_url'];
- }
- goto(url_ensemble);
- };
- var scrollToAnchor = function (aid){
- var aTag = $("a[name='"+ aid +"']");
- $('html,body').animate({scrollTop: aTag.offset().top},'slow');
- };
- var goto = function(url) {
- document.location.href = url;
- };
- var temperature_canvas = '';
- var initSatTemp = function() {
- if ($('#model').val() === 'sat') {
- var o_url = $('#model-image>img').attr("src");
- var newlinktemp = o_url.replace("_119.jpg","_123.jpg")
- .replace("_120.jpg","_123.jpg")
- .replace("_121.jpg","_123.jpg")
- .replace("_122.jpg","_123.jpg")
- .replace("_131.jpg","_123.jpg")
- .replace("_133.jpg","_123.jpg")
- .replace("_124.jpg","_128.jpg")
- .replace("_125.jpg","_128.jpg")
- .replace("_126.jpg","_128.jpg")
- .replace("_127.jpg","_128.jpg")
- .replace("_132.jpg","_128.jpg")
- .replace("_134.jpg","_128.jpg")
- .replace("_326.jpg","_128.jpg");
- $("#temperaturemap").attr("src", newlinktemp);
- var temperature_img = $('#temperaturemap')[0];
- if (typeof temperature_img !== 'undefinded') {
- temperature_img.onload=function() {
- temperature_canvas = $('<canvas/>')[0];
- temperature_canvas.width = temperature_img.width;
- temperature_canvas.height = temperature_img.height;
- temperature_canvas.getContext('2d').drawImage(temperature_img, 0, 0, temperature_img.width, temperature_img.height);
- $('#click-overlay').on('mousemove',movehandler);
- $('#click-overlay').on('mouseout',function() {
- $('#temp-button').hide();
- });
- }
- }
- }
- else {
- $('#click-overlay').off('mousemove');
- }
- };
- var movehandler= function(event) {
- var text = $('#copyright_hidden').attr('data');
- if (temperature_canvas && (text == 'Satellitendaten: EUMETSAT' || text == 'Satellite data: EUMETSAT')) {
- var faktor = 1;
- if (temperature_canvas.width > 0) {
- faktor = $('#click-overlay').width()/temperature_canvas.width;
- }
- if (temperature_canvas.getContext('2d').getImageData(Math.floor(event.offsetX/faktor), Math.floor(event.offsetY/faktor), 1, 1).data) {
- $('#temp-button').show();
- var pixelData = temperature_canvas.getContext('2d').getImageData(Math.floor(event.offsetX/faktor), Math.floor(event.offsetY/faktor), 1, 1).data;
- var tempvalue=54-Math.round((144/255)*pixelData[2]);
- if (Math.floor(event.offsetY/faktor) > temperature_canvas.height-1 || Math.floor(event.offsetX/faktor) > temperature_canvas.width-1) {
- $('#temp-button').hide();
- }
- else {
- if(displayLanguage()=="EN"){
- var temptext = 'Temperature';
- }else{
- var temptext = 'Temperatur';
- }
- if(displayUnits()=="us")
- $('#temperatureoutput').html(temptext+': ' + Math.round(tempvalue*1.8+32) + '°F');
- else
- $('#temperatureoutput').html(temptext+': ' + tempvalue + '°C');
- }
- }
- }
- };
- var initOpenDivs = function() {
- if (open_dd_div1) {
- //$('#'+open_dd_div1).show();
- $('[data-id="'+open_dd_div1+'"]').each(function() {
- if ($(this).hasClass('acc-btn-on')) {
- openAccLayerDirect($(this));
- }
- });
- }
- else if (open_dd_start/* && !$('#animation-player-mobile').is(':visible')*/) {
- open_dd_start = false;
- var loc = window.location.href;
- if (typeof loc !== 'undefined' && loc.search('.html') !== -1) {
- if (isObsMode($('#model').val())) {
- $('[data-id="acc-layer-params"]').each(function() {
- if ($(this).hasClass('acc-btn-on')) {
- open_dd_div1 = 'acc-layer-params';
- openAccLayerDirect($(this));
- }
- });
- }
- else if (loc.search('orogra') !== -1) {
- $('[data-id="acc-layer-model"]').each(function() {
- if ($(this).hasClass('acc-btn-on')) {
- open_dd_div1 = 'acc-layer-model';
- openAccLayerDirect($(this));
- }
- });
- }
- else {
- $('[data-id="acc-layer-valid"]').each(function() {
- if ($(this).hasClass('acc-btn-on')) {
- open_dd_div1 = 'acc-layer-valid';
- openAccLayerDirect($(this));
- }
- });
- }
- }
- else {
- $('[data-id="acc-layer-params"]').each(function() {
- if ($(this).hasClass('acc-btn-on')) {
- open_dd_div1 = 'acc-layer-params';
- openAccLayerDirect($(this));
- }
- });
- }
- }
- if (open_dd_div2) {
- $('#'+open_dd_div2).show();
- }
- if (open_dd_tab_params) {
- $('[aria-controls="'+open_dd_tab_params+'"]').trigger('click');
- scrollTopParam();
- }
- if (open_dd_tab_valids) {
- $('[aria-controls="'+open_dd_tab_valids+'"]').trigger('click');
- }
- if (open_dd_tab_models) {
- $('[aria-controls="'+open_dd_tab_models+'"]').trigger('click');
- }
- if (open_dd_valids) {
- $('[data-value="'+open_dd_valids+'"]').trigger('click');
- }
- };
- var satHelp = function() {
- $('.sat-help').hide();
- var tmp = parseInt($('#model-param').val());
- if (tmp === 120 || tmp === 125) {
- $('.sat-help-hd').show();
- }
- else if (tmp === 121 || tmp === 126) {
- $('.sat-help-topalarm').show();
- }
- else if (tmp === 122 || tmp === 127) {
- $('.sat-help-color').show();
- }
- else if (tmp === 123 || tmp === 128) {
- $('.sat-help-infrarot').show();
- }
- else if (tmp === 131 || tmp === 132) {
- $('.sat-help-nature').show();
- }
- else if (tmp === 133 || tmp === 134) {
- $('.sat-help-nebel-check').show();
- }
- else if (tmp === 136 || tmp === 138 || tmp === 140 || tmp === 142 || tmp === 144) {
- $('.sat-help-globushd').show();
- }
- else if (tmp === 135 || tmp === 137 || tmp === 139 || tmp === 141 || tmp === 143) {
- $('.sat-help-globus').show();
- }
- else {
- $('.sat-help').show();
- }
- };
- var gaProperty = 'UA-63122815-1';
- // Disable tracking if the opt-out cookie exists.
- var disableStr = 'ga-disable-' + gaProperty;
- if (document.cookie.indexOf(disableStr + '=true') > -1) {
- window[disableStr] = true;
- }
- // Opt-out function
- var gaOptout = function() {
- document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
- window[disableStr] = true;
- alert("Google Analytics wurde auf dieser Seite deaktiviert.")
- };
- var mdTargeting = function () {
- var tkeys = {}
- var targeting = decodeURI($('#md-targeting').attr('data-value'));
- if (targeting) {
- var keys = targeting.split("|");
- if (keys.length) {
- for (i=0;i<keys.length;i++) {
- if (keys[i]) {
- var tmp2 = keys[i];
- var tmp = tmp2.split("%3D");
- if (tmp.length) {
- var name = tmp[0];
- tkeys[name]=tmp[1].replace("%2C",",");
- }
- }
- }
- }
- }
- return tkeys;
- };
- var nx = nx || {cmd:[]};
- if (nx.cmd && $('#md-domain').attr('data-value') === 'true') {
- var tkeys = mdTargeting();
- nx.cmd.push(function () {
- if (tkeys) {
- nx.set('targeting', tkeys);
- }
- nx.set('targeting', 'mid_mobile_complete_lazy', {adv: 'mobile_interscroller'});
- });
- }
- var reloadMDall = function () {
- if (nx.cmd && $('#md-domain').attr('data-value') === 'true') {
- var tkeys = mdTargeting();
- nx.cmd.push(function () {
- if (tkeys) {
- nx.set('targeting', tkeys);
- }
- nx.trigger('refresh');
- });
- }
- };
- var checkOwnAds = function() {
- $('.twiagoad').each(function() {
- if ($(this).is(":visible")) {
- var data = $(this).attr('data-twiago');
- var dat = data.split('|');
- if (parseInt(dat[0])>0 && parseInt(dat[1])>0 && parseInt(dat[2])>0) {
- $(this).html('<iframe width="'+parseInt(dat[0])+'" height="'+parseInt(dat[1])+'" noresize="noresize" scrolling="no" '+
- 'frameborder="0" marginheight="0" marginwidth="0" '+
- 'src="/ajax/iframe?view=99&id='+parseInt(dat[2])+'" '+
- 'ALLOWTRANSPARENCY="true"></iframe>');
- }
- }
- } );
- $('.kwadspirit').each(function() {
- if ($(this).is(":visible")) {
- var data = $(this).attr('data-md');
- var dat = data.split('|');
- var keys = dat[3];
- var data2 = $('#keyad-md').attr('data-md');
- if (typeof data2 !== 'undefined' && data2) {
- var dat2 = data2.split('|');
- if (dat2[3]) {
- keys = dat2[3];
- }
- }
- if (parseInt(dat[0])>0 && parseInt(dat[1])>0 && parseInt(dat[2])>0 && dat[3]) {
- $(this).html('<iframe width="'+parseInt(dat[0])+'" height="'+parseInt(dat[1])+'" noresize="noresize" scrolling="no" '+
- 'frameborder="0" marginheight="0" marginwidth="0" '+
- 'src="/ajax/iframe?view=97&id='+parseInt(dat[2])+'&keys='+keys+'" '+
- 'ALLOWTRANSPARENCY="true"></iframe>');
- }
- }
- } );
- };
- var reloadIframeAds = function() {
- checkOwnAds();
- reloadMDall();
- };
- var replaceAds = function(id, size, dom) {
- if ($(dom).is(':visible')) {
- $.post(get_url_path()+'/ajax/werbung', {
- 'area_id' : id,
- 'size' : size
- }, function (data) {
- if (data !== false) {
- $(dom).html(data);
- }
- else {
- $(dom).html('');
- }
- });
- }
- };
- var switchForecast = function(input) {
- var tmp = input.split('#');
- var output = tmp[0];
- var model = '';
- if (typeof tmp[1] !== 'undefined' && tmp[1]) {
- model = tmp[1];
- }
- var url = $('#forecast-url').attr('data');
- /*var tmp3 = url.split('/');
- if (tmp3.length > 6) {
- url = tmp3[0]+'/'+tmp3[1]+'/'+tmp3[2]+'/'+tmp3[3]+'/'+tmp3[4]+'/'+tmp3[5];
- }*/
- var tab2 = $('#tab-url').attr('data-src');
- if (output == 'ensemble') {
- url = url + '/' + model;
- }
- if (typeof tab2 !== 'undefined' && tab2.length) {
- if (displayCountry() === 'vh' && (output === 'xl' || output === 'xltrend')) {
- url = url + '/euro';
- }
- url = url + '/' + tab2;
- }
- if (url) {
- url = url.replace('/xltrend','/DUMMY');
- url = url.replace('/xl','/DUMMY');
- url = url.replace('/ensemble','/DUMMY');
- document.location.href = url.replace('/DUMMY','/'+output);
- return false;
- }
- return true;
- };
- var showFAQ = function(model_in,param_in) {
- $('#faq-modal .modal-header').html('');
- $('#faq-modal .modal-body').html(loadingGif());
- var model = $('#model').val();
- if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'RADAR_CH') {
- model = 'ch';
- }
- else if ((model === 'radarpre') && $('#legends_visibility').attr('data') === 'RADAR_AT') {
- model = 'radarpreat';
- }
- else if ((model === 'radarpre') && $('#legends_visibility').attr('data') === 'RADAR_CH') {
- model = 'radarprech';
- }
- else if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'RADAR_AT') {
- model = 'at';
- }
- else if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'RADARNL') {
- model = 'RADARNL';
- }
- else if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'RADAR_ESTONIA') {
- model = 'RADAR_ESTONIA';
- }
- else if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'NORWAY_RR') {
- model = 'NORWAY_RR';
- }
- else if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'FINLAND_DBZH_COMPOSITE') {
- model = 'FINLAND_DBZH_COMPOSITE';
- }
- else if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'UK_RAINRATE') {
- model = 'UK_RAINRATE';
- }
- else if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'SLOVENIA_RR') {
- model = 'SLOVENIA_RR';
- }
- else if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'RADAR_SOUTHTYROL') {
- model = 'RADAR_SOUTHTYROL';
- }
- else if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'RADAR_FRANCE') {
- model = 'RADAR_FRANCE';
- }
- else if ((model === 'px250' || model === 'storms' || model === 'floods') && $('#legends_visibility').attr('data') === 'RADAR_SWE_PRO') {
- model = 'RADAR_SWE_PRO';
- }
- if (model_in) {
- model = model_in;
- }
- var param = $('#model-param').val();
- var param2 = 0;
- if (param_in) {
- param = param_in;
- }
- if (model === 'sat') {
- param2 = get_selected_area();
- }
- var aparams = {
- 'model' : model,
- 'model_param' : param,
- 'model_param2' : param2,
- 'lang' : displayLanguage()
- };
- if (model === 'sat') {
- aparams.timestamp = $('#model-valid').val();
- }
- $.get(get_url_path()+'/ajax_pub/faq', aparams, function (data) {
- if (data !== 'FALSE') {
- $('#faq-modal').html(data);
- resize_video();
- setElementHiders();
- }
- },'html');
- return true;
- };
- var showMesoanalyse = function(city_id) {
- $('#faq-modal .modal-header').html('');
- $('#faq-modal .modal-body').html(loadingGif());
- var aparams = {
- 'city_id' : city_id,
- 'units' : displayUnits(),
- 'lang' : displayLanguage(),
- 'tf': displayTimeformat()
- };
- $.get(get_url_path()+'/ajax_pub/mesoanalyse', aparams, function (data) {
- if (data !== 'FALSE') {
- $('#faq-modal').html(data);
- resize_video();
- setElementHiders();
- }
- },'html');
- return true;
- };
- var showExtraNotice = function() {
- var aparams = {
- 'lang' : displayLanguage()
- };
- $.get(get_url_path()+'/ajax_pub/extranotice', aparams, function (data) {
- if (data !== 'FALSE') {
- $('#faq-modal').html(data);
- resize_video();
- setElementHiders();
- }
- },'html');
- return true;
- };
- var switchXlLight = function (idcounter) {
- if (idcounter === '0') {
- $('#forecast-action-1').val($('#forecast-action-0').val());
- if ($('#forecast-action-0').val() !== 'wetter') {
- if (typeof $('#forecast-form-0').attr('action') !== 'undefined') {
- $('#forecast-form-0').attr('action',$('#forecast-form-0').attr('action').toString().replace('/wetter/','/vorhersage/'));
- $('#forecast-form-0').attr('action',$('#forecast-form-0').attr('action').toString().replace('/weather/','/forecast/'));
- }
- if (typeof $('#forecast-form-1').attr('action') !== 'undefined') {
- $('#forecast-form-1').attr('action',$('#forecast-form-1').attr('action').toString().replace('/wetter/','/vorhersage/'));
- $('#forecast-form-1').attr('action',$('#forecast-form-1').attr('action').toString().replace('/weather/','/forecast/'));
- }
- }
- else {
- if (typeof $('#forecast-form-0').attr('action') !== 'undefined') {
- $('#forecast-form-0').attr('action',$('#forecast-form-0').attr('action').toString().replace('/vorhersage/','/wetter/'));
- $('#forecast-form-0').attr('action',$('#forecast-form-0').attr('action').toString().replace('/forecast/','/weather/'));
- }
- if (typeof $('#forecast-form-1').attr('action') !== 'undefined') {
- $('#forecast-form-1').attr('action',$('#forecast-form-1').attr('action').toString().replace('/vorhersage/','/wetter/'));
- $('#forecast-form-1').attr('action',$('#forecast-form-1').attr('action').toString().replace('/forecast/','/weather/'));
- }
- }
- //$('#forecast-action-8').val($('#forecast-action-0').val());
- }
- else if (idcounter === '1') {
- $('#forecast-action-0').val($('#forecast-action-1').val());
- if ($('#forecast-action-1').val() !== 'wetter') {
- if (typeof $('#forecast-form-0').attr('action') !== 'undefined') {
- $('#forecast-form-0').attr('action',$('#forecast-form-0').attr('action').toString().replace('/wetter/','/vorhersage/'));
- $('#forecast-form-0').attr('action',$('#forecast-form-0').attr('action').toString().replace('/weather/','/forecast/'));
- }
- if (typeof $('#forecast-form-1').attr('action') !== 'undefined') {
- $('#forecast-form-1').attr('action',$('#forecast-form-1').attr('action').toString().replace('/wetter/','/vorhersage/'));
- $('#forecast-form-1').attr('action',$('#forecast-form-1').attr('action').toString().replace('/weather/','/forecast/'));
- }
- }
- else {
- if (typeof $('#forecast-form-0').attr('action') !== 'undefined') {
- $('#forecast-form-0').attr('action',$('#forecast-form-0').attr('action').toString().replace('/vorhersage/','/wetter/'));
- $('#forecast-form-0').attr('action',$('#forecast-form-0').attr('action').toString().replace('/forecast/','/weather/'));
- }
- if (typeof $('#forecast-form-1').attr('action') !== 'undefined') {
- $('#forecast-form-1').attr('action',$('#forecast-form-1').attr('action').toString().replace('/vorhersage/','/wetter/'));
- $('#forecast-form-1').attr('action',$('#forecast-form-1').attr('action').toString().replace('/forecast/','/weather/'));
- }
- }
- // $('#forecast-action-8').val($('#forecast-action-1').val());
- }
- /*else if (idcounter === '8') {
- $('#forecast-action-0').val($('#forecast-action-8').val());
- $('#forecast-action-1').val($('#forecast-action-8').val());
- }*/
- };
- var navHeight = function () {
- var fbwidth=390;
- if (parseInt($(window).height())>390) {
- fbwidth=parseInt($(window).height());
- }
- $('.navbar-collapse').css('max-height',fbwidth-50);
- $('.menue-button').css('max-height',fbwidth-50);
- $('#myfavourites').css('max-height',fbwidth-50);
- };
- var resizeWidgets = function () {
- navHeight();
- var fbwidth=500;
- if ($('.fb-page').parent('div').width()) {
- fbwidth=$('.fb-page').parent('div').width();
- }
- $('.fb-page').attr('width', fbwidth);
- if ($('body').width()<768) {
- $('.fb-page-outer').html('');
- // $('.fb-page').replaceWidth('');//attr('height', 250);
- // $('.twitter-timeline').replaceWidth('');//.attr('data-widget-id','663795483240996864');
- }
- else if ($('body').width()<992) {
- $('.fb-page').attr('height', 350);
- $('.twitter-timeline').attr('data-widget-id','663797206206570496');
- }
- else if ($('body').width()<1200) {
- $('.fb-page').attr('height', 420);
- $('.twitter-timeline').attr('data-widget-id','663803781461770240');
- }
- };
- var initDatePicker = function() {
- var min = $('#datepicker-startdate').attr('data');
- if (!min) {
- min = 0;
- }
- var max = $('#datepicker-enddate').attr('data');
- if (!max) {
- max = new Date();
- }
- $('#datepicker-run').datetimepicker({
- locale: displayLanguage(),
- format: 'YYYY-MM-DD',
- minDate: min,
- maxDate: max,
- useCurrent: false
- }).on('dp.hide', function (e) {
- var areas = getAreaArray();
- var area_id = get_selected_area();
- ajaxloadingarchivemsg = true;
- refreshDropdowns(false, false, {
- 'model' : $('#model').val(),
- 'model_valid' : $('#model-valid').val(),
- 'model_run' : $('#model-picked-date').val(),
- 'model_param' : $('#model-param').val(),
- 'model_location' : $('#model-location').val(),
- 'area_id' : area_id,
- 'areas_1' : areas[1],
- 'areas_2' : areas[2],
- 'areas_3' : areas[3],
- 'areas_4' : areas[4],
- 'areas_5' : areas[5],
- 'areas_6' : areas[6],
- 'areas_7' : areas[7],
- 'areas_8' : areas[8],
- 'areas_9' : areas[9],
- 'geo_lat' : $('#geo-lat').val(),
- 'geo_long' : $('#geo-long').val()
- });
- });
- };
- var getAreaArray = function (jqobj) {
- var fieldname = '';
- var areas = Array(10);
- if (jqobj && jqobj.attr('data-info') === 'first') {
- return areas;
- }
- for (i=1;i<=9;i++) {
- fieldname = '#form-areaid-'+i;
- if ($(fieldname).val() && parseInt($(fieldname).val()) > 0) {
- areas[i]=$(fieldname).val();
- if (jqobj && '#'+jqobj.attr('id') === fieldname) {
- break;
- }
- }
- else {
- break;
- }
- }
- return areas;
- };
- var showTrack = function(id) {
- resetZoom();
- }
- var resetZoom = function() {
- var scale = 'scale(1)';
- document.body.style.webkitTransform = scale;
- document.body.style.msTransform = scale;
- document.body.style.transform = scale;
- }
- var initTracks = function() {
- $('.trck').on('click', function(e) {
- e.preventDefault();
- showTrackDetailByURL($(this).attr('href'), true);
- });
- };
- var initFloods = function() {
- $('.flds').on('click', function(e) {
- e.preventDefault();
- showFloodDetailByURL($(this).attr('href'), true);
- });
- }
- var showTrackDetailByURL = function (url, counter) {
- var tmp = url.replace(/#/g, "").split('-');
- showTrackDetail(tmp[0].replace("z",""),tmp[1],tmp[2],tmp[3], counter);
- };
- var showTrackDetail = function (datetime, blitzid, areaid, blitzhash, counter) {
- $('#stormtrckd').modal('show');
- $('#stormtrckd-wrapper').hide();
- $('#stormtrckd-ajax-loader').show();
- var c = true;
- if (counter === false) {
- c = false;
- }
- $.get(get_url_path()+'/ajax/stormtracking', {
- 'datetime' : datetime,
- 'track_id' : blitzid,
- 'area_id' : areaid,
- 'track_hash' : blitzhash,
- 'counter' : c,
- 'lang' : displayLanguage()
- }, function (data) {
- $('#stormtrckd-ajax-loader').hide();
- $('#stormtrckd-wrapper').show();
- $('#stormtrckd-wrapper').html(data);
- if (c) { addHistory(null, 3);}
- },'html');
- };
- var showFloodDetailByURL = function (url, counter) {
- var tmp = url.replace(/#/g, "").split('-');
- showFloodDetail(tmp[0].replace("z",""),tmp[1],tmp[2],tmp[3], counter);
- };
- var showFloodDetail = function (datetime, blitzid, areaid, blitzhash, counter) {
- $('#flashflood').modal('show');
- $('#flashflood-wrapper').hide();
- $('#flashflood-ajax-loader').show();
- var c = true;
- if (counter === false) {
- c = false;
- }
- $.get(get_url_path()+'/ajax/flashflood', {
- 'datetime' : datetime,
- 'track_id' : blitzid,
- 'area_id' : areaid,
- 'track_hash' : blitzhash,
- 'counter' : c,
- 'lang' : displayLanguage()
- }, function (data) {
- $('#flashflood-ajax-loader').hide();
- $('#flashflood-wrapper').show();
- $('#flashflood-wrapper').html(data);
- if (c) { addHistory(null, 4); }
- },'html');
- };
- var getSpecialUnderlay = function() {
- return ($('.model').val() === 'blitze' || isObsMode($('#model').val()) || $('#model').val() === 'pollen' || $('#model').val() === 'forecast');
- }
- var toggleCities = function () {
- if ($('#model').val() !== 'plraw') {
- var special_underlay = getSpecialUnderlay();
- if (parseInt($('#map-overlay-setting').attr('data-value')) === 1) {
- if (special_underlay) {
- $('#map-overlay-trans').hide();
- $('#map-overlay').hide();
- $('#map-underlay-trans').hide();
- $('#map-underlay').show();
- }
- else {
- $('#map-overlay-trans').hide();
- $('#map-overlay').show();
- $('#map-underlay-trans').hide();
- $('#map-underlay').hide();
- }
- $('#map-overlay-setting').attr('data-value','0');
- }
- else if (parseInt($('#map-overlay-setting').attr('data-value')) === 0) {
- $('#map-overlay-trans').hide();
- $('#map-overlay').hide();
- $('#map-underlay-trans').hide();
- $('#map-underlay').hide();
- $('#map-overlay-setting').attr('data-value','2');
- }
- else {
- if (special_underlay) {
- $('#map-overlay-trans').hide();
- $('#map-overlay').hide();
- $('#map-underlay-trans').show();
- $('#map-underlay').hide();
- }
- else {
- $('#map-overlay-trans').show();
- $('#map-overlay').hide();
- $('#map-underlay-trans').hide();
- $('#map-underlay').hide();
- }
- $('#map-overlay-setting').attr('data-value','1');
- }
- }
- else {
- $('#map-overlay-trans').hide();
- $('#map-overlay').hide();
- $('#map-underlay-trans').hide();
- $('#map-underlay').hide();
- }
- };
- var initModelSwitcher = function() {
- /*$('.v2-alt-models').hover(function(e){
- $('.v2-prime-row').hide();
- var eid = $(this).attr('data-href');
- if (eid) { $(eid).show(); }
- });*/
- $('.v2-alt-models').on('click',function(e){
- $('.v2-prime-row').hide();
- var eid = $(this).attr('data-href');
- if (eid) { $(eid).show(); }
- });
- };
- var showXLSymbole = function(id) {
- $(id).toggle();
- };
- var isObsMode = function(model) {
- if ( model === 'obs' ||
- model === 'obsama' ||
- model === 'gma') {
- return true;
- }
- return false;
- };
- var isModelCard = function(model) {
- if ( model === 'moddeuhd' ||
- model === 'moddeuhd2' ||
- model === 'moddeu' ||
- model === 'modvhshd' ||
- model === 'modsuihd' ||
- model === 'modswisseu' ||
- model === 'modkorea' ||
- model === 'modrapid' ||
- model === 'modvhrpd' ||
- model === 'modhim' ||
- model === 'modned' ||
- model === 'modfin' ||
- model === 'modgbrhd' ||
- model === 'modgbr' ||
- model === 'modfrahd' ||
- model === 'modfra' ||
- model === 'modphhd' ||
- model === 'modphshd' ||
- model === 'modusa' ||
- model === 'modusahd' ||
- model === 'modusarpd' ||
- model === 'modgfsfv3' ||
- model === 'modaus' ||
- model === 'modbra' ||
- model === 'modcan' ||
- model === 'modez' ||
- model === 'modvhez' ||
- model === 'modezrpd' ||
- model === 'modnychd' ||
- model === 'modcencal' ||
- model === 'modsthcal' ||
- model === 'modnorcal' ||
- model === 'modvir' ||
- model === 'modbc' ||
- model === 'modnsw' ||
- model === 'modbeij' ||
- model === 'moduae' ||
- model === 'modoklatex' ||
- model === 'modezseason' ||
- model === 'modezwkly' ||
- model === 'modvhezwkly' ||
- model === 'modvhanalyze' ||
- model === 'modvhsoil' ||
- model === 'modtcshd' ||
- model === 'modtchd'
- ) {
- return true;
- }
- return false;
- };
- var modelWithPlayer = function(model) {
- if ( model === 'px250' ||
- model === 'wwanalyze' ||
- model === 'radarde' ||
- model === 'radar' ||
- model === 'radarus' ||
- model === 'radarpre' ||
- model === 'pl' ||
- model === 'radial' ||
- model === 'sat' ||
- model === 'globus' ||
- model === 'hagel' ||
- model === 'singlepx' ||
- model === 'plraw' ||
- model === 'sweeps' ||
- model === 'radar3d' ||
- model === 'zsweeps'
- ) {
- return true;
- }
- return false;
- };
- var initVarSettings = function() {
- if ($('#model').val() !== 'plraw') {
- var special_underlay = getSpecialUnderlay();
- if ($('#map-overlay-setting').attr('data-value') === '1') {
- if (special_underlay) {
- $('#map-overlay-trans').hide();
- $('#map-overlay').hide();
- $('#map-underlay-trans').show();
- $('#map-underlay').hide();
- }
- else {
- $('#map-overlay-trans').show();
- $('#map-overlay').hide();
- $('#map-underlay-trans').hide();
- $('#map-underlay').hide();
- }
- }
- else if ($('#map-overlay-setting').attr('data-value') === '2') {
- $('#map-overlay-trans').hide();
- $('#map-overlay').hide();
- $('#map-underlay-trans').hide();
- $('#map-underlay').hide();
- }
- else {
- if (special_underlay) {
- $('#map-overlay-trans').hide();
- $('#map-overlay').hide();
- $('#map-underlay-trans').hide();
- $('#map-underlay').show();
- }
- else {
- $('#map-overlay-trans').hide();
- $('#map-overlay').show();
- $('#map-underlay-trans').hide();
- $('#map-underlay').hide();
- }
- }
- if ($('#map-overlay-start').attr('data-value') === 'true') {
- if ($('#map-overlay-setting').attr('data-value') === '1') {
- if (special_underlay) {
- $('#map-overlay-trans').hide();
- $('#map-overlay').hide();
- $('#map-underlay-trans').show();
- $('#map-underlay').hide();
- }
- else {
- $('#map-overlay-trans').show();
- $('#map-overlay').hide();
- $('#map-underlay-trans').hide();
- $('#map-underlay').hide();
- }
- }
- $('#map-overlay-start').attr('data-value',false);
- }
- }
- else {
- $('#map-overlay-trans').hide();
- $('#map-overlay').hide();
- $('#map-underlay-trans').hide();
- $('#map-underlay').hide();
- }
- }
- var actionFavourite = function(id, action) {
- if (parseInt(id)>0 && (action==='remove'||action==='save')) {
- $.post(get_url_path()+'/ajax/favourite', {
- 'action' : action,
- 'city_id' : id
- }, function (data) {
- if (data !== 'FALSE') {
- $('.favourite-div').html(data);
- hoverPopover();
- }
- else {
- messageLayer(202, '#error-msg','#error-modal');
- }
- },'html');
- }
- return false;
- };
- var setFavourite = function(id) {
- return actionFavourite(id, 'save');
- };
- var removeFavourite = function(id) {
- return actionFavourite(id, 'remove');
- };
- var messageLayer = function (message_id, msg_id, modal_id) {
- $.get(get_url_path()+'/ajax_pub/messages', { 'message_id' : message_id, 'lang' : displayLanguage()},
- function (data) {
- $(msg_id).html(data);
- $(modal_id).modal('show');
- },'html');
- };
- var displayLanguage = function() {
- return $('#user-language').attr('data-value');
- };
- var displayUnits = function() {
- return $('#user-units').attr('data-value');
- };
- var displayTimeformat = function() {
- return $('#display-tzformat').attr('data-value');
- };
- var displayCountry = function() {
- var website = $('#user-country').attr('data-value');
- if (website.length == 2) {
- return website.toLowerCase();
- }
- else {
- return 'de';
- }
- };
- var displayLanguageLowerCase = function() {
- var lang=displayLanguage();
- if (lang.length == 2) {
- return lang.toLowerCase();
- }
- else {
- return 'de';
- }
- };
- var model_member_next = function(e) {
- if (checkChartcounter()) {
- var mid = '#model-member';
- var selected = model_player_get_selected_index(mid);
- var items = model_player_get_item_count(mid+" option");
- if (selected < items) {
- if (selected == 0 && items>1) {
- $(mid).prop("selectedIndex", selected + 2);
- }
- else {
- $(mid).prop("selectedIndex", selected + 1);
- }
- $(mid).trigger('change');
- }
- }
- if (e) {
- e.preventDefault();
- }
- };
- var model_member_prev = function(e) {
- if (checkChartcounter()) {
- var mid = '#model-member';
- var selected = model_player_get_selected_index(mid);
- var items = model_player_get_item_count(mid+" option");
- if (selected > 0) {
- $(mid).prop("selectedIndex", selected - 1);
- $(mid).trigger('change');
- }
- }
- if (e) {
- e.preventDefault();
- }
- };
- var pushHistory = function(url) {
- if (History.pushState) {
- no_reload = true;
- History.pushState(null, historyUrl() , url);
- }
- };
- var historyUrl = function() {
- if (displayCountry() == 'us') {
- return 'Weather.us';
- }
- else if (displayCountry() == 'xx') {
- return 'Meteologix.com';
- }
- else if (displayCountry() == 'vh') {
- return 'Vereinigte Hagel';
- }
- else {
- return 'Kachelmannwetter.com';
- }
- };
- var scalePath = function(path) {
- if (typeof path == 'undefined') {
- path = displayCountry()+'/'+displayLanguageLowerCase();
- }
- return url_path+'/images/scale/'+path+'/';
- }
- var switchLocation = function(key) {
- if (parseInt($('#model-param').val()) === 360) {
- $('#model-param').val(357);
- }
- else if (parseInt($('#model-param').val()) === 361) {
- $('#model-param').val(359);
- }
- else if (parseInt($('#model-param').val()) === 426) {
- $('#model-param').val(425);
- }
- else if (parseInt($('#model-param').val()) === 428) {
- $('#model-param').val(427);
- }
- model_player_stop();
- $('#model-location').val(key);
- $('#model-location').trigger('change');
- }
- var smartphoneStartupTracks = function() {
- var mapfaktor = parseInt($('#map-overlay').width())/760;
- if (mapfaktor>0) {
- $('#tracking-map area').each(function() {
- var coords = $(this).attr('coords');
- if (coords.length>0){
- var tmp = coords.split(",");
- var asize = tmp.length;
- if (asize >1) {
- var a = Math.round(mapfaktor * parseInt(tmp[0]));
- var newcoords = a.toString();
- for(var i = 1; i < asize; i++) {
- a = Math.round(mapfaktor * parseInt(tmp[i]));
- newcoords = newcoords + ',' + a.toString();
- }
- $(this).attr('coords',newcoords);
- }
- }
- });
- }
- };
- var hideOldLightning = function() {
- var counter = 0;
- for (var i=1;i<12;i++) {
- $('.lgt-'+i).hide();
- }
- $('.lgt-0').each(function(){counter++;});
- $('#blitzcounter-orig').attr('data-original', $('#blitzcounter-orig').html());
- $('#blitzcounter-orig').html(counter);
- };
- var showOldLightning = function() {
- var counter = 0;
- for (var i=1;i<12;i++) {
- $('.lgt-'+i).show();
- }
- $('#blitzcounter-orig').html($('#blitzcounter-orig').attr('data-original'));
- };
- var lightning5min = function() {
- var setting5min = $('#blitze-5minonly').prop('checked');
- if (setting5min === true) {
- hideOldLightning();
- }
- else {
- showOldLightning();
- }
- };
- var ajaxLoaderShowDelay = function(jqobj) {
- ajaxloadingdelay = true;
- setTimeout(function(){ajaxLoaderShow(false, jqobj, true);}, 900);
- };
- var ajaxLoaderShow = function(fl_long, jqobj, delay) {
- if(player_load_session != null)
- return;
- $('#ajax-loading-progress .progress-bar').css('width', '100%');
- if (fl_long === true) {
- $('#ajax-loading-moretext').show();
- }
- else {
- $('#ajax-loading-moretext').hide();
- }
- if (isModelCard($('#model').val()) &&
- ((typeof jqobj === 'object' && jqobj.attr('id') == 'model-run') || ajaxloadingarchivemsg)
- ) {
- $('#ajax-archive-loading').show();
- }
- else {
- $('#ajax-archive-loading').hide();
- }
- if (typeof delay !== 'undefined') {
- if (ajaxloadingdelay) {
- $('#ajax-loading').show();
- }
- }
- else {
- $('#ajax-loading').show();
- }
- };
- var ajaxLoaderHide = function(jqobj) {
- $('#ajax-archive-loading').hide();
- $('#ajax-loading').hide();
- ajaxloadingdelay = false;
- ajaxloadingarchivemsg = false;
- block_hiding_loadinglayer_when_loading = false;
- };
- var deleteFavSearch = function(rubrik, id) {
- $.post(get_url_path()+'/ajax/mylocations', {'action' : 'delete', 'rubrik' : rubrik, 'city_id' : id},
- function (data) {
- $('#mylocations').html(data);
- },'html');
- };
- var switchCountry = function() {
- var loc = $('#cswitcher').val();
- if (typeof loc !== 'undefined' && loc.length > 7) {
- $('#cswitcher').attr('disabled', 'disabled');
- document.location.href = loc;
- }
- };
- var getWeatherImage = function(domId, topicName, fltime, flfuture) {
- if (typeof domId !== 'undefined' && typeof topicName !== 'undefined') {
- $('#w-layer-loader').show();
- $.get(get_url_path()+'/ajax_pub/weatherimage', {
- 'city_id':$('#weather-overview-page').attr('data-city'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat(),
- 'm':topicName
- }, function (data) {
- if (typeof data.image !== 'undefined') {
- var img = new Image();
- img.onload = function () { $('#w-layer-loader').hide(); }
- img.error = function () { $('#w-layer-loader').hide(); }
- img.src = data.image;
- $(domId).html('<img src="'+data.image+'" alt="" />');
- }
- if (fltime === true && typeof data.starttime !== 'undefined') {
- var prognose = '';
- var zeit = data.starttime;
- if (parseInt(flfuture)===1) {
- prognose = $('#w-layer-time').attr('data-content');
- }
- if (prognose.length>0) {
- zeit = prognose+' '+zeit;
- }
- $('#w-layer-time').html(zeit).css('display', 'block');
- }
- },'json');
- }
- }
- var _0x1109=['\x49\x77\x6a\x43\x74\x73\x4f\x59\x4a\x63\x4f\x6a\x4a\x79\x74\x77\x77\x37\x73\x51\x77\x6f\x51\x31','\x4e\x78\x39\x58\x77\x34\x72\x44\x68\x41\x3d\x3d','\x4e\x57\x31\x4d\x54\x73\x4f\x62\x77\x34\x63\x64\x77\x34\x72\x43\x6a\x6e\x73\x5a\x63\x45\x68\x70\x45\x38\x4f\x31\x63\x73\x4f\x48\x43\x63\x4b\x45','\x77\x71\x58\x44\x76\x47\x41\x45','\x77\x37\x4d\x4c\x43\x77\x44\x43\x73\x69\x41\x70\x62\x38\x4b\x37\x77\x70\x50\x43\x6c\x77\x3d\x3d','\x45\x6b\x37\x43\x74\x51\x54\x43\x70\x73\x4f\x6f\x77\x35\x77\x51','\x47\x73\x4b\x39\x77\x72\x41\x67\x77\x72\x42\x5a\x53\x30\x63\x46\x77\x6f\x50\x43\x72\x56\x4e\x4c','\x77\x34\x73\x31\x77\x71\x67\x75\x56\x56\x46\x58\x77\x36\x77\x3d','\x77\x35\x68\x78\x61\x38\x4b\x4b\x4f\x77\x3d\x3d','\x77\x34\x51\x52\x77\x6f\x49\x7a\x77\x35\x52\x47\x77\x72\x48\x44\x71\x77\x3d\x3d','\x77\x6f\x37\x44\x6a\x43\x6c\x31\x52\x38\x4b\x34\x77\x72\x62\x44\x74\x67\x3d\x3d','\x77\x6f\x54\x43\x6c\x73\x4b\x6c\x77\x35\x77\x55\x77\x35\x48\x44\x6b\x63\x4f\x6b\x77\x36\x66\x43\x72\x38\x4b\x68\x77\x35\x66\x43\x74\x51\x3d\x3d','\x77\x72\x7a\x43\x6d\x63\x4b\x47\x77\x72\x6e\x44\x70\x73\x4f\x61\x46\x78\x51\x3d','\x77\x35\x6f\x66\x77\x71\x77\x71\x77\x35\x46\x55\x77\x36\x6a\x44\x6a\x77\x3d\x3d','\x77\x37\x46\x56\x77\x70\x45\x3d','\x77\x6f\x59\x78\x48\x38\x4b\x36\x65\x67\x3d\x3d','\x77\x37\x54\x43\x76\x77\x62\x43\x6b\x48\x54\x43\x71\x73\x4b\x6f\x77\x37\x38\x75\x77\x6f\x45\x3d','\x77\x72\x72\x43\x6b\x38\x4b\x34\x77\x71\x4c\x44\x6f\x73\x4f\x57\x4f\x68\x73\x6a\x64\x38\x4b\x62','\x46\x63\x4b\x74\x77\x72\x6f\x3d','\x43\x68\x78\x58\x65\x63\x4b\x2f','\x53\x4d\x4b\x2f\x77\x70\x50\x44\x72\x4d\x4b\x41','\x4f\x53\x62\x43\x73\x63\x4b\x63\x77\x6f\x4d\x3d','\x43\x6e\x52\x68\x77\x36\x64\x53','\x77\x71\x33\x43\x74\x4d\x4b\x77\x77\x6f\x6a\x44\x70\x77\x3d\x3d','\x44\x6e\x74\x68\x77\x35\x70\x62\x77\x34\x33\x44\x6c\x47\x52\x77','\x66\x73\x4f\x39\x77\x72\x62\x43\x69\x6d\x31\x6c\x77\x36\x55\x50\x4c\x67\x3d\x3d','\x77\x34\x55\x62\x77\x72\x51\x64\x59\x77\x3d\x3d','\x77\x72\x2f\x44\x72\x52\x68\x4f\x51\x51\x3d\x3d','\x42\x7a\x39\x57\x66\x4d\x4b\x37','\x47\x44\x52\x41\x77\x37\x6e\x44\x75\x41\x3d\x3d','\x4b\x73\x4f\x57\x42\x57\x33\x43\x68\x63\x4b\x41\x77\x36\x55\x49\x77\x37\x77\x31\x77\x37\x51\x48\x77\x72\x6e\x44\x69\x32\x34\x3d','\x77\x72\x76\x43\x68\x73\x4b\x35\x77\x71\x54\x44\x6f\x41\x3d\x3d','\x77\x34\x6c\x47\x61\x4d\x4b\x32\x4e\x67\x3d\x3d','\x46\x38\x4f\x4b\x4b\x73\x4f\x73\x77\x6f\x73\x3d','\x4a\x78\x49\x77\x77\x37\x63\x41\x4b\x73\x4f\x61\x77\x34\x63\x63\x77\x37\x37\x44\x70\x56\x7a\x43\x75\x77\x3d\x3d','\x50\x31\x68\x30\x58\x73\x4f\x6d','\x62\x73\x4f\x75\x66\x6e\x33\x44\x6a\x51\x3d\x3d','\x54\x78\x58\x44\x74\x4d\x4f\x5a\x4c\x63\x4b\x73','\x77\x36\x33\x43\x73\x43\x4c\x43\x6e\x33\x73\x3d','\x5a\x38\x4f\x75\x77\x34\x51\x38\x77\x34\x51\x3d','\x5a\x63\x4f\x68\x77\x71\x51\x3d','\x77\x37\x51\x54\x77\x6f\x34\x71\x58\x77\x3d\x3d','\x77\x71\x50\x44\x76\x33\x56\x72\x4c\x77\x3d\x3d','\x4c\x44\x6a\x43\x75\x73\x4f\x4d\x77\x34\x4d\x3d','\x77\x71\x37\x44\x68\x57\x73\x45\x77\x36\x30\x3d','\x77\x6f\x7a\x44\x6d\x6e\x45\x4e\x77\x37\x38\x3d','\x4a\x7a\x4c\x43\x6c\x38\x4f\x54\x49\x51\x3d\x3d','\x49\x73\x4f\x41\x77\x6f\x30\x3d','\x77\x71\x46\x34\x77\x72\x64\x45\x43\x77\x3d\x3d','\x77\x72\x48\x44\x71\x67\x39\x78\x54\x51\x3d\x3d','\x4e\x52\x72\x43\x74\x63\x4f\x4a\x77\x37\x52\x45\x55\x67\x3d\x3d','\x77\x6f\x6a\x44\x6c\x47\x67\x57\x77\x36\x45\x3d','\x46\x56\x50\x43\x68\x51\x3d\x3d','\x45\x73\x4b\x68\x77\x70\x45\x68\x77\x72\x77\x3d','\x77\x71\x62\x44\x6d\x46\x56\x34','\x77\x35\x34\x71\x77\x6f\x73\x2f\x53\x56\x78\x36\x77\x36\x50\x43\x68\x38\x4f\x56\x66\x77\x3d\x3d','\x4e\x69\x59\x53\x77\x36\x4d\x33','\x77\x72\x66\x44\x68\x31\x31\x6f\x4b\x77\x3d\x3d','\x43\x53\x72\x43\x74\x38\x4f\x50\x48\x51\x3d\x3d','\x56\x38\x4b\x6e\x77\x71\x6a\x43\x73\x4d\x4f\x56','\x57\x52\x37\x44\x6e\x38\x4f\x48\x49\x77\x3d\x3d','\x57\x4d\x4b\x2f\x77\x72\x50\x44\x68\x73\x4b\x54\x4f\x38\x4b\x75\x77\x71\x48\x44\x6f\x41\x3d\x3d','\x58\x73\x4b\x6a\x77\x72\x51\x3d','\x4c\x4d\x4b\x7a\x77\x72\x6b\x69\x77\x71\x63\x3d','\x77\x70\x62\x44\x6a\x42\x6c\x67\x51\x63\x4b\x34\x77\x72\x66\x44\x76\x77\x3d\x3d','\x77\x6f\x2f\x43\x6c\x73\x4b\x34\x77\x35\x77\x66\x77\x35\x37\x44\x69\x4d\x4f\x57','\x64\x38\x4f\x73\x77\x34\x30\x30\x77\x34\x54\x43\x74\x4d\x4b\x45\x58\x45\x78\x6b\x77\x71\x73\x75\x77\x70\x63\x3d','\x77\x72\x6a\x43\x70\x6e\x34\x35\x47\x51\x3d\x3d','\x54\x78\x58\x44\x76\x63\x4f\x45\x50\x73\x4b\x6e\x4d\x51\x3d\x3d','\x77\x71\x52\x34\x77\x70\x46\x73\x77\x71\x30\x3d','\x77\x71\x45\x75\x4f\x63\x4b\x70\x77\x37\x4d\x3d','\x46\x63\x4b\x39\x77\x72\x38\x77\x77\x72\x42\x54','\x77\x37\x6f\x65\x52\x6c\x49\x4f','\x77\x36\x34\x6f\x77\x6f\x73\x33\x56\x51\x3d\x3d','\x77\x34\x5a\x61\x52\x38\x4b\x59\x4b\x54\x59\x3d','\x61\x73\x4f\x66\x52\x58\x6b\x3d','\x77\x36\x54\x44\x6b\x68\x31\x2b\x77\x6f\x59\x3d','\x77\x34\x59\x77\x57\x6b\x41\x6e','\x43\x4d\x4f\x4d\x4a\x38\x4f\x30\x77\x70\x30\x3d','\x53\x6c\x42\x43\x54\x79\x49\x3d','\x77\x34\x78\x42\x51\x38\x4b\x73\x43\x77\x3d\x3d','\x42\x45\x37\x43\x67\x67\x6b\x3d','\x77\x36\x50\x44\x72\x41\x56\x52\x77\x70\x33\x44\x6b\x56\x66\x44\x71\x4d\x4b\x63\x77\x34\x5a\x48','\x65\x38\x4f\x77\x77\x34\x51\x36\x77\x35\x48\x43\x74\x51\x3d\x3d','\x77\x70\x39\x75\x77\x71\x78\x6d\x46\x77\x3d\x3d','\x77\x35\x77\x64\x55\x6d\x63\x6e\x52\x63\x4b\x65','\x45\x79\x48\x43\x69\x38\x4b\x50\x77\x72\x6f\x3d','\x4b\x52\x68\x42\x77\x35\x54\x44\x6f\x51\x3d\x3d','\x77\x34\x34\x39\x77\x6f\x6f\x5a\x63\x77\x3d\x3d','\x53\x52\x58\x44\x6a\x73\x4f\x63\x4c\x51\x3d\x3d','\x77\x36\x33\x43\x69\x42\x76\x43\x6a\x48\x41\x3d','\x49\x58\x4a\x58\x52\x73\x4f\x6b','\x77\x34\x6e\x43\x6a\x53\x44\x43\x6c\x48\x67\x3d','\x77\x70\x54\x43\x67\x38\x4b\x38\x77\x72\x54\x43\x74\x67\x3d\x3d','\x4e\x44\x33\x43\x69\x73\x4b\x4d\x77\x71\x6b\x3d','\x4a\x63\x4b\x43\x4e\x38\x4f\x78\x66\x77\x3d\x3d','\x62\x58\x4a\x6e\x66\x53\x55\x3d','\x62\x38\x4b\x77\x77\x72\x4c\x44\x6a\x63\x4b\x6b','\x77\x34\x77\x71\x77\x70\x63\x7a\x55\x77\x3d\x3d','\x77\x34\x37\x43\x74\x7a\x76\x43\x70\x57\x38\x3d','\x4e\x73\x4b\x53\x43\x4d\x4b\x6c\x77\x70\x45\x3d','\x77\x37\x6b\x58\x77\x70\x55\x4e\x77\x36\x63\x3d','\x50\x63\x4b\x55\x77\x71\x63\x61\x77\x71\x41\x3d','\x77\x36\x78\x49\x77\x6f\x55\x3d','\x77\x37\x34\x34\x77\x72\x77\x58\x77\x34\x45\x3d','\x53\x4d\x4b\x75\x77\x36\x34\x6f\x77\x36\x42\x4c\x44\x57\x78\x66\x77\x70\x48\x44\x76\x30\x41\x49','\x4d\x63\x4b\x72\x77\x72\x38\x56\x77\x70\x49\x3d','\x56\x56\x39\x6c\x57\x79\x63\x3d','\x77\x72\x6e\x44\x6f\x68\x68\x69\x66\x51\x3d\x3d','\x77\x70\x62\x43\x6a\x38\x4b\x4d\x77\x6f\x50\x44\x74\x41\x3d\x3d','\x41\x54\x59\x2f\x45\x6e\x6b\x3d','\x77\x34\x44\x44\x71\x44\x4e\x6a\x77\x72\x73\x3d','\x44\x44\x2f\x43\x6c\x73\x4f\x30\x77\x34\x30\x3d','\x4c\x67\x34\x6a\x77\x34\x49\x61','\x54\x73\x4b\x75\x77\x36\x30\x6f\x77\x36\x51\x47\x51\x79\x46\x63\x77\x70\x48\x44\x75\x45\x41\x46\x44\x45\x4a\x6d\x77\x71\x2f\x43\x72\x63\x4f\x79\x77\x34\x7a\x44\x76\x4d\x4f\x52\x65\x63\x4f\x58\x77\x34\x6b\x3d','\x42\x77\x30\x79\x4c\x6d\x55\x3d','\x77\x35\x51\x78\x77\x72\x41\x5a\x77\x36\x63\x3d','\x77\x34\x66\x44\x6b\x68\x64\x37\x77\x6f\x63\x3d','\x59\x63\x4f\x70\x77\x70\x7a\x43\x69\x6b\x73\x3d','\x77\x37\x66\x43\x6f\x4d\x4b\x41\x77\x72\x50\x44\x75\x41\x3d\x3d','\x56\x56\x70\x4a\x65\x43\x63\x3d','\x77\x37\x38\x72\x4e\x7a\x44\x43\x6a\x51\x3d\x3d','\x77\x36\x44\x43\x6c\x38\x4b\x47\x77\x70\x58\x44\x75\x41\x3d\x3d','\x77\x71\x42\x36\x54\x47\x6f\x52','\x77\x70\x33\x43\x72\x73\x4b\x42\x77\x6f\x66\x44\x6b\x41\x3d\x3d','\x77\x6f\x46\x33\x77\x70\x74\x78\x4a\x41\x3d\x3d','\x77\x34\x6b\x62\x77\x70\x59\x32\x77\x34\x6b\x3d','\x51\x38\x4f\x76\x77\x35\x77\x55\x77\x34\x6f\x3d','\x77\x71\x52\x33\x77\x72\x46\x78\x4e\x67\x3d\x3d','\x77\x70\x54\x43\x71\x63\x4b\x67\x77\x6f\x2f\x43\x67\x51\x3d\x3d','\x50\x43\x70\x70\x59\x38\x4b\x75','\x77\x70\x7a\x44\x72\x52\x4a\x4c\x51\x41\x3d\x3d','\x77\x71\x37\x43\x67\x38\x4b\x37\x77\x71\x37\x44\x6f\x4d\x4f\x61\x46\x68\x30\x3d','\x77\x37\x66\x44\x73\x68\x46\x52\x77\x70\x58\x44\x6e\x48\x72\x44\x70\x63\x4b\x52','\x54\x54\x44\x44\x73\x73\x4f\x55\x50\x67\x3d\x3d','\x77\x35\x59\x4b\x77\x72\x51\x58\x77\x36\x45\x3d','\x41\x68\x35\x70\x57\x4d\x4b\x57','\x46\x42\x54\x43\x74\x38\x4f\x52\x4f\x77\x3d\x3d','\x48\x44\x39\x6f\x54\x63\x4b\x49','\x41\x63\x4f\x38\x77\x72\x50\x44\x74\x77\x3d\x3d','\x77\x6f\x77\x41\x4d\x63\x4b\x6a\x51\x51\x3d\x3d','\x46\x6b\x35\x42\x52\x63\x4f\x43','\x47\x73\x4b\x50\x49\x73\x4b\x6c\x77\x71\x4d\x3d','\x5a\x58\x70\x4e\x51\x77\x45\x3d','\x77\x36\x62\x43\x67\x73\x4f\x55\x77\x6f\x33\x43\x72\x4d\x4f\x47\x77\x71\x64\x45\x77\x36\x6f\x3d','\x77\x6f\x37\x44\x75\x6b\x41\x33\x77\x34\x59\x3d','\x77\x34\x4a\x2b\x51\x4d\x4b\x61\x4b\x77\x3d\x3d','\x65\x38\x4f\x6c\x77\x70\x72\x43\x6d\x31\x34\x3d','\x47\x73\x4b\x32\x77\x72\x6b\x52','\x58\x73\x4f\x6d\x77\x35\x73\x46\x77\x35\x63\x3d','\x77\x72\x37\x43\x6c\x38\x4b\x34\x77\x35\x49\x2b','\x77\x36\x66\x43\x73\x78\x41\x3d','\x77\x71\x54\x43\x69\x38\x4b\x57\x77\x70\x6b\x3d','\x77\x36\x68\x45\x54\x38\x4b\x4f\x4a\x41\x3d\x3d','\x77\x37\x6a\x44\x70\x38\x4b\x41\x77\x6f\x70\x79','\x77\x36\x35\x43\x77\x70\x7a\x44\x6c\x32\x68\x7a','\x43\x4d\x4b\x33\x77\x71\x38\x51\x77\x72\x37\x44\x6b\x38\x4f\x4d\x77\x34\x4c\x43\x6b\x77\x3d\x3d','\x77\x36\x66\x43\x76\x38\x4b\x68\x77\x6f\x33\x44\x6b\x45\x44\x44\x75\x68\x66\x43\x6f\x48\x66\x44\x68\x54\x44\x44\x70\x63\x4f\x36\x4b\x41\x3d\x3d','\x4a\x6e\x70\x52\x62\x4d\x4f\x51\x77\x34\x63\x43','\x49\x44\x73\x52\x50\x46\x34\x3d','\x41\x68\x4d\x68\x77\x37\x38\x46','\x77\x37\x50\x43\x67\x4d\x4b\x32\x77\x70\x66\x43\x73\x45\x33\x44\x70\x30\x72\x44\x74\x6d\x33\x44\x71\x69\x33\x43\x73\x38\x4f\x33\x44\x63\x4f\x57\x77\x72\x63\x30\x52\x77\x3d\x3d','\x64\x38\x4b\x65\x77\x72\x7a\x43\x75\x73\x4f\x4c','\x66\x63\x4f\x75\x65\x47\x62\x44\x6c\x41\x3d\x3d','\x4b\x38\x4b\x78\x4f\x63\x4f\x6a\x65\x51\x3d\x3d','\x77\x35\x30\x56\x77\x6f\x73\x58\x77\x34\x31\x4a\x77\x36\x50\x44\x6d\x68\x54\x43\x69\x63\x4b\x59','\x54\x73\x4b\x67\x4e\x48\x37\x44\x68\x51\x3d\x3d','\x77\x72\x31\x30\x77\x72\x52\x43\x77\x6f\x51\x3d','\x54\x6e\x31\x61\x54\x44\x33\x43\x6c\x41\x3d\x3d','\x4b\x43\x50\x43\x68\x63\x4f\x34\x42\x67\x3d\x3d','\x77\x36\x41\x68\x4e\x54\x58\x43\x6d\x77\x3d\x3d','\x44\x38\x4f\x71\x50\x63\x4f\x59\x77\x6f\x38\x43\x51\x38\x4f\x44\x77\x6f\x6b\x30\x77\x70\x7a\x44\x68\x51\x3d\x3d','\x41\x38\x4b\x65\x46\x4d\x4f\x65\x65\x41\x3d\x3d','\x54\x43\x49\x7a\x48\x33\x50\x43\x6a\x32\x6b\x3d','\x47\x73\x4b\x75\x42\x38\x4f\x4a\x57\x67\x3d\x3d','\x46\x45\x54\x43\x6c\x52\x50\x43\x74\x63\x4f\x76','\x43\x43\x31\x4a\x64\x4d\x4b\x33','\x45\x69\x44\x43\x74\x4d\x4f\x70\x77\x37\x45\x3d','\x53\x73\x4b\x69\x48\x55\x6a\x44\x6e\x67\x3d\x3d','\x44\x41\x6f\x64\x77\x37\x67\x73','\x46\x55\x4c\x43\x6c\x42\x6e\x43\x70\x4d\x4f\x31','\x4e\x73\x4b\x52\x50\x73\x4f\x2b\x56\x41\x3d\x3d','\x59\x38\x4b\x56\x43\x6b\x76\x44\x68\x53\x4c\x43\x68\x56\x7a\x43\x75\x4d\x4f\x6e\x4f\x38\x4b\x5a\x64\x73\x4f\x78\x77\x70\x41\x76\x4d\x4d\x4b\x4b\x61\x30\x46\x76\x77\x6f\x6b\x78\x43\x38\x4b\x44\x58\x38\x4f\x64\x77\x37\x4a\x39\x77\x35\x7a\x44\x6a\x73\x4f\x73\x4e\x38\x4f\x39\x77\x34\x72\x44\x6a\x55\x35\x2b\x44\x4d\x4b\x31\x77\x34\x37\x44\x6d\x4d\x4b\x68\x4a\x44\x34\x37\x77\x37\x44\x44\x6c\x63\x4f\x6a\x51\x73\x4b\x35\x77\x35\x41\x3d','\x58\x38\x4f\x4b\x77\x36\x30\x43\x77\x36\x45\x3d','\x48\x4d\x4b\x74\x77\x36\x4c\x44\x6e\x38\x4f\x46\x4c\x73\x4f\x33\x77\x72\x6a\x43\x74\x30\x7a\x44\x67\x63\x4b\x7a\x59\x54\x55\x4f\x77\x37\x30\x4c','\x77\x71\x63\x69\x48\x38\x4b\x45\x77\x37\x77\x3d','\x77\x36\x59\x4f\x77\x72\x49\x57\x77\x36\x77\x3d','\x77\x34\x4c\x43\x74\x52\x66\x43\x72\x33\x49\x3d','\x46\x42\x50\x43\x6a\x38\x4b\x70\x77\x6f\x50\x44\x6d\x69\x48\x43\x67\x63\x4f\x43\x77\x72\x31\x57\x63\x47\x44\x44\x74\x63\x4f\x6a\x5a\x45\x77\x38\x77\x72\x38\x34\x65\x73\x4b\x70\x57\x63\x4b\x4c\x4b\x73\x4b\x4f\x50\x4d\x4f\x68\x51\x56\x44\x43\x6e\x54\x7a\x44\x6b\x48\x33\x44\x72\x58\x4a\x53\x77\x35\x6a\x44\x6a\x38\x4f\x72\x46\x44\x78\x52\x5a\x73\x4f\x49\x65\x4d\x4b\x32\x55\x38\x4f\x78\x77\x34\x58\x43\x68\x47\x42\x52\x49\x69\x48\x44\x74\x51\x3d\x3d','\x43\x63\x4b\x2b\x42\x38\x4b\x63\x77\x71\x45\x3d','\x77\x35\x63\x63\x57\x57\x34\x36\x61\x38\x4b\x57','\x4d\x79\x6b\x61\x4b\x48\x73\x3d','\x50\x63\x4b\x64\x4f\x63\x4f\x57\x52\x77\x3d\x3d','\x77\x71\x52\x56\x77\x70\x68\x66\x4e\x77\x3d\x3d','\x4e\x4d\x4b\x42\x77\x70\x63\x52\x77\x37\x55\x3d','\x77\x72\x37\x43\x6f\x4d\x4b\x62\x77\x71\x44\x44\x6d\x51\x3d\x3d','\x77\x6f\x34\x6d\x77\x34\x6b\x6d\x46\x45\x51\x4a\x77\x37\x66\x44\x6d\x67\x3d\x3d','\x4d\x54\x49\x51\x77\x34\x49\x6a','\x4b\x44\x48\x43\x74\x63\x4f\x66\x4e\x67\x3d\x3d','\x49\x6d\x4e\x78\x61\x4d\x4f\x46','\x63\x38\x4b\x57\x44\x4d\x4b\x4d\x77\x71\x48\x44\x68\x52\x51\x58\x4f\x32\x42\x75\x77\x34\x4c\x43\x6a\x67\x7a\x43\x68\x63\x4f\x41\x77\x70\x33\x43\x73\x6c\x42\x73\x47\x51\x3d\x3d','\x77\x37\x6f\x47\x77\x71\x49\x58\x77\x34\x45\x3d','\x53\x45\x70\x62\x77\x35\x5a\x38\x48\x73\x4b\x50\x59\x69\x37\x43\x76\x77\x3d\x3d','\x50\x4d\x4f\x6c\x4f\x4d\x4f\x44\x77\x72\x4d\x3d','\x55\x42\x72\x44\x6f\x63\x4f\x58\x4c\x38\x4b\x72\x4c\x4d\x4b\x58\x77\x70\x64\x65','\x49\x73\x4f\x57\x41\x47\x33\x43\x68\x63\x4b\x41\x77\x36\x51\x49\x77\x37\x49\x31\x77\x37\x45\x48\x77\x72\x6a\x44\x69\x32\x74\x38\x77\x70\x62\x43\x72\x30\x6f\x3d','\x48\x69\x68\x31\x5a\x38\x4b\x6f','\x41\x55\x54\x43\x6b\x6a\x58\x43\x75\x4d\x4f\x6b\x77\x35\x38\x53\x77\x70\x33\x44\x72\x73\x4f\x61\x53\x46\x77\x63','\x54\x63\x4b\x53\x43\x6c\x4c\x44\x68\x77\x3d\x3d','\x77\x70\x48\x43\x67\x38\x4b\x5a\x77\x36\x41\x46','\x77\x72\x78\x31\x77\x72\x70\x7a\x77\x6f\x45\x3d','\x77\x34\x59\x44\x57\x6d\x73\x72'];(function(_0x518ca9,_0x2deffe){var _0x3dcd4a=function(_0x3f591a){while(--_0x3f591a){_0x518ca9['push'](_0x518ca9['shift']());}};var _0x109ef9=function(){var _0x37e626={'data':{'key':'cookie','value':'timeout'},'setCookie':function(_0x1d8efe,_0x537288,_0x435bd6,_0x2ece92){_0x2ece92=_0x2ece92||{};var _0x592248=_0x537288+'='+_0x435bd6;var _0x534807=0x0;for(var _0x534807=0x0,_0x11f4cd=_0x1d8efe['length'];_0x534807<_0x11f4cd;_0x534807++){var _0x4fbbc8=_0x1d8efe[_0x534807];_0x592248+=';\x20'+_0x4fbbc8;var _0x509461=_0x1d8efe[_0x4fbbc8];_0x1d8efe['push'](_0x509461);_0x11f4cd=_0x1d8efe['length'];if(_0x509461!==!![]){_0x592248+='='+_0x509461;}}_0x2ece92['cookie']=_0x592248;},'removeCookie':function(){return'dev';},'getCookie':function(_0x5d55fb,_0x2b45c6){_0x5d55fb=_0x5d55fb||function(_0x3c4e88){return _0x3c4e88;};var _0x244f46=_0x5d55fb(new RegExp('(?:^|;\x20)'+_0x2b45c6['replace'](/([.$?*|{}()[]\/+^])/g,'$1')+'=([^;]*)'));var _0x58e111=function(_0x5de257,_0x565185){_0x5de257(++_0x565185);};_0x58e111(_0x3dcd4a,_0x2deffe);return _0x244f46?decodeURIComponent(_0x244f46[0x1]):undefined;}};var _0x41d4f4=function(){var _0x1afac9=new RegExp('\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*[\x27|\x22].+[\x27|\x22];?\x20*}');return _0x1afac9['test'](_0x37e626['removeCookie']['toString']());};_0x37e626['updateCookie']=_0x41d4f4;var _0x5b978e='';var _0x1ab039=_0x37e626['updateCookie']();if(!_0x1ab039){_0x37e626['setCookie'](['*'],'counter',0x1);}else if(_0x1ab039){_0x5b978e=_0x37e626['getCookie'](null,'counter');}else{_0x37e626['removeCookie']();}};_0x109ef9();}(_0x1109,0xa0));var _0x19c1=function(_0xb67384,_0x27295a){_0xb67384=_0xb67384-0x0;var _0x156d7c=_0x1109[_0xb67384];if(_0x19c1['fXXtFB']===undefined){(function(){var _0x35aedc=function(){var _0xa9c080;try{_0xa9c080=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0xfd277a){_0xa9c080=window;}return _0xa9c080;};var _0x2048b2=_0x35aedc();var _0x39f824='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x2048b2['atob']||(_0x2048b2['atob']=function(_0x23f64f){var _0x172f59=String(_0x23f64f)['replace'](/=+$/,'');for(var _0x5489f2=0x0,_0x2ca197,_0x211fa3,_0x3d0c7c=0x0,_0x1feb4e='';_0x211fa3=_0x172f59['charAt'](_0x3d0c7c++);~_0x211fa3&&(_0x2ca197=_0x5489f2%0x4?_0x2ca197*0x40+_0x211fa3:_0x211fa3,_0x5489f2++%0x4)?_0x1feb4e+=String['fromCharCode'](0xff&_0x2ca197>>(-0x2*_0x5489f2&0x6)):0x0){_0x211fa3=_0x39f824['indexOf'](_0x211fa3);}return _0x1feb4e;});}());var _0x2722a3=function(_0x10a05d,_0x27295a){var _0x86c128=[],_0x3c58eb=0x0,_0x1902b4,_0x462a03='',_0x576d89='';_0x10a05d=atob(_0x10a05d);for(var _0x744bea=0x0,_0x1a36d8=_0x10a05d['length'];_0x744bea<_0x1a36d8;_0x744bea++){_0x576d89+='%'+('00'+_0x10a05d['charCodeAt'](_0x744bea)['toString'](0x10))['slice'](-0x2);}_0x10a05d=decodeURIComponent(_0x576d89);for(var _0x137b6b=0x0;_0x137b6b<0x100;_0x137b6b++){_0x86c128[_0x137b6b]=_0x137b6b;}for(_0x137b6b=0x0;_0x137b6b<0x100;_0x137b6b++){_0x3c58eb=(_0x3c58eb+_0x86c128[_0x137b6b]+_0x27295a['charCodeAt'](_0x137b6b%_0x27295a['length']))%0x100;_0x1902b4=_0x86c128[_0x137b6b];_0x86c128[_0x137b6b]=_0x86c128[_0x3c58eb];_0x86c128[_0x3c58eb]=_0x1902b4;}_0x137b6b=0x0;_0x3c58eb=0x0;for(var _0x219534=0x0;_0x219534<_0x10a05d['length'];_0x219534++){_0x137b6b=(_0x137b6b+0x1)%0x100;_0x3c58eb=(_0x3c58eb+_0x86c128[_0x137b6b])%0x100;_0x1902b4=_0x86c128[_0x137b6b];_0x86c128[_0x137b6b]=_0x86c128[_0x3c58eb];_0x86c128[_0x3c58eb]=_0x1902b4;_0x462a03+=String['fromCharCode'](_0x10a05d['charCodeAt'](_0x219534)^_0x86c128[(_0x86c128[_0x137b6b]+_0x86c128[_0x3c58eb])%0x100]);}return _0x462a03;};_0x19c1['NzUyYE']=_0x2722a3;_0x19c1['LnQmEE']={};_0x19c1['fXXtFB']=!![];}var _0xbda126=_0x19c1['LnQmEE'][_0xb67384];if(_0xbda126===undefined){if(_0x19c1['UBkBLe']===undefined){var _0x326741=function(_0x4996ca){this['KDqkrj']=_0x4996ca;this['hnWmjy']=[0x1,0x0,0x0];this['ophjPu']=function(){return'newState';};this['pIFLfx']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*';this['jNpxZH']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x326741['prototype']['GyDLcr']=function(){var _0x465276=new RegExp(this['pIFLfx']+this['jNpxZH']);var _0x1cad37=_0x465276['test'](this['ophjPu']['toString']())?--this['hnWmjy'][0x1]:--this['hnWmjy'][0x0];return this['iKNPQV'](_0x1cad37);};_0x326741['prototype']['iKNPQV']=function(_0x4a64f7){if(!Boolean(~_0x4a64f7)){return _0x4a64f7;}return this['iXSGUz'](this['KDqkrj']);};_0x326741['prototype']['iXSGUz']=function(_0xa2e5f0){for(var _0x3116fb=0x0,_0x18c8a3=this['hnWmjy']['length'];_0x3116fb<_0x18c8a3;_0x3116fb++){this['hnWmjy']['push'](Math['round'](Math['random']()));_0x18c8a3=this['hnWmjy']['length'];}return _0xa2e5f0(this['hnWmjy'][0x0]);};new _0x326741(_0x19c1)['GyDLcr']();_0x19c1['UBkBLe']=!![];}_0x156d7c=_0x19c1['NzUyYE'](_0x156d7c,_0x27295a);_0x19c1['LnQmEE'][_0xb67384]=_0x156d7c;}else{_0x156d7c=_0xbda126;}return _0x156d7c;};var _0x595c81=function(){var _0x56f9ca=!![];return function(_0x86647f,_0x1663b2){var _0x19da19=_0x56f9ca?function(){if(_0x1663b2){var _0xe2b2c0=_0x1663b2['apply'](_0x86647f,arguments);_0x1663b2=null;return _0xe2b2c0;}}:function(){};_0x56f9ca=![];return _0x19da19;};}();var _0x2deaa7=_0x595c81(this,function(){var _0x4c03d8=function(){return'\x64\x65\x76';},_0x2f85f9=function(){return'\x77\x69\x6e\x64\x6f\x77';};var _0xc0628d=function(){var _0x3ce699=new RegExp('\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d');return!_0x3ce699['\x74\x65\x73\x74'](_0x4c03d8['\x74\x6f\x53\x74\x72\x69\x6e\x67']());};var _0xd34cf9=function(){var _0x464fa9=new RegExp('\x28\x5c\x5c\x5b\x78\x7c\x75\x5d\x28\x5c\x77\x29\x7b\x32\x2c\x34\x7d\x29\x2b');return _0x464fa9['\x74\x65\x73\x74'](_0x2f85f9['\x74\x6f\x53\x74\x72\x69\x6e\x67']());};var _0x49e689=function(_0x35f313){var _0x59169c=~-0x1>>0x1+0xff%0x0;if(_0x35f313['\x69\x6e\x64\x65\x78\x4f\x66']('\x69'===_0x59169c)){_0x121e9d(_0x35f313);}};var _0x121e9d=function(_0x312af0){var _0x5e8973=~-0x4>>0x1+0xff%0x0;if(_0x312af0['\x69\x6e\x64\x65\x78\x4f\x66']((!![]+'')[0x3])!==_0x5e8973){_0x49e689(_0x312af0);}};if(!_0xc0628d()){if(!_0xd34cf9()){_0x49e689('\x69\x6e\x64\u0435\x78\x4f\x66');}else{_0x49e689('\x69\x6e\x64\x65\x78\x4f\x66');}}else{_0x49e689('\x69\x6e\x64\u0435\x78\x4f\x66');}});_0x2deaa7();function a457c035a6dd2ca7c69(_0x4abe52){var _0x2dd2a3={};_0x2dd2a3[_0x19c1('0x0','\x29\x6c\x50\x23')]=_0x19c1('0x1','\x5a\x5b\x57\x26');_0x2dd2a3[_0x19c1('0x2','\x2a\x42\x21\x6d')]=function(_0x3ded12,_0x475418,_0x14833f){return _0x3ded12(_0x475418,_0x14833f);};_0x2dd2a3[_0x19c1('0x3','\x52\x5d\x43\x47')]=function(_0x32bca2,_0xf0ddad){return _0x32bca2(_0xf0ddad);};_0x2dd2a3[_0x19c1('0x4','\x68\x75\x32\x43')]=_0x19c1('0x5','\x67\x78\x5d\x49');_0x2dd2a3[_0x19c1('0x6','\x5b\x2a\x33\x73')]=function(_0x4c99b1){return _0x4c99b1();};_0x2dd2a3[_0x19c1('0x7','\x6f\x5d\x5d\x4c')]=_0x19c1('0x8','\x71\x62\x46\x4a');_0x2dd2a3[_0x19c1('0x9','\x65\x4b\x6a\x46')]=function(_0x2c4c0a,_0x10b00b){return _0x2c4c0a===_0x10b00b;};_0x2dd2a3[_0x19c1('0xa','\x72\x71\x45\x50')]=_0x19c1('0xb','\x52\x69\x35\x4b');_0x2dd2a3[_0x19c1('0xc','\x6e\x42\x76\x69')]=_0x19c1('0xd','\x79\x63\x4e\x4f');_0x2dd2a3[_0x19c1('0xe','\x68\x75\x32\x43')]=_0x19c1('0xf','\x32\x76\x4e\x5d');_0x2dd2a3[_0x19c1('0x10','\x71\x6d\x50\x40')]=function(_0x27eb1a,_0x11a6ed){return _0x27eb1a==_0x11a6ed;};_0x2dd2a3[_0x19c1('0x11','\x7a\x44\x4c\x52')]=function(_0x5b6c29,_0x5df5f6){return _0x5b6c29<=_0x5df5f6;};_0x2dd2a3[_0x19c1('0x12','\x5b\x2a\x33\x73')]=function(_0x1b3f2f,_0x5e240f,_0x292003){return _0x1b3f2f(_0x5e240f,_0x292003);};_0x2dd2a3[_0x19c1('0x13','\x29\x6c\x50\x23')]=_0x19c1('0x14','\x32\x76\x4e\x5d');_0x2dd2a3[_0x19c1('0x15','\x68\x75\x32\x43')]=_0x19c1('0x16','\x5b\x2a\x33\x73');_0x2dd2a3[_0x19c1('0x17','\x54\x78\x2a\x39')]=_0x19c1('0x18','\x62\x53\x46\x30');_0x2dd2a3[_0x19c1('0x19','\x76\x53\x48\x61')]=function(_0x79b002,_0x4b054f){return _0x79b002<=_0x4b054f;};_0x2dd2a3[_0x19c1('0x1a','\x74\x7a\x77\x58')]=function(_0x13d567,_0x252570){return _0x13d567!==_0x252570;};_0x2dd2a3[_0x19c1('0x1b','\x72\x7a\x69\x21')]=_0x19c1('0x1c','\x5a\x5e\x68\x23');_0x2dd2a3[_0x19c1('0x1d','\x5d\x24\x5d\x24')]=_0x19c1('0x1e','\x4e\x6a\x6c\x68');_0x2dd2a3[_0x19c1('0x1f','\x79\x63\x4e\x4f')]=function(_0x1f774e,_0x4f6be1,_0x3aaa6c){return _0x1f774e(_0x4f6be1,_0x3aaa6c);};_0x2dd2a3[_0x19c1('0x20','\x68\x75\x32\x43')]=function(_0x239759,_0x2b74db,_0x59b85d){return _0x239759(_0x2b74db,_0x59b85d);};_0x2dd2a3[_0x19c1('0x21','\x26\x41\x36\x78')]=_0x19c1('0x22','\x59\x66\x44\x66');_0x2dd2a3[_0x19c1('0x23','\x32\x76\x69\x36')]=_0x19c1('0x24','\x74\x6c\x4f\x28');_0x2dd2a3[_0x19c1('0x25','\x29\x6c\x50\x23')]=function(_0x2c9609,_0x17e6f2){return _0x2c9609==_0x17e6f2;};_0x2dd2a3[_0x19c1('0x26','\x65\x4b\x6a\x46')]=function(_0x51e64d,_0x4e874b){return _0x51e64d(_0x4e874b);};_0x2dd2a3[_0x19c1('0x27','\x59\x46\x5a\x53')]=_0x19c1('0x28','\x5d\x24\x5d\x24');_0x2dd2a3[_0x19c1('0x29','\x74\x7a\x77\x58')]=_0x19c1('0x2a','\x49\x49\x56\x36');_0x2dd2a3[_0x19c1('0x2b','\x52\x69\x35\x4b')]=_0x19c1('0x2c','\x75\x6f\x5b\x5d');var _0xbe46b4=_0x19c1('0x2d','\x52\x5d\x43\x47')[_0x19c1('0x2e','\x71\x6d\x50\x40')]('\x7c'),_0x1db109=0x0;while(!![]){switch(_0xbe46b4[_0x1db109++]){case'\x30':var _0xbfabd0=![];continue;case'\x31':if(!document[_0x19c1('0x2f','\x32\x76\x4e\x5d')](_0x2dd2a3[_0x19c1('0x30','\x5b\x2a\x33\x73')])){_0x2dd2a3[_0x19c1('0x31','\x4b\x5e\x66\x4e')](_0x4abe52,!![],0x1);return;}continue;case'\x32':var _0x1caa19=function(_0x22dc64){var _0x30468e=_0x19efc7[_0x19c1('0x32','\x6f\x5d\x5d\x4c')][_0x19c1('0x33','\x4e\x6a\x6c\x68')]('\x7c'),_0x4e5c2f=0x0;while(!![]){switch(_0x30468e[_0x4e5c2f++]){case'\x30':var _0xd891a4=document[_0x19c1('0x34','\x65\x4b\x6a\x46')](_0x19efc7[_0x19c1('0x35','\x51\x6b\x56\x40')]);continue;case'\x31':var _0xa59f4d=![];continue;case'\x32':document[_0x19c1('0x36','\x59\x46\x5a\x53')](_0x19c1('0x37','\x46\x76\x6d\x4c'))[0x0][_0x19c1('0x38','\x72\x71\x45\x50')](_0xd891a4);continue;case'\x33':if(window[_0x22dc64][_0x19c1('0x39','\x32\x76\x4e\x5d')]()===_0xd891a4[_0x19c1('0x3a','\x59\x66\x44\x66')][_0x22dc64][_0x19c1('0x3b','\x74\x6c\x4f\x28')]()){if(_0x19efc7[_0x19c1('0x3c','\x23\x62\x42\x33')](window[_0x22dc64][_0x19c1('0x3d','\x74\x7a\x77\x58')][_0x19c1('0x3e','\x6f\x31\x47\x50')](),_0xd891a4[_0x19c1('0x3f','\x4b\x5e\x66\x4e')][_0x22dc64][_0x19c1('0x40','\x32\x76\x69\x36')][_0x19c1('0x41','\x67\x78\x5d\x49')]())){_0xa59f4d=!![];}}continue;case'\x34':return _0xa59f4d;case'\x35':_0xd891a4[_0x19c1('0x42','\x24\x40\x21\x34')]=_0x19efc7[_0x19c1('0x43','\x53\x59\x58\x5a')];continue;case'\x36':_0xd891a4[_0x19c1('0x44','\x72\x7a\x69\x21')][_0x19c1('0x45','\x32\x76\x69\x36')](_0xd891a4);continue;}break;}};continue;case'\x33':var _0x37b4f4=_0x48384f;continue;case'\x34':var _0x48384f=Date[_0x19c1('0x46','\x74\x51\x48\x5b')]();continue;case'\x35':if(!_0x2dd2a3[_0x19c1('0x47','\x71\x6d\x50\x40')](_0x1caa19,_0x2dd2a3[_0x19c1('0x48','\x62\x53\x46\x30')])){_0x4abe52(!![],0xe);return;}continue;case'\x36':var _0x12114d=_0x2dd2a3[_0x19c1('0x49','\x5a\x5e\x68\x23')](displayCountry);continue;case'\x37':var _0x47fa23=setInterval(function(){var _0x1f8269=_0x19efc7[_0x19c1('0x4a','\x4d\x59\x6f\x58')][_0x19c1('0x33','\x4e\x6a\x6c\x68')]('\x7c'),_0x3ce5cd=0x0;while(!![]){switch(_0x1f8269[_0x3ce5cd++]){case'\x30':var _0x103d9b=![];continue;case'\x31':if(_0x19efc7[_0x19c1('0x4b','\x32\x76\x69\x36')](adsJsLoaded,0x0)){return;}continue;case'\x32':var _0x2b8134=window[_0x19c1('0x4c','\x4d\x59\x6f\x58')][_0x19c1('0x4d','\x53\x6e\x56\x74')];continue;case'\x33':if(!_0x19efc7[_0x19c1('0x4e','\x74\x6c\x4f\x28')](_0x1caa19,_0x19efc7[_0x19c1('0x4f','\x6f\x31\x47\x50')])){_0x19efc7[_0x19c1('0x50','\x71\x6d\x50\x40')](_0x4abe52,!![],0xe);return;}continue;case'\x34':if(_0x19efc7[_0x19c1('0x51','\x51\x6b\x56\x40')](_0x12114d,'\x64\x65')){var _0x169024=_0x19c1('0x52','\x52\x5d\x43\x47')[_0x19c1('0x53','\x32\x76\x69\x36')]('\x7c'),_0x121f99=0x0;while(!![]){switch(_0x169024[_0x121f99++]){case'\x30':if(_0x19efc7[_0x19c1('0x54','\x23\x62\x42\x33')](_0x103d9b,0x9)){_0x19efc7[_0x19c1('0x55','\x52\x69\x35\x4b')](_0x4abe52,![],0x4);return;}continue;case'\x31':var _0x460962=document[_0x19c1('0x56','\x29\x6c\x50\x23')](_0x19efc7[_0x19c1('0x57','\x59\x46\x5a\x53')]);continue;case'\x32':return;case'\x33':_0x19efc7[_0x19c1('0x58','\x52\x5d\x43\x47')](_0x4abe52,![],0x7);continue;case'\x34':_0x460962[_0x19c1('0x59','\x75\x6f\x5b\x5d')]=function(){var _0x1f0dc0=_0x473511[_0x19c1('0x5a','\x72\x7a\x69\x21')][_0x19c1('0x5b','\x54\x78\x2a\x39')]('\x7c'),_0x5f2717=0x0;while(!![]){switch(_0x1f0dc0[_0x5f2717++]){case'\x30':var _0x448a2a=Date[_0x19c1('0x5c','\x53\x6e\x56\x74')]();continue;case'\x31':var _0x518e02={};_0x518e02[_0x19c1('0x5d','\x74\x6c\x4f\x28')]=function(_0xf94312,_0x82fd31,_0x570bc5){return _0x473511.iVoyj(_0xf94312,_0x82fd31,_0x570bc5);};_0x518e02[_0x19c1('0x5e','\x21\x36\x47\x26')]=function(_0x2a7936,_0x5a7d6d){return _0x473511.szoMS(_0x2a7936,_0x5a7d6d);};_0x518e02[_0x19c1('0x5f','\x7a\x44\x4c\x52')]=function(_0x389368,_0x2a11e2){return _0x473511.MSTab(_0x389368,_0x2a11e2);};continue;case'\x32':_0x4abe52(![],0x7);continue;case'\x33':return;case'\x34':var _0xf280d5=_0x473511[_0x19c1('0x60','\x46\x76\x6d\x4c')](setInterval,function(){if(_0xbfabd0){clearInterval(_0xf280d5);_0x518e02[_0x19c1('0x61','\x46\x76\x6d\x4c')](_0x4abe52,![],0x7);}else{if(_0x518e02[_0x19c1('0x62','\x65\x4b\x6a\x46')](Date[_0x19c1('0x63','\x35\x65\x30\x49')](),_0x448a2a)>0xfa0){_0x518e02[_0x19c1('0x64','\x26\x41\x36\x78')](clearInterval,_0xf280d5);_0x518e02[_0x19c1('0x65','\x6f\x31\x47\x50')](_0x4abe52,!![],0x10);}}},0x64);continue;}break;}};continue;case'\x35':_0x460962[_0x19c1('0x66','\x7a\x44\x4c\x52')]=function(){_0x473511[_0x19c1('0x67','\x46\x76\x6d\x4c')](_0x4abe52,!![],0xf);};continue;case'\x36':_0x460962[_0x19c1('0x68','\x32\x76\x4e\x5d')]=_0x19efc7[_0x19c1('0x69','\x59\x66\x44\x66')];continue;case'\x37':document[_0x19c1('0x6a','\x21\x36\x47\x26')][_0x19c1('0x6b','\x74\x6c\x4f\x28')](_0x460962);continue;}break;}}else{var _0x12fb3b=_0x19efc7[_0x19c1('0x6c','\x29\x6c\x50\x23')][_0x19c1('0x6d','\x21\x36\x47\x26')]('\x7c'),_0x51b4ec=0x0;while(!![]){switch(_0x12fb3b[_0x51b4ec++]){case'\x30':_0x19efc7[_0x19c1('0x6e','\x65\x4b\x6a\x46')](_0x4abe52,![],0x12);continue;case'\x31':if(_0x19efc7[_0x19c1('0x6f','\x2a\x42\x21\x6d')](_0x103d9b,0xa)){if(_0x19efc7[_0x19c1('0x70','\x75\x6f\x5b\x5d')](typeof adsbygoogle,_0x19c1('0x71','\x62\x53\x46\x30'))){_0x4abe52(![],0x8);return;}}continue;case'\x32':_0x460962[_0x19c1('0x72','\x62\x53\x46\x30')]=_0x19efc7[_0x19c1('0x73','\x74\x51\x48\x5b')]+window[_0x19c1('0x74','\x6f\x31\x47\x50')][_0x19c1('0x75','\x4b\x5e\x66\x4e')];continue;case'\x33':var _0x460962=document[_0x19c1('0x76','\x54\x78\x2a\x39')](_0x19efc7[_0x19c1('0x77','\x32\x54\x24\x57')]);continue;case'\x34':_0x460962[_0x19c1('0x78','\x75\x6f\x5b\x5d')]=function(){_0x19efc7[_0x19c1('0x79','\x6f\x5d\x5d\x4c')](_0x4abe52,!![],0x11);return;};continue;case'\x35':if(_0x19efc7[_0x19c1('0x7a','\x76\x53\x48\x61')](typeof adsbygoogle[_0x19c1('0x7b','\x59\x66\x44\x66')],_0x19efc7[_0x19c1('0x7c','\x4e\x6a\x6c\x68')])||_0x19efc7[_0x19c1('0x7d','\x74\x6c\x4f\x28')](adsbygoogle[_0x19c1('0x7e','\x23\x62\x42\x33')],![])||typeof adsbygoogle[_0x19c1('0x7f','\x52\x5d\x43\x47')]!==_0x19efc7[_0x19c1('0x80','\x36\x79\x50\x33')]){if(_0x19efc7[_0x19c1('0x81','\x4e\x6a\x6c\x68')](typeof adsbygoogle,_0x19efc7[_0x19c1('0x82','\x52\x69\x35\x4b')]))_0x19efc7[_0x19c1('0x83','\x71\x62\x46\x4a')](_0x4abe52,![],0xe);else _0x19efc7[_0x19c1('0x84','\x23\x62\x42\x33')](_0x4abe52,!![],0x9);return;}continue;case'\x36':document[_0x19c1('0x85','\x32\x76\x4e\x5d')][_0x19c1('0x86','\x36\x79\x50\x33')](_0x460962);continue;case'\x37':return;case'\x38':_0x460962[_0x19c1('0x87','\x54\x78\x2a\x39')]=function(){_0x473511[_0x19c1('0x88','\x26\x41\x36\x78')](_0x4abe52,![],0x12);return;};continue;}break;}}continue;case'\x35':var _0x459b1b=_0x2b8134[_0x19c1('0x89','\x4e\x6a\x6c\x68')](_0x19efc7[_0x19c1('0x8a','\x5a\x5e\x68\x23')]);continue;case'\x36':if(_0x459b1b){_0x103d9b=_0x19efc7[_0x19c1('0x8b','\x51\x6b\x56\x40')](parseInt,_0x2b8134[_0x19c1('0x5b','\x54\x78\x2a\x39')](_0x19efc7[_0x19c1('0x8c','\x74\x6c\x4f\x28')])[0x1]);}continue;case'\x37':var _0x473511={};_0x473511[_0x19c1('0x8d','\x75\x6f\x5b\x5d')]=_0x19efc7.IpLzs;_0x473511[_0x19c1('0x8e','\x72\x7a\x69\x21')]=function(_0x215d62,_0x461c51,_0x63b72d){return _0x215d62(_0x461c51,_0x63b72d);};_0x473511[_0x19c1('0x8f','\x59\x46\x5a\x53')]=function(_0x2f76db,_0x5241e9){return _0x19efc7.DFyNu(_0x2f76db,_0x5241e9);};_0x473511[_0x19c1('0x90','\x72\x7a\x69\x21')]=function(_0x509033,_0x84185){return _0x19efc7.Tndhj(_0x509033,_0x84185);};_0x473511[_0x19c1('0x91','\x38\x21\x35\x53')]=function(_0x478b01,_0x3e1273,_0x57d9f1){return _0x19efc7.ftePG(_0x478b01,_0x3e1273,_0x57d9f1);};_0x473511[_0x19c1('0x92','\x5a\x5e\x68\x23')]=function(_0x264071,_0x551501,_0x133b09){return _0x264071(_0x551501,_0x133b09);};continue;case'\x38':_0x19efc7[_0x19c1('0x93','\x6e\x42\x76\x69')](clearInterval,_0x47fa23);continue;case'\x39':if(_0x19efc7[_0x19c1('0x94','\x71\x62\x46\x4a')](adsJsLoaded,-0x1)){var _0x1f6c4c=_0x19efc7[_0x19c1('0x95','\x62\x53\x46\x30')][_0x19c1('0x96','\x74\x6c\x4f\x28')]('\x7c'),_0x373db3=0x0;while(!![]){switch(_0x1f6c4c[_0x373db3++]){case'\x30':if(_0x19efc7[_0x19c1('0x97','\x72\x7a\x69\x21')](_0x12114d,'\x64\x65'))_0x17a756=0x2;else _0x17a756=0x3;continue;case'\x31':var _0x17a756='';continue;case'\x32':clearInterval(_0x47fa23);continue;case'\x33':return;case'\x34':_0x19efc7[_0x19c1('0x98','\x5d\x24\x5d\x24')](_0x4abe52,!![],_0x17a756);continue;}break;}}continue;case'\x31\x30':if(_0x19efc7[_0x19c1('0x99','\x74\x7a\x77\x58')](_0x19efc7[_0x19c1('0x9a','\x59\x66\x44\x66')](Date[_0x19c1('0x9b','\x24\x40\x21\x34')](),_0x48384f),0x1388))adsJsLoaded=-0x2;continue;case'\x31\x31':_0x37b4f4=Date[_0x19c1('0x5c','\x53\x6e\x56\x74')]();continue;}break;}},0x64);continue;case'\x38':var _0x19efc7={};_0x19efc7[_0x19c1('0x9c','\x74\x7a\x77\x58')]=_0x19c1('0x9d','\x59\x66\x44\x66');_0x19efc7[_0x19c1('0x9e','\x74\x51\x48\x5b')]=_0x2dd2a3.OGcab;_0x19efc7[_0x19c1('0x9f','\x71\x62\x46\x4a')]=function(_0xa8c0ad,_0x299831){return _0x2dd2a3.hYVAW(_0xa8c0ad,_0x299831);};_0x19efc7[_0x19c1('0xa0','\x6f\x31\x47\x50')]=_0x2dd2a3.rZNPG;_0x19efc7[_0x19c1('0xa1','\x66\x66\x58\x63')]=function(_0x556ebc,_0x554cf0){return _0x2dd2a3.gDNwc(_0x556ebc,_0x554cf0);};_0x19efc7[_0x19c1('0xa2','\x79\x63\x4e\x4f')]=_0x2dd2a3.rrGGm;_0x19efc7[_0x19c1('0xa3','\x36\x79\x50\x33')]=_0x2dd2a3.TqzeV;_0x19efc7[_0x19c1('0xa4','\x7a\x44\x4c\x52')]=function(_0x489de9,_0x17ef94,_0x30a58e){return _0x2dd2a3.vzRHt(_0x489de9,_0x17ef94,_0x30a58e);};_0x19efc7[_0x19c1('0xa5','\x29\x6c\x50\x23')]=_0x19c1('0xa6','\x59\x66\x44\x66');_0x19efc7[_0x19c1('0xa7','\x79\x63\x4e\x4f')]=function(_0x587f55,_0x412a09){return _0x2dd2a3.euPzk(_0x587f55,_0x412a09);};_0x19efc7[_0x19c1('0xa8','\x67\x78\x5d\x49')]=function(_0x54675c,_0x506c6b){return _0x2dd2a3.gDNwc(_0x54675c,_0x506c6b);};_0x19efc7[_0x19c1('0xa9','\x36\x79\x50\x33')]=_0x2dd2a3.enDOu;_0x19efc7[_0x19c1('0xaa','\x53\x6e\x56\x74')]=function(_0x499bb0,_0x54b1fd,_0x5e678f){return _0x2dd2a3.vzRHt(_0x499bb0,_0x54b1fd,_0x5e678f);};_0x19efc7[_0x19c1('0xab','\x5a\x5b\x57\x26')]=function(_0x4b23c5,_0x54d922){return _0x2dd2a3.HTdRw(_0x4b23c5,_0x54d922);};_0x19efc7[_0x19c1('0xac','\x71\x62\x46\x4a')]=function(_0x2b9691,_0x26add8,_0x4733bd){return _0x2dd2a3.ACcsh(_0x2b9691,_0x26add8,_0x4733bd);};_0x19efc7[_0x19c1('0xad','\x72\x71\x45\x50')]=_0x2dd2a3.HjHnX;_0x19efc7[_0x19c1('0xae','\x5a\x5b\x57\x26')]=function(_0x21dbee,_0x46bf62,_0x565bf5){return _0x21dbee(_0x46bf62,_0x565bf5);};_0x19efc7[_0x19c1('0x69','\x59\x66\x44\x66')]=_0x2dd2a3.xNCRX;_0x19efc7[_0x19c1('0xaf','\x66\x6e\x6d\x6a')]=_0x2dd2a3.KTEWQ;_0x19efc7[_0x19c1('0xb0','\x66\x66\x58\x63')]=function(_0x1b5ce0,_0x339cf4,_0x455d07){return _0x2dd2a3.ACcsh(_0x1b5ce0,_0x339cf4,_0x455d07);};_0x19efc7[_0x19c1('0xb1','\x26\x41\x36\x78')]=function(_0x17a7a9,_0x265e2f){return _0x2dd2a3.uOJow(_0x17a7a9,_0x265e2f);};_0x19efc7[_0x19c1('0xb2','\x74\x7a\x77\x58')]=function(_0xb403e8,_0x17b43e){return _0x2dd2a3.VpcQJ(_0xb403e8,_0x17b43e);};_0x19efc7[_0x19c1('0xb3','\x54\x78\x2a\x39')]=_0x2dd2a3.FkcZh;_0x19efc7[_0x19c1('0xb4','\x26\x41\x36\x78')]=function(_0x4c31ac,_0x1749a5){return _0x2dd2a3.VpcQJ(_0x4c31ac,_0x1749a5);};_0x19efc7[_0x19c1('0xb5','\x38\x21\x35\x53')]=_0x2dd2a3.YXjiw;_0x19efc7[_0x19c1('0xb6','\x71\x6d\x50\x40')]=function(_0x33e152,_0x78bc19){return _0x2dd2a3.hYVAW(_0x33e152,_0x78bc19);};_0x19efc7[_0x19c1('0xb7','\x6f\x31\x47\x50')]=_0x19c1('0xb8','\x32\x76\x69\x36');_0x19efc7[_0x19c1('0x82','\x52\x69\x35\x4b')]=_0x19c1('0xb9','\x36\x79\x50\x33');_0x19efc7[_0x19c1('0xba','\x75\x6f\x5b\x5d')]=function(_0x4eea4a,_0x27c8a8,_0x3a78ff){return _0x2dd2a3.QfMCm(_0x4eea4a,_0x27c8a8,_0x3a78ff);};_0x19efc7[_0x19c1('0xbb','\x74\x7a\x77\x58')]=function(_0xf631ec,_0x592e63,_0x4f8a59){return _0x2dd2a3.sBDzK(_0xf631ec,_0x592e63,_0x4f8a59);};_0x19efc7[_0x19c1('0xbc','\x71\x6d\x50\x40')]=_0x2dd2a3.saEly;_0x19efc7[_0x19c1('0xbd','\x65\x4b\x6a\x46')]=function(_0x586a17,_0xc1dd03){return _0x2dd2a3.gDNwc(_0x586a17,_0xc1dd03);};_0x19efc7[_0x19c1('0xbe','\x71\x6d\x50\x40')]=_0x19c1('0xbf','\x35\x65\x30\x49');_0x19efc7[_0x19c1('0xc0','\x53\x59\x58\x5a')]=_0x2dd2a3.vVNmM;_0x19efc7[_0x19c1('0xc1','\x59\x46\x5a\x53')]=function(_0x40e247,_0x5da54f){return _0x40e247-_0x5da54f;};_0x19efc7[_0x19c1('0xc2','\x5d\x24\x5d\x24')]=function(_0xa2fb5b,_0x4be841){return _0x2dd2a3.uRETW(_0xa2fb5b,_0x4be841);};_0x19efc7[_0x19c1('0xc3','\x71\x62\x46\x4a')]=_0x19c1('0xc4','\x66\x66\x58\x63');_0x19efc7[_0x19c1('0xc5','\x46\x76\x6d\x4c')]=function(_0x2a33c4,_0x36a286){return _0x2a33c4>_0x36a286;};continue;case'\x39':if(_0x2dd2a3[_0x19c1('0xc6','\x23\x62\x42\x33')]($,_0x2dd2a3[_0x19c1('0xc7','\x53\x6e\x56\x74')])[_0x19c1('0xc8','\x74\x51\x48\x5b')](_0x2dd2a3[_0x19c1('0xc9','\x54\x78\x2a\x39')])!==_0x2dd2a3[_0x19c1('0xca','\x4b\x5e\x66\x4e')]){try{nx[_0x19c1('0xcb','\x72\x7a\x69\x21')][_0x19c1('0xcc','\x66\x66\x58\x63')](function(){if(_0x19efc7[_0x19c1('0xcd','\x23\x62\x42\x33')]($,_0x19efc7[_0x19c1('0xce','\x6f\x55\x74\x6d')])[_0x19c1('0xcf','\x24\x40\x21\x34')])_0xbfabd0=!![];nx[_0x19c1('0xd0','\x74\x51\x48\x5b')](_0x19c1('0xd1','\x5a\x5b\x57\x26'),function(){_0xbfabd0=!![];});nx[_0x19c1('0xd2','\x59\x46\x5a\x53')](_0x19efc7[_0x19c1('0xd3','\x79\x63\x4e\x4f')]);});}catch(_0x425ecd){};}else{return;}continue;}break;}}
- var weatherButtonListener = function(trigger_warn) {
- $('#w-layer-click').off('click').on('click', function() {
- var url = $('#w-layer-click').attr('data-url');
- location.href=url;
- });
- $('.btn-twetter').off('click').on('click', function() {
- $('.w-btn-div').css('display','none');
- var domid = $(this).attr('aria-controls');
- $('.btn-twetter').removeClass('btn-twetter-active');
- $(this).addClass('btn-twetter-active');
- $('#'+domid).css('display','block');
- $('#'+domid+'>a:first-child').trigger('click');
- });
- $('.btn-rwetter').off('click').on('click', function() {
- $('#w-layer-oo').html('');
- $('#w-layer-oo2').html('');
- $('#w-layer-uo').html('');
- if (parseInt($(this).attr('data-oo2')) === 1) {
- getWeatherImage('#w-layer-oo2', $(this).attr('data-model'), true, $(this).attr('data-future'));
- $('#w-layer-click').attr('data-url',$(this).attr('data-url'));
- }
- if (parseInt($(this).attr('data-oo')) === 1) {
- getWeatherImage('#w-layer-oo', $(this).attr('data-model'), true, $(this).attr('data-future'));
- $('#w-layer-click').attr('data-url',$(this).attr('data-url'));
- }
- if (parseInt($(this).attr('data-uo')) === 1) {
- getWeatherImage('#w-layer-uo', $(this).attr('data-model'), true, $(this).attr('data-future'));
- $('#w-layer-click').attr('data-url',$(this).attr('data-url'));
- }
- if (parseInt($(this).attr('data-oo2-1')) === 1) {
- getWeatherImage('#w-layer-oo2', $(this).attr('data-model-1'));
- }
- if (parseInt($(this).attr('data-oo-1')) === 1) {
- getWeatherImage('#w-layer-oo', $(this).attr('data-model-1'));
- }
- if (parseInt($(this).attr('data-uo-1')) === 1) {
- getWeatherImage('#w-layer-uo', $(this).attr('data-model-1'));
- }
- if (parseInt($(this).attr('data-oo2-2')) === 1) {
- getWeatherImage('#w-layer-oo2', $(this).attr('data-model-2'));
- }
- if (parseInt($(this).attr('data-oo-2')) === 1) {
- getWeatherImage('#w-layer-oo', $(this).attr('data-model-2'));
- }
- if (parseInt($(this).attr('data-uo-2')) === 1) {
- getWeatherImage('#w-layer-uo', $(this).attr('data-model-2'));
- }
- $('.btn-rwetter').removeClass('btn-rwetter-active');
- $(this).addClass('btn-rwetter-active');
- if (parseInt($(this).attr('data-player')) === 1) {
- $('#w-player').css('display', 'block');
- }
- else {
- $('#w-player').css('display', 'none');
- }
- //$('.w-overview-product>h3').html($(this).attr('data-headline'));
- replaceWeatherImages(parseInt($(this).attr('data-x')),parseInt($(this).attr('data-y')),$(this).attr('data-overlay'));
- });
- };
- var replaceWeatherImages = function(x,y, url) {
- if (x>0 && y>0) {
- var spielraum_x = 756-$('#w-overlay').width(); // 75
- var spielraum_y = 616-$('#w-overlay').height(); // 323
- var start_x = Math.round($('#w-overlay').width()/2); // 75
- var start_y = Math.round($('#w-overlay').height()/2); // 323
- var ver_x = 2;
- var ver_y = 2;
- if (x>start_x) {
- ver_x=x-start_x+ver_x;
- if (ver_x>spielraum_x) {
- ver_x=spielraum_x;
- }
- }
- if (y>start_y) {
- ver_y=y-start_y+ver_y;
- if (ver_y>spielraum_y) {
- ver_y=spielraum_y;
- }
- }
- $('.w-overview-layers').css('margin-left', '-'+ver_x+'px');
- $('.w-overview-layers').css('margin-top', '-'+ver_y+'px');
- $('#w-map-marker').css('display', 'block');
- $('#w-map-marker').css('top', (y-ver_y-23)+'px');
- $('#w-map-marker').css('left', (x-ver_x-3)+'px');
- }
- if (typeof url !== 'undefined' && url) {
- $('#w-overlay>img').attr('src', url);
- }
- }
- var placeWeatherOverlay = function(trigger_warn) {
- var x = parseInt($('#w-overlay').attr('data-x'));
- var y = parseInt($('#w-overlay').attr('data-y'));
- replaceWeatherImages(x,y);
- if (trigger_warn === 'trigger_warn') {
- $('.btn-twetter').removeClass('btn-twetter-active');
- $('.w-btn-div').css('display','none');
- $('#w-buttons-t>a:first-child').addClass('btn-twetter-active');
- var domid = $('#w-buttons-t>a:first-child').attr('aria-controls');
- $('#'+domid).css('display','block');
- if ($('#uwz-type-warning').attr('data-product') === 'blitze') {
- $('[data-model="radar/Blitze"]').trigger('click');
- }
- else if ($('#uwz-type-warning').attr('data-product') === 'flood') {
- $('[data-model="radar/floods[0]"]').trigger('click');
- }
- else if ($('#uwz-type-warning').attr('data-product') === 'rain') {
- $('[data-model="radar/storms[0]"]').trigger('click');
- }
- else if ($('#uwz-type-warning').attr('data-product') === 'tornado') {
- $('[data-model="radar/storms[0]"]').trigger('click');
- }
- else if ($('#uwz-type-warning').attr('data-product') === 'sturm') {
- $('[data-model="radar/storms[0]"').trigger('click');
- }
- else if ($('#uwz-type-warning').attr('data-product') === 'hail') {
- $('[data-model="radar/hagel"]').trigger('click');
- }
- else {
- $('#w-buttons-t>a:first-child').trigger('click');
- }
- }
- else {
- $('#w-buttons-t>a:first-child').trigger('click');
- }
- };
- var isMobile = {
- Android: function () {
- return navigator.userAgent.match(/Android/i);
- },
- BlackBerry: function () {
- return navigator.userAgent.match(/BlackBerry/i);
- },
- iOS: function () {
- return navigator.userAgent.match(/iPhone|iPod|iPad/i);
- },
- Opera: function () {
- return navigator.userAgent.match(/Opera Mini/i);
- },
- Windows: function () {
- return navigator.userAgent.match(/IEMobile/i);
- },
- any: function () {
- return ((isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()));
- }
- };
- var isGoogle = function() {
- return (
- true
- );
- };
- var popoverClose = function(name) {
- $('*[data-pocontent]').each(function() {
- if ($(this).data('pocontent') == name) {
- $(this).popover('hide');
- }
- });
- }
- var loadingMsg = function() {
- var loading = $('#myfavcontent').attr('data-loading');
- if (!loading) { loading='Loading'; }
- return loading;
- };
- var hoverPopover = function() {
- if (!isMobile.any()) {
- $('[data-toggle="popover"]').popover({
- 'html': true,
- 'trigger': 'hover',
- 'placement': 'bottom'
- });
- $('[data-toggle="popover"]').on('click', function(){
- $(this).popover('hide');
- });
- }
- $('[data-toggle="pcopover"]').popover({
- 'html': true,
- 'trigger': 'click',
- 'placement': 'bottom'
- });
- $('[data-toggle="popover"]').on('click', function(){
- $(this).popover('hide');
- });
- };
- var initiOSzoomfix = function() {
- // prevent iOS from zooming in
- $('input').off('mousedown').on('mousedown', function(){
- if (!$(this).is(":focus")) { $(this).addClass('ioszoomfix');}});
- $('input').off('focus').on('focus', function(){$(this).removeClass('ioszoomfix'); });
- $('select').off('mousedown').on('mousedown', function(){
- if (!$(this).is(":focus")) { $(this).addClass('ioszoomfix');}});
- $('select').off('focus').on('focus', function(){$(this).removeClass('ioszoomfix'); });
- $('select').off('blur').on('blur', function(){$(this).removeClass('ioszoomfix'); });
- };
- var loadingForecasts = function() {
- if ($('#weather-overview-page').attr('data-load') === 'true') {
- if(parseInt($('#weather-overview-uwz').attr('data-id'))>0) {
- $.get(get_url_path()+'/ajax_pub/uwz', {
- 'city_id' : $('#weather-overview-uwz').attr('data-id'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat(),
- 't' : $('#weather-overview-uwz').attr('data-ts')
- }, function (data) {
- if (data) {
- $('#weather-overview-uwz').html(data);
- hoverPopover();
- }
- $.get(get_url_path()+'/ajax_pub/weathermaps', {
- 'city_id':$('#weather-overview-page').attr('data-city'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat()
- }, function (data) {
- if (data !== 'Not found') {
- $('#weather-overview-maps').html(data);
- weatherButtonListener();
- placeWeatherOverlay('trigger_warn');
- hoverPopover();
- }
- else {
- $('#weather-overview-maps').replaceWith('');
- }
- },'html');
- } );
- }
- else {
- $.get(get_url_path()+'/ajax_pub/weathermaps', {
- 'city_id':$('#weather-overview-page').attr('data-city'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat()
- }, function (data) {
- if (data !== 'Not found') {
- $('#weather-overview-maps').html(data);
- weatherButtonListener();
- placeWeatherOverlay('trigger_warn');
- hoverPopover();
- }
- else {
- $('#weather-overview-maps').replaceWith('');
- }
- hoverPopover();
- },'html');
- }
- $.get(get_url_path()+'/ajax_pub/weathernexthoursdays', {
- 'city_id':$('#weather-overview-page').attr('data-city'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat()
- }, function (data) {
- if (data !== 'Not found') {
- $('#weather-overview-nexthoursdays').html(data);
- }
- else {
- $('#weather-overview-nexthoursdays').replaceWith('');
- }
- $('[data-toggle="tooltip"]').tooltip();
- },'html');
- $.get(get_url_path()+'/ajax_pub/weather14days', {
- 'city_id':$('#weather-overview-page').attr('data-city'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat()
- }, function (data) {
- if (data !== 'Not found') {
- $('#weather-overview-14daystrend').html(data);
- plotWeatherTrend14days();
- }
- else {
- $('#weather-overview-14daystrend').replaceWith('');
- }
- },'html');
- $.get(get_url_path()+'/ajax_pub/weathercompact', {
- 'city_id':$('#weather-overview-page').attr('data-city'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat()
- }, function (data) {
- if (data !== 'Not found') {
- $('#weather-overview-compact').html(data);
- plotGraphCompact();
- }
- else {
- $('#weather-overview-compact').replaceWith('');
- }
- },'html');
- }
- if ($('#weather-fccompact-page').attr('data-load') === 'true') {
- $.get(get_url_path()+'/ajax/fccompact', {
- 'city_id':$('#weather-fccompact-page').attr('data-city'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat(),
- 'm':$('#weather-fccompact-page').attr('data-m'),
- 'c':$('#weather-fccompact-page').attr('data-hash')
- }, function (data) {
- $('#weather-forecast-compact').html(data);
- plotGraphCompact();
- },'html');
- }
- if ($('#weather-fcxl-page').attr('data-load') === 'true') {
- $.get(get_url_path()+'/ajax/fcxlc', {
- 'city_id':$('#weather-fcxl-page').attr('data-city'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat(),
- 'func':$('#weather-fcxl-page').attr('data-func')
- }, function (data) {
- $.get(get_url_path()+'/ajax/fcxl', {
- 'city_id':$('#weather-fcxl-page').attr('data-city'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat(),
- 'model':$('#weather-fcxl-page').attr('data-m'),
- 'func':$('#weather-fcxl-page').attr('data-func')
- }, function (data2) {
- $('#fcxl-chart').html(data);
- $('#forecast-full').html(data2);
- plotGraph();
- graphTabOnClick();
- setModelSelectorListener();
- $('.graphtab').each(function(){
- if ($(this).attr('data-tab') == $('#weather-fcxl-page').attr('data-tab')) {
- $(this).trigger("click");
- }
- });
- },'html');
- },'html');
- }
- if ($('#weather-fccompact-page').attr('data-load') === 'true' || $('#weather-fcxl-page').attr('data-load') === 'true' || $('#weather-ensemble-page').attr('data-load') === 'true') {
- if(parseInt($('#weather-overview-uwz').attr('data-id'))>0) {
- $.get(get_url_path()+'/ajax/uwz', {
- 'city_id' : $('#weather-overview-uwz').attr('data-id'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat(),
- 't' : $('#weather-overview-uwz').attr('data-ts')
- }, function (data) {
- if (data) {
- $('#weather-overview-uwz').html(data);
- hoverPopover();
- }
- }
- );
- }
- }
- };
- var graphTabOnClick = function() {
- $('.graphtab').on('click', function(e){
- var new_url = $(this).attr("data-url");
- var tab = $(this).attr("data-tab");
- $('#tab-url').attr("data-src", tab);
- var model = $('#forecast-model').val();
- if (model && typeof new_url !== 'undefined') {
- new_url = new_url.replace(tab,model+'/'+tab);
- }
- if (new_url) {
- //$('#forecast-url').attr('data', new_url)
- pushHistory(new_url);
- }
- setTimeout(function() { $(window).trigger('resize'); }, 300);
- });
- };
- var extServer = function (url) {
- var serverlist = getImageServers();
- if (serverlist.length <= 0) {
- return url;
- }
- var serverid = hashInt(url)%serverlist.length;
- if (serverlist[serverid]) {
- return serverlist[serverid]+url;
- }
- return url;
- };
- var downloadAnimation = function() {
- raw_downloadAnimation('#radar-animation');
- };
- var downloadChartAnimation = function() {
- var intervall = $('#model-player-interval').val();
- raw_downloadAnimation("#modelcharts-animation-"+intervall);
- };
- var rar_preloadDownloadAnimation = function (domid, tmploading, images_waiting, parallel, new_limit, checkeronly) {
- var all_images = model_player_get_item_count(domid+" option");
- var parallel_proc = $('#parallel-proc').attr('data-value');
- if (typeof parallel_proc === 'undefined') {
- parallel_proc = 1;
- }
- parallel_proc = parseInt(parallel_proc);
- if (typeof parallel === 'undefined') {
- parallel=1;
- }
- if (typeof checkeronly === 'undefined') {
- checkeronly=false;
- }
- if (typeof new_limit === 'undefined') {
- new_limit=parallel_proc;
- }
- if (typeof images_waiting === 'undefined') {
- images_waiting=0;
- }
- if (typeof tmploading === 'undefined') {
- tmploading=0;
- $(domid).prop("selectedIndex", 0);
- }
- if (tmploading === 0) {
- if (!checkeronly) {
- // retrieve path to image
- var meta_data = $(domid).val();
- var meta_data_split = meta_data.split('#');
- var model_valid = meta_data_split[0];
- var image_type = '';
- var image_path = '';
- var intervall = $('#model-player-interval').val();
- if (domid !== '#modelcharts-animation-'+intervall) {
- image_type = '';
- image_path = get_model_image_path(image_type, $('#model').val(), $('#model-param').val(), model_valid);
- }
- else {
- model_valid += '#'+meta_data_split[1];
- var model_param = $('#model-param').val();
- var model_member = $('#model-member').val();
- var area = get_selected_area();
- var model = $('#model').val();
- var member_string = '';
- if (typeof model_member !== 'undefined' && model_member.length>0 && parseInt(model_member)>=0) {
- member_string = '_m'+model_member;
- }
- var run_date = model_valid.split('#');
- var modelstring = 'model';
- if (model === 'modezseason') {
- modelstring = 'season';
- }
- else if (model === 'modezwkly') {
- modelstring = 'weekly';
- }
- image_path = extServer(url_path+'/images/data/cache/'+modelstring+'/'+modelstring+'_'+model+'_'+run_date[0]+'_'+run_date[1]+'_'+area+'_'+model_param+member_string+'.png');
- }
- var download = '';
- if (!Array.isArray(image_path) && typeof image_path !== 'undefined') {
- var model = $('#model').val();
- var model_param = $('#model-param').val();
- if (model === 'modezseason') {
- model = 'season';
- }
- else if (model === 'modezwkly') {
- model = 'weekly';
- }
- else if (model.substring(0,3) === 'mod') {
- model = 'model';
- }
- var download = image_path.replace("data/cache/"+model+"/"+model+'_', "data/cache/"+model+"/complete_"+model_addons(model)+'_');
- }
- if (download) {
- var bild = new Image();
- bild.onload = function(){gifimages_loaded++; };
- bild.onerror = function(){gifimages_loaded++; };
- bild.src=download;
- gifimages.push(bild);
- }
- }
- if (parallel === parallel_proc) {
- checkeronly=true;
- if (gifimages_loaded < new_limit) {
- setTimeout(function() {
- rar_preloadDownloadAnimation(domid,0,0,parallel, new_limit, true);
- },100);
- }
- else {
- new_limit+=parallel_proc;
- parallel = 0;
- checkeronly=false;
- }
- }
- if (!checkeronly) {
- var selected = model_player_get_selected_index(domid);
- //console.log('images_loaded '+gifimages_loaded+' # items '+all_images+ ' # selected '+selected);
- if (selected < all_images) {
- $(domid).prop("selectedIndex", selected + 1);
- rar_preloadDownloadAnimation(domid,0,0,parallel+1, new_limit, false);
- }
- }
- }
- if (!checkeronly) {
- if(gifimages_loaded<all_images && images_waiting<10000) {
- setTimeout(function(){rar_preloadDownloadAnimation(domid, 1, images_waiting+1);},200);
- }
- else {
- console.log('images_loaded '+gifimages_loaded+' # items '+all_images+ ' # images_waiting '+images_waiting);
- tmploading=2;
- }
- if (tmploading === 2 && gifonce) {
- ajaxLoaderHide();
- produceGif(domid);
- }
- }
- };
- var produceGif = function(domid) {
- gifonce = false;
- download_image = null;
- console.log(image_urls);
- if (typeof gifshot !== 'undefined') {
- if (true || gifshot.isSupported()) {
- var first='';
- var all_images = model_player_get_item_count(domid+" option");
- var image_urls = new Array();
- var intervall = $('#model-player-interval').val();
- for(var i=all_images;i>=0;i--){
- $(domid).prop("selectedIndex", i);
- // retrieve path to image
- var meta_data = $(domid).val();
- var meta_data_split = meta_data.split('#');
- var model_valid = meta_data_split[0];
- var image_type = '';
- var image_path = '';
- if (domid !== '#modelcharts-animation-'+intervall) {
- image_type = '';
- image_path = get_model_image_path(image_type, $('#model').val(), $('#model-param').val(), model_valid);
- }
- else {
- model_valid += '#'+meta_data_split[1];
- var model_param = $('#model-param').val();
- var model_member = $('#model-member').val();
- var area = get_selected_area();
- var model = $('#model').val();
- var member_string = '';
- if (typeof model_member !== 'undefined' && model_member.length>0 && parseInt(model_member)>=0) {
- member_string = '_m'+model_member;
- }
- var run_date = model_valid.split('#');
- var modelstring = 'model';
- if (model === 'modezseason') {
- modelstring = 'season';
- }
- else if (model === 'modezwkly') {
- modelstring = 'weekly';
- }
- image_path = extServer(url_path+'/images/data/cache/'+modelstring+'/'+modelstring+'_'+model+'_'+run_date[0]+'_'+run_date[1]+'_'+area+'_'+model_param+member_string+'.png');
- }
- var download = '';
- if (!Array.isArray(image_path) && typeof image_path !== 'undefined') {
- var model = $('#model').val();
- var model_param = $('#model-param').val();
- if (model === 'modezseason') {
- model = 'season';
- }
- else if (model === 'modezwkly') {
- model = 'weekly';
- }
- else if (model.substring(0,3) === 'mod') {
- model = 'model';
- }
- var download = image_path.replace("data/cache/"+model+"/"+model+'_', "data/cache/"+model+"/complete_"+model_addons(model)+'_');
- }
- if (download) {
- if (first === '') {
- first = download;
- }
- image_urls.push(download);
- //alert(download);
- }
- }
- var image_urls_gif = new Array();
- var intervall = $('#model-player-interval').val();
- if (domid === '#modelcharts-animation-'+intervall) {
- image_urls_gif = image_urls.reverse();
- if (first) {
- image_urls_gif.push(first);
- image_urls_gif.push(first);
- image_urls_gif.push(first);
- }
- }
- else {
- image_urls_gif = image_urls;
- if (download) {
- image_urls_gif.push(download);
- image_urls_gif.push(download);
- image_urls_gif.push(download);
- }
- }
- if (image_urls.length>=5) {
- var top_len = 603;
- if ($('#model').val()==='plraw' && get_selected_area() < 5000000) {
- top_len = 655;
- }
- $.get(get_url_path()+'/ajax_pub/gifcreator', {'lang' : displayLanguage()}, function (data) {
- var images_counter = image_urls.length - 3;
- trackGif(images_counter.toString());
- $('#faq-modal').html(data).modal('show');
- $('.gifshot-progress-layer').show();
- $('.gifshot-progress-bar').attr('value',0.01);
- console.log(image_urls);
- var gifShotOptions = {
- gifWidth: 760,
- gifHeight: 760,
- images: image_urls,
- //images: document.querySelectorAll('img.animation-cache-image'),
- interval: images_delay[images_speed]/1000,
- numFrames: 12,
- frameDuration: 1,
- text: getPortalAddr(),
- fontWeight: 'bold',
- fontSize: '32px',
- fontFamily: 'sans-serif',
- fontColor: '#ffffff',
- 'textXCoordinate': 550,
- 'textYCoordinate': top_len,
- sampleInterval: 10,
- numWorkers: 4,
- progressCallback: function (captureProgress) {
- $('.gifshot-progress-layer').show();
- $('.gifshot-progress-bar').attr('value',captureProgress);
- }
- };
- gifshot.createGIF(gifShotOptions, function (obj) {
- if (!obj.error) {
- $('.gifshot-progress-layer').hide();
- download_image = obj.image;
- var animatedImage = document.createElement('img');
- animatedImage.src = download_image;
- animatedImage.id = 'gifshot-result';
- $('.gifshot-preview').append(animatedImage);
- $('.gifshot-preview-layer').show();
- $('.save-gif').attr('href', download_image);
- gifonce=true;
- gifimages_loaded=0;
- gifimages=[];
- }
- });
- },'html').fail(function(){
- gifonce=true;
- gifimages_loaded=0;
- gifimages=[];
- messageLayer(271, '#error-msg','#error-modal');});
- }
- else {
- gifonce=true;
- gifimages_loaded=0;
- gifimages=[];
- messageLayer(272, '#error-msg','#error-modal');
- }
- }
- else {
- gifonce=true;
- gifimages_loaded=0;
- gifimages=[];
- messageLayer(273, '#error-msg','#error-modal');
- }
- }
- else {
- gifonce=true;
- gifimages_loaded=0;
- gifimages=[];
- messageLayer(270, '#error-msg','#error-modal');
- }
- };
- var raw_downloadAnimation = function(domid) {
- model_player_stop();
- var intervall = $('#model-player-interval').val();
- if (domid === '#modelcharts-animation-'+intervall) {
- ajaxLoaderShow(true);
- }
- else {
- ajaxLoaderShow(false);
- }
- preload_image_animation(domid, true);
- };
- var saveGIF = function () {
- if (download_image) {
- var image_data = atob(download_image.split(',')[1]);
- // Use typed arrays to convert the binary data to a Blob
- var arraybuffer = new ArrayBuffer(image_data.length);
- var view = new Uint8Array(arraybuffer);
- for (var i=0; i<image_data.length; i++) {
- view[i] = image_data.charCodeAt(i) & 0xff;
- }
- try {
- // This is the recommended method:
- var blob = new Blob([arraybuffer], {type: 'application/octet-stream'});
- } catch (e) {
- // The BlobBuilder API has been deprecated in favour of Blob, but older
- // browsers don't know about the Blob constructor
- // IE10 also supports BlobBuilder, but since the `Blob` constructor
- // also works, there's no need to add `MSBlobBuilder`.
- var bb = new (window.WebKitBlobBuilder || window.MozBlobBuilder);
- bb.append(arraybuffer);
- var blob = bb.getBlob('application/octet-stream'); // <-- Here's the Blob
- }
- var model_valid = $('#model-valid').val();
- model_valid = model_valid.replace(/-/g, "");
- model_valid = model_valid.replace(/:/g, "");
- model_valid = model_valid.replace(/\//g, "_");
- var model = $('#model').val();
- model = model.replace(/px250/g, "radarhd");
- model = model.replace(/pl/g, "radar_lightning");
- // Use the URL object to create a temporary URL
- saveAs(blob, model+'_'+model_valid+'_animation.gif');
- }
- else {
- alert('Could not download, please try "save as".');
- }
- };
- var getImageServers = function () {
- var server_list = $('#static-images').attr('data-value');
- //Gif Debug für DEV-ENV
- //server_list = 'https://img1.kachelmannwetter.com,https://img1.kachelmannwetter.com,https://img1.kachelmannwetter.com,https://img2.kachelmannwetter.com,https://img2.kachelmannwetter.com,https://img2.kachelmannwetter.com,https://img3.kachelmannwetter.com,https://img3.kachelmannwetter.com,https://img3.kachelmannwetter.com';
- if (typeof server_list === 'undefined') {
- return Array();
- }
- return server_list.split(",");
- }
- var hashInt = function(str) {
- var hash = 0, i, chr;
- if (str.length === 0) return hash;
- for (i = 0; i < str.length; i++) {
- chr = str.charCodeAt(i);
- hash += chr; // Convert to 32bit integer
- }
- return hash;
- };
- var deleteSession = function(token) {
- $.get(get_url_path()+'/dashboard/deletetoken', {
- 'token':token,
- }, function (data) {
- $('#session-list').html(data);
- },'html');
- };
- var trackPlayer = function(domid, ext) {
- var param = $('#model-param').val();
- if (typeof param === 'undefined') {
- param = '';
- }
- else {
- param = '_'+param;
- }
- if(typeof ga !=='undefined'){
- ga('send', 'event', $('#model').val(), 'player'+param, get_selected_area(), ext, { nonInteraction: true});
- } else if(typeof _gaq !=='undefined'){
- _gaq.push(['_trackEvent',$('#model').val(), 'player'+param, get_selected_area(), ext, true]);
- }
- };
- var trackGif = function(images_count) {
- var param = $('#model-param').val();
- if (typeof param === 'undefined') {
- param = '';
- }
- else {
- param = '_'+param;
- }
- if(typeof ga !=='undefined'){
- ga('send', 'event', $('#model').val(), 'gifshot'+param, get_selected_area(), images_count, { nonInteraction: true});
- } else if(typeof _gaq !=='undefined'){
- _gaq.push(['_trackEvent',$('#model').val(), 'gifshot'+param, get_selected_area(), images_count, true]);
- }
- };
- var getPortalAddr = function() {
- var c = $('#user-country').attr('data-value');
- if (c === 'us') {
- return 'weather.us';
- }
- else if (c === 'xx') {
- return 'meteologix.com';
- }
- return 'kachelmannwetter.com';
- };
- var selectPaywallPackage = function(package) {
- $("input[name='RegisterForm[plan]']").each(function(){
- if ($(this).attr('value')==package) {
- $(this).click();
- $('#registerform-email').focus();
- }
- });
- $("input[name='SubscriptionForm[plan]']").each(function(){
- if ($(this).attr('value')==package) {
- $(this).click();
- }
- });
- };
- var setElementHiders = function() {
- $('.elementhider').off("click").on("click", function(e){
- $.get(get_url_path()+'/ajax/elementhider', {
- 'element_id': $(this).attr('data-id')
- });
- });
- $('.elementhider-hide').off("click").on("click", function(e){
- var elementid = $(this).attr('data-id');
- $.get(get_url_path()+'/ajax/elementhider', {
- 'element_id': elementid
- }, function() {
- $('#'+elementid).hide();
- });
- });
- $('.elementhider-hideclass').off("click").on("click", function(e){
- var elementid = $(this).attr('data-id');
- $.get(get_url_path()+'/ajax/elementhider', {
- 'element_id': elementid
- }, function() {
- $('.'+elementid).hide();
- if (elementid === 'cookie_deny') {
- location.href = get_url_path()+'/site/nocookies';
- }
- });
- });
- $('.elementhider-reload').off("click").on("click", function(e){
- e.preventDefault();
- $.get(get_url_path()+'/ajax/elementhider', {
- 'element_id': $(this).attr('data-id')
- }, function() {
- location.reload();
- });
- });
- $('.elementshower-reload').off("click").on("click", function(e){
- e.preventDefault();
- $.get(get_url_path()+'/ajax/elementshower', {
- 'element_id': $(this).attr('data-id')
- }, function() {
- location.reload();
- });
- });
- $('.elementhider-gps').off("click").on("click", function(e){
- e.preventDefault();
- $.get(get_url_path()+'/ajax/elementhider', {
- 'element_id': $(this).attr('data-id')
- }, function(){
- gps_locating_uwz();
- });
- });
- };
- var showXClicksLayer = function() {
- $.get(get_url_path()+'/ajax/xclickslayer', {}, function(data) {
- //var factor = Math.round((615/760)*parseInt($('#map-overlay').width()));
- //if (factor > 200 && factor < 768) {
- //$('#xclicks').css('height', factor);
- //}
- $('#xclicks').html(data);
- $('#main-image-content').hide();
- $('#xclicks').show();
- if (displayCountry() === 'de') {
- rescanMD();
- }
- });
- }
- var checkChartcounter = function() {
- if ($('#paywall-account-type').attr('data-value') === 'payaccount' || xclicksvalue===0) {
- return true;
- }
- if (chartcounter>0) {
- $('#main-image-content').show();
- $('#xclicks').hide();
- chartcounter--;
- return true;
- }
- else {
- xclicksvalue=xclicksvalue+2;
- chartcounter=xclicksvalue;
- showXClicksLayer();
- return false;
- }
- }
- var rescanMD = function() {
- $('.dkpw').each(function() {
- if (!$(this).is(":visible")) {
- $(this).html('');
- }
- } );
- $('.mdtest').each(function() {
- $(this).css('background-color','#dfdfdf');
- $(this).css('font-size','13px');
- var tmp = $(this).attr('data-nx-container');
- if (typeof tmp !== 'undefined') {
- $(this).html('<small>Placeholder for advertising:</small><br /><h2>'+tmp+'</h2>');
- }
- $(this).removeAttr("data-nx-container");
- });
- if ($('#paywall-account-type').attr('data-value') !== 'payaccount') {
- try {
- nx.cmd.push(function () {
- nx.trigger('rescan');
- nx.trigger('refresh', ['content', 'content_limited','mid_mobile_limited_lazy']);
- });
- } catch(err) {};
- }
- }
- var resetDropdowns = function() {
- for (i=1;i<=10;i++) {
- fieldname = '#form-areaid-'+i;
- resetSelectboxById(fieldname);
- }
- resetSelectboxById('#model-year');
- resetSelectboxById('#model-run');
- resetSelectboxById('#model-valid');
- resetSelectboxById('#model-param');
- };
- var checkCookie = function(){
- var cookieEnabled = navigator.cookieEnabled;
- if (!cookieEnabled){
- document.cookie = "ajsgdlkajsghdjashd";
- cookieEnabled = document.cookie.indexOf("ajsgdlkajsghdjashd")!=-1;
- }
- return cookieEnabled || 'cookiefail';
- }
- var showCookieFail = function() {
- location.href = get_url_path()+'/site/cookiesblocked';
- }
- var resetSelectboxById = function(fieldname) {
- $(fieldname+' option').each(function(){
- if ($(this).attr('selected') === 'selected') {
- $(fieldname).val($(this).attr('value'));
- }
- });
- };
- var gps_success_uwz = function(pos) {
- var x = pos.coords.longitude; //x = 12.784669;
- var y = pos.coords.latitude; //y = 46.7013345;
- $('#unwetterzentrale').html("<p>Ort gefunden. Bitte warten Sie auf die Unwetterdaten.</p>");
- $.get(get_url_path()+'/ajax/unwetterzentrale', {
- 'lat' : y,
- 'long' : x
- }, function (data) {
- if (data) {
- $('#unwetterzentrale').html(data);
- hoverPopover();
- $.get(get_url_path()+'/ajax_pub/weathermaps', {
- 'city_id':$('#weather-overview-page').attr('data-city'),
- 'lang':displayLanguage().toString().toLowerCase(),
- 'units':displayUnits(),
- 'tf':displayTimeformat()
- }, function (data) {
- if (data !== 'Not found') {
- $('#weather-overview-maps').html(data);
- weatherButtonListener();
- placeWeatherOverlay('trigger_warn');
- }
- else {
- $('#weather-overview-maps').replaceWith('');
- }
- hoverPopover();
- },'html');
- }
- else {
- gps_not_supported_uwz();
- }
- });
- };
- var gps_error_uwz = function() {
- $('#unwetterzentrale').html("<p> Wir konnten Sie nicht automatisch orten. Entweder liegen keine GPS-Daten vor oder Sie haben die Ortungsfunktion in Ihrem Browser für unsere Webseite blockiert.</p>");
- };
- var gps_not_supported_uwz = function() {
- $('#unwetterzentrale').html("<p>Es scheint als hätten Sie in Ihrem Browser die Ortungsfunktion blockiert. Wir konnten Sie deshalb nicht automatisch orten.</p>");
- };
- var findBtnActive = function(domid) {
- $(domid).each(function() {
- $(this).addClass('btn-active');
- });
- return '';
- };
- var vhstation_date_prev = function () {
- var selected = model_player_get_selected_index('#btn-vhs-date');
- var items = model_player_get_item_count("#btn-vhs-date option");
- if (selected < items) {
- $("#btn-vhs-date").prop("selectedIndex", selected + 1);
- $('#btn-vhs-date').trigger('change');
- }
- };
- var vhstation_date_next = function () {
- var selected = model_player_get_selected_index('#btn-vhs-date');
- if (selected > 0) {
- $("#btn-vhs-date").prop("selectedIndex", selected - 1);
- $('#btn-vhs-date').trigger('change');
- }
- };
- var setKlimaVergleichListener = function(fl_reload) {
- $('.btn-kvgl-tab').off('click').
- on('click', function(e) {
- $(this).removeClass("btn-active");
- $('#kgvl-city-name').html($(this).html().replace("<a>","").replace("</a>",""));
- $('#klima-vergleich').attr('data-value', $(this).attr('data-tab'));
- $('.btn-vhs-station').each(function() { $(this).removeClass('btn-active'); });
- var old_url = '';
- $('.btn-kvgl-tab').each(function() {
- if ($(this).hasClass("tab-current")) {
- $(this).removeClass("tab-current");
- old_url = $(this).attr('data-value');
- }
- });
- if (old_url) {
- $(this).addClass("tab-current");
- var loc = window.location.href;
- if (loc.indexOf(old_url) !== -1) {
- loc = loc.replace(old_url, $(this).attr('data-value'));
- }
- else {
- loc = loc + '/' + $(this).attr('data-value');
- }
- pushHistory(loc);
- }
- KlimavergleichListenerActions();
- });
- $('.btn-kvgl').off('click').
- on('click', function(e) {
- KlimavergleichListenerActions(this);
- });
- if (fl_reload !== true) {
- if ($('#klimavergleich-form').attr('name') === 'klimavergleich') {
- loadKlimavergleich();
- }
- }
- };
- var KlimavergleichListenerActions = function(obj) {
- var old_param = '';
- var new_param = '';
- if (obj) {
- if ($(obj).hasClass('btn-kvgl-mode')) {
- $('.btn-kvgl-mode').removeClass('btn-active');
- }
- else if ($(obj).hasClass('btn-kvgl-param')) {
- old_param = $(obj).attr('data-value');
- new_param = $(obj).attr('data-value');
- $('.btn-kvgl-param').each(function(){
- if ($(this).hasClass('btn-active')) {
- old_param = $(this).attr('data-value');
- }
- });
- $('.btn-kvgl-param').removeClass('btn-active');
- }
- else if ($(obj).hasClass('btn-kvgl-station')) {
- $('.btn-kvgl-station').removeClass('btn-active');
- }
- else if ($(obj).hasClass('btn-kvgl-climate')) {
- $('.btn-kvgl-climate').removeClass('btn-active');
- }
- $(obj).addClass('btn-active');
- }
- if (old_param !== new_param || !obj) {
- //$('#klima-vergleich-buttons').html(loadingGif());
- var params = getKlimavergleichParams();
- params.klimaaction = 'buttons';
- $.get(get_url_path()+'/ajax/klimavergleich', params,
- function (data) {
- if (data !== 'FALSE') {
- $('#klima-vergleich-buttons').html(data);
- setKlimaVergleichListener(true);
- hoverPopover();
- loadKlimavergleich();
- }
- },'html');
- }
- else {
- loadKlimavergleich();
- }
- }
- var VhStationListenerActions = function(obj) {
- var old_mode = '';
- var new_mode = '';
- var old_param = '';
- var new_param = '';
- var station = '';
- if (obj) {
- if ($(obj).hasClass('btn-vhs-mode')) {
- old_mode = $(obj).attr('data-value');
- new_mode = $(obj).attr('data-value');
- $('.btn-vhs-mode').each(function(){
- if ($(this).hasClass('btn-active')) {
- old_mode = $(this).attr('data-value');
- }
- });
- $('.btn-vhs-mode').removeClass('btn-active');
- }
- else if ($(obj).hasClass('btn-vhs-unit')) {
- $('.btn-vhs-unit').removeClass('btn-active');
- }
- else if ($(obj).hasClass('btn-vhs-param')) {
- old_param = $(obj).attr('data-value');
- new_param = $(obj).attr('data-value');
- $('.btn-vhs-param').each(function(){
- if ($(this).hasClass('btn-active')) {
- old_param = $(this).attr('data-value');
- }
- });
- $('.btn-vhs-param').removeClass('btn-active');
- }
- else if ($(obj).hasClass('btn-vhs-station')) {
- $('.btn-vhs-station').each(function(){
- if ($(this).hasClass('btn-active')) {
- station = $(this).attr('data-value');
- }
- });
- $('.btn-vhs-station').removeClass('btn-active');
- }
- $(obj).addClass('btn-active');
- }
- if (old_param !== new_param || old_mode !== new_mode || !obj || station.length===0) {
- //$('#klima-vergleich-buttons').html(loadingGif());
- var params = getVhstationenParams();
- params.vhsaction = 'buttons';
- $.get(get_url_path()+'/ajax/vhstationen', params,
- function (data) {
- if (data !== 'FALSE') {
- $('#vhstationen-buttons').html(data);
- setVhstationListener(true);
- hoverPopover();
- loadVhstationen();
- }
- },'html');
- }
- else {
- loadVhstationen();
- }
- };
- var setVhstationListener = function(fl_reload) {
- $('.btn-vhs-tab').off('click').
- on('click', function(e) {
- $(this).removeClass("btn-active");
- $('#vhs-city-name').html($(this).html().replace("<a>","").replace("</a>",""));
- $('#vh-stationen-graph').attr('data-value', $(this).attr('data-tab'));
- $('.btn-vhs-station').each(function() { $(this).removeClass('btn-active'); });
- var old_url = '';
- $('.btn-vhs-tab').each(function() {
- if ($(this).hasClass("tab-current")) {
- $(this).removeClass("tab-current");
- old_url = $(this).attr('data-value');
- }
- });
- if (old_url) {
- $(this).addClass("tab-current");
- var loc = window.location.href;
- if (loc.indexOf(old_url) !== -1) {
- loc = loc.replace(old_url, $(this).attr('data-value'));
- }
- else {
- loc = loc + '/' + $(this).attr('data-value');
- }
- pushHistory(loc);
- }
- VhStationListenerActions();
- });
- $('.btn-vhs').off('click').
- on('click', function(e) {
- VhStationListenerActions(this);
- });
- $('#btn-vhs-date').off('change').
- on('change', function(e) {
- VhStationListenerActions();
- });
- if (fl_reload !== true) {
- if ($('#vhstationen-form').attr('name') === 'vhstationen') {
- loadVhstationen();
- }
- }
- };
- var getKlimavergleichParams = function() {
- var params = {};
- $('.btn-kvgl-mode').each(function(){
- if ($(this).hasClass('btn-active')) {
- params.period = $(this).attr('data-value');
- }
- });
- $('.btn-kvgl-param').each(function(){
- if ($(this).hasClass('btn-active')) {
- params.paramid = $(this).attr('data-value');
- }
- });
- $('.btn-kvgl-station').each(function(){
- if ($(this).hasClass('btn-active')) {
- params.station_id = $(this).attr('data-value');
- }
- });
- $('.btn-kvgl-climate').each(function(){
- if ($(this).hasClass('btn-active')) {
- params.climate_id = $(this).attr('data-value');
- }
- });
- params.city_id = $('#klima-vergleich').attr('data-value');
- return params;
- };
- var getVhstationenParams = function() {
- var params = {};
- $('.btn-vhs-mode').each(function(){
- if ($(this).hasClass('btn-active')) {
- params.period = $(this).attr('data-value');
- }
- });
- $('.btn-vhs-unit').each(function(){
- if ($(this).hasClass('btn-active')) {
- params.unit = $(this).attr('data-value');
- }
- });
- $('.btn-vhs-param').each(function(){
- if ($(this).hasClass('btn-active')) {
- params.paramid = $(this).attr('data-value');
- }
- });
- $('.btn-vhs-station').each(function(){
- if ($(this).hasClass('btn-active')) {
- params.station_id = $(this).attr('data-value');
- }
- });
- params.date = $('#btn-vhs-date').val();
- params.city_id = $('#vh-stationen-graph').attr('data-value');
- return params;
- };
- var loadKlimavergleich = function() {
- //$('#klima-vergleich').html(loadingGif());
- var params = getKlimavergleichParams();
- params.klimaaction = 'graph';
- $('#klima-vergleich').html(loadingGif());
- $.get(get_url_path()+'/ajax/klimavergleich', params,
- function (data) {
- if (data !== 'FALSE') {
- $('#klima-vergleich').html(data);
- plotKlimaVergleich();//setTimeout('plotKlimaVergleich',1000);
- }
- else {
- $('#klima-vergleich').html('Es fehlt die Berechtigung, um diese Aktion durchzuführen.');
- }
- },'html');
- };
- var loadVhstationen = function() {
- //$('#klima-vergleich').html(loadingGif());
- var params = getVhstationenParams();
- params.vhsaction = 'graph';
- vhstation_rr_data=null;
- vhstation_tl_data=null;
- vhstation_tl_data2=null;
- vhstation_wind_data=null;
- $('#vh-stationen-graph').html(loadingGif());
- $('#vh-stationen-table').html(loadingGif());
- $.get(get_url_path()+'/ajax/vhstationen', params,
- function (data) {
- if (data !== 'FALSE') {
- $('#vh-stationen-graph').html(data);
- plotVHStationen();
- }
- else {
- $('#vh-stationen-graph').html('Es fehlt die Berechtigung, um diese Aktion durchzuführen.');
- }
- },'html');
- params.vhsaction = 'table';
- $.get(get_url_path()+'/ajax/vhstationen', params,
- function (data) {
- if (data !== 'FALSE') {
- $('#vh-stationen-table').html(data);
- }
- else {
- $('#vh-stationen-table').html('Es fehlt die Berechtigung, um diese Aktion durchzuführen.');
- }
- },'html');
- };
- var setPhaenologieListener = function(pageinit) {
- if($('#phaenologie').length == 0) return;
- if(pageinit) {
- $('#phaeno-plant-chart').html(loadingGif());
- plotPhaenologie();
- var nowParams = getPhaenoParams();
- pushPhaenoUrl(nowParams, nowParams, true);
- }
- function getPhaenoParams() {
- var city_val = $('#phaenologie').attr('data-city');
- var city_id = city_val.substring(0, city_val.indexOf('-'));
- var city_name = city_val.substring(city_val.indexOf('-') + 1);
- var station_val = $('.btn-phaeno-station.btn-active').data('value');
- var station_id = station_val.substring(0, station_val.indexOf('-'));
- var station_name = station_val.substring(station_val.indexOf('-') + 1);
- var plant_val = $('#plant-select').val();
- var plant_id = plant_val.substring(0, plant_val.indexOf('-'));
- var plant_name = plant_val.substring(plant_val.indexOf('-') + 1);
- var params = {
- city_id: city_id,
- city: city_name,
- station_id: station_id,
- station: station_name,
- plant_id: plant_id,
- plant: plant_name
- };
- //console.log(params);
- if($('.btn-phaeno-year.btn-active').length != 0)
- params.year = $('.btn-phaeno-year.btn-active').data('value');
- return params;
- }
- var lockUI = false;
- var menuRequestFinished = false;
- function ajaxMenuRequest(params) {
- menuRequestFinished = false;
- $('.menu-container').css('opacity', .6);
- $('#phaeno-plant-chart').html(loadingGif());
- lockUI = true;
- $.get(get_url_path() + '/ajax/phaenologie', params,
- function (data) {
- if (data !== 'FALSE') {
- $('#phaenologie .menu-container').html(data);
- setPhaenologieListener();
- hoverPopover();
- //loadKlimavergleich();
- var nowParams = getPhaenoParams();
- pushPhaenoUrl(nowParams, nowParams, true);
- }
- },'html')
- .always(function() {
- $('.menu-container').css('opacity', '');
- lockUI = false;
- menuRequestFinished = true;
- });
- ajaxGraphRequest(params);
- }
- function ajaxGraphRequest(params) {
- var graphParams = JSON.parse(JSON.stringify(params));
- graphParams.mode = 'graph'
- $.get(get_url_path() + '/ajax/phaenologie', graphParams,
- function (data) {
- if (data !== 'FALSE') {
- var waitForMenuRequest = setInterval(function() {
- if(menuRequestFinished) {
- clearInterval(waitForMenuRequest);
- $('#phaenologie .graph-container').html(data);
- plotPhaenologie();
- }
- }, 20);
- }
- },'html')
- .always(function() {
- });
- }
- //Tab-Buttons
- $('.btn-phaeno-tab').off('click').on('click', function(e) {
- if($(this).hasClass('tab-current') || lockUI) return;
- var oldParams = getPhaenoParams();
- $('.btn-phaeno-tab').removeClass('tab-current');
- $(this).addClass('tab-current');
- $('#phaenologie').attr('data-city', $(this).data('value'));
- var newParams = getPhaenoParams();
- pushPhaenoUrl(oldParams, newParams);
- ajaxMenuRequest(newParams);
- });
- //Station-Buttons
- $('.btn-phaeno-station').off('click').on('click', function(e) {
- if($(this).hasClass('btn-active') || lockUI) return;
- var oldParams = getPhaenoParams();
- $('.btn-phaeno-station').removeClass('btn-active');
- $(this).addClass('btn-active');
- var newParams = getPhaenoParams();
- pushPhaenoUrl(oldParams, newParams);
- ajaxMenuRequest(newParams);
- });
- //Jahr-Buttons
- $('.btn-phaeno-year').off('click').on('click', function(e) {
- if($(this).hasClass('btn-active') || lockUI) return;
- var oldParams = getPhaenoParams();
- $('.btn-phaeno-year').removeClass('btn-active');
- $(this).addClass('btn-active');
- var newParams = getPhaenoParams();
- pushPhaenoUrl(oldParams, newParams);
- phaenologieShowYear($(this).data('value'));
- });
- //Pflanzen-Typ Tab-Buttons
- $('.plant-type-selection .plant-type-tab-button').off('click').on('click', function(e) {
- if($(this).hasClass('active') || lockUI) return;
- var oldParams = getPhaenoParams();
- var newParams = getPhaenoParams();
- newParams.plant_id = $(this).data('plant-type');
- $('.plant-type-selection .plant-type-tab-button').removeClass('active');
- $(this).addClass('active');
- pushPhaenoUrl(oldParams, newParams);
- ajaxMenuRequest(newParams);
- });
- //Pflanzen-Dropdown
- var oldPlantParams = getPhaenoParams();
- $('.plant-select').off('change').on('change', function(e) {
- if(lockUI) return;
- var newParams = getPhaenoParams();
- pushPhaenoUrl(oldPlantParams, newParams);
- ajaxMenuRequest(newParams);
- });
- function pushPhaenoUrl(oldParams, newParams, replace) {
- var old_url = window.location.href;
- var old_city_id = oldParams.city_id;
- var new_url_params = newParams.city_id + '-' + newParams.city + '/' + newParams.station_id + '-' + newParams.station + '/' + newParams.plant_id + '-' + newParams.plant + '/';
- if(newParams.year)
- new_url_params += newParams.year + '/';
- var index_of_old_city_id = old_url.indexOf(old_city_id);
- var new_url = '';
- if (index_of_old_city_id !== -1) {
- new_url = old_url.substring(0, index_of_old_city_id) + new_url_params;
- }
- else {
- new_url = old_url + '/' + new_url_params;
- }
- var newTitle = 'Phänologie für ' + $('.btn-phaeno-station.btn-active').text() + ' | ' + historyUrl();
- if(replace) {
- if (History.replaceState) {
- no_reload = true;
- History.replaceState(null, newTitle, new_url);
- }
- } else {
- if (History.pushState) {
- no_reload = true;
- History.pushState(null, newTitle, new_url);
- }
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement