// jameda Widgets-Script; © jameda GmbH 2021 - www.jameda.de
(function() {

	//a replacement for old jQuery's  $(document).ready()
	if(document.readyState === 'loading') {
		document.addEventListener('DOMContentLoaded', jam_widget_init);
	} else {
		jam_widget_init();
	}

	function jam_widget_init() {
		const widgetContainerWithBadgeRowId = '#jameda-widget-container895457';
		const linkWithParams = 'www.jameda.de/grebenstein/zahnaerzte/oralchirurgen/fachgebiet/?utm_content=BWnote&utm_source=Kunden-Homepages&utm_medium=Badges&utm_term=81162802&utm_campaign=Badges';
		const linkNoParams = 'www.jameda.de/grebenstein/zahnaerzte/oralchirurgen/fachgebiet/';

		const selectedContainerWithJamLinkCheckId = document.querySelector(widgetContainerWithBadgeRowId + ' #jam_link_check');
		const selectedContainerWithJamLinkCheckClass = document.querySelector(widgetContainerWithBadgeRowId + ' .jam_link_check');
		const hrefFromSelectedContainerWithJamLinkCheckId = selectedContainerWithJamLinkCheckId ? selectedContainerWithJamLinkCheckId.getAttribute('href').replace(/https:\/\/|http:\/\//, '') : undefined;
		const hrefFromSelectedContainerWithJamLinkCheckClass = selectedContainerWithJamLinkCheckClass ? selectedContainerWithJamLinkCheckClass.getAttribute('href').replace(/https:\/\/|http:\/\//, '') : undefined;

		const toRemove = document.querySelector(widgetContainerWithBadgeRowId);

					if ( toRemove
				&& hrefFromSelectedContainerWithJamLinkCheckId !== linkWithParams
				&& hrefFromSelectedContainerWithJamLinkCheckId !== linkNoParams
				&& hrefFromSelectedContainerWithJamLinkCheckClass !== linkWithParams
				&& hrefFromSelectedContainerWithJamLinkCheckClass !== linkNoParams
			) {
				toRemove.remove();
			}
									let toAppend = document.createElement('span');
					toAppend.innerHTML ='<a href=\"https://www.jameda.de/grebenstein/zahnaerzte/implantologen/dr-dr-m-sc-rouven-boensel/uebersicht/81162802_1/?utm_content=BWnote&amp;utm_source=Kunden-Homepages&amp;utm_medium=Badges&amp;utm_term=81162802&amp;utm_campaign=Badges\" target=\"_blank\" style=\"display:block; position:absolute; top:5px; left:10px; width:70px; height:90px; text-align:center; text-decoration:none; border:0px; overflow:hidden; background-color:transparent !important;\"><div style=\"font-family:Arial; font-size:10px; line-height:12px; color:#fff;\">Von Patienten bewertet mit</div><div style=\"display:block; width:55px; margin:8px 0px 0px 6px; padding:3px 0px 4px 0px; border-radius:4px; color:#FFFFFF; text-align:center; text-shadow:1px 1px 1px rgba(0, 0, 0, 0.25); text-decoration:none; border-top:1px solid #8acf27; border-right:1px solid #77b41e; border-bottom:1px solid #76b21d; border-left:1px solid #8bd324; background:#84ca1e; background:linear-gradient(top,#8bd324 0%,#7cc118 100%);\">Note<div style=\"font-size:26px; line-height:28px; font-weight:bold; color:#fff;\">1,1</div></div></a>';
					document.querySelector('#jameda-widget-container895457').appendChild(toAppend);
					}

})();