/* if (typeof geoPluginAdded == "undefined" && typeof geoplugin_countryCode == "undefined") { geoPluginAdded=1; var fileref=document.createElement('script'); fileref.setAttribute("type","text/javascript"); fileref.setAttribute("src", "http://www.geoplugin.net/javascript.gp"); document.getElementsByTagName("head")[0].appendChild(fileref); } */ if (typeof $ != "undefined" && typeof jQuery == "undefined") jQuery = $; if (typeof jQuery != "undefined") { console.log("mcm: jquery available"); var cpt=0; jQuery(".phone").remove(); console.log("mcm: "+jQuery("[data-tel-t]").length+" phone links"); jQuery("[data-tel-t]").each(function () { var $ = jQuery; cpt++; if (!$(this).attr('id')) $(this).attr("id", "tel-"+cpt); append = true; if ($(this).find("a").length) { append = false; $a = $(this).find("a"); console.log("mcm: existing ("+$(this).find("a").length+")"); } else { $a = $(""); console.log("mcm: new "); $a.html($(this).attr("data-tel-v")); } $a.addClass("phonelink"); if ($(this).attr("data-tel-class")) $a.addClass($(this).attr("data-tel-class")); var url = "https://www.monte-carlo.mc/phone/?v2=1&t="+$(this).attr("data-tel-t"); if ($(this).attr("data-tel-n")) url+="&n="+$(this).attr("data-tel-n"); if ($(this).attr("data-tel-lang")) url+="&lang="+$(this).attr("data-tel-lang"); //if (getCountryCodeFormatted()) url+="&cc="+getCountryCodeFormatted(); url+="&cc=FR"; $a.attr("href", url); if ($(this).attr("data-tel-popup")) { $a.attr("onclick", "window.open('"+url+"', 'phone"+cpt+"', 'height=200, width=650');return false;"); } if (append) { $(this).append($a); } //https://www.monte-carlo.mc/phone/?t=&n=&lang=&cc='+cc+' }); jQuery(window).trigger("tel-loaded"); } else { console.log("mcm: jquery not available"); } /* function getCountryCodeFormatted() { if (typeof geoplugin_countryCode != "undefined") { cc = geoplugin_countryCode(); if (cc=="FR" || cc=="MC" || cc=="BE" || cc=="CH" || cc=="LU" || cc=="CA" || cc=="US") { return cc; } return false; } return null; }*/