function runAfterElementExists(jquery_selector, callback) {var checker = window.setInterval(function() {if ($(jquery_selector).length) {clearInterval(checker);callback();}}, 200);} runAfterElementExists('.variation-select', function() {function getSelection() {if ($('.variation-select:first-child>div>span').length > 0) {$('.currentSelection').removeClass('d-none');var csName_1 = $('.variation-select:first-child>div>span').html();var csSelection_1 = $('.variation-select>div>b').html();$('.currentSelection_1').html(csName_1 + ' ' + csSelection_1);};if ($('.variation-select:first-child>div>label').length > 0) {$('.currentSelection').removeClass('d-none');var csName_1 = $('.variation-select:first-child>div>label').html();var csSelection_1 = $('.variation-select select option:selected').text();$('.currentSelection_1').html(csName_1 + ' ' + csSelection_1);};if ($('.variation-select').length > 1) {if ($('.variation-select:last-child>div>span').length > 0) {var csName_2 = $('.variation-select:last-child>div>span').html();var csSelection_2 = $('.variation-select:last-child>div>b').html();$('.currentSelection_2').html(''+ csName_2 + ' ' + csSelection_2);};if ($('.variation-select:last-child>div>label').length > 0) {var csName_2 = $('.variation-select:last-child>div>label').html();var csSelection_2 = $('.variation-select select option:selected').text();$('.currentSelection_2').html(''+ csName_2 + ' ' + csSelection_2);};};};getSelection();$(".v-s-box ").click(function() {getSelection();});$(".variation-select select").change(function() {getSelection();});});var ArtNr = $('.variationID').html(); $('input[name="variationid"]').val('6228-43-GT');$(".ItemQuestionForm form > input[data-mail='subject']").val("Artikel-Nummer: " + ArtNr);$('.ItemQuestionForm input[name="Artikelnr."]').attr('disabled', 'disabled').val(ArtNr); runAfterElementExists('.shorttext', function() {$('.shorttext').ellipsis({lines: 5, ellipClass: 'ellip',responsive: true });}); runAfterElementExists('.variation-select', function() {$('.currentSelection').addClass('d-none');function getSelection() {var csName_1 = $('.variation-select:first-child label').html(); if($('.variation-select:first-child label').length < 1){var csName_1 = $('.variation-select:last-child>div>span').html();}; var csSelection_1 = $('.variation-select>div>b').html();$('.currentSelection_1').html(csName_1 + ' ' + csSelection_1); if($('.variation-select').length>1){var csName_2 = $('.variation-select:last-child>div>span').html();var csSelection_2 = $('.variation-select:last-child>div>b').html(); $('.currentSelection_2').html(' / '+ csName_2 + ' ' + csSelection_2);};}; getSelection();$(".v-s-box ").click(function() {getSelection();$('.currentSelection').removeClass('d-none'); });});