function getParameterByName(name,url){if(!url)url=window.location.href name=name.replace(/[\[\]]/g,"\\$&") var regex=new RegExp("[?&]"+name+"(=([^]*)|&|#|$)"),results=regex.exec(url) if(!results)return null if(!results[2])return"" return decodeURIComponent(results[2].replace(/\+/g," "))} function RetailerClock(){var _self=this var webservice="https://retailers.rolex.com/app/dealer/clock?colour=__COLOUR__&apiKey=__DEALER_API_KEY__&lang=__LANG__" var referer=document.referrer domainName=window.location.hostname this.getRetailerClock=function(config){this.config=config var newForm=webservice newForm=this.replaceValue(newForm,"__DEALER_API_KEY__",config.dealerAPIKey) newForm=this.replaceValue(newForm,"__LANG__",config.lang) newForm=this.replaceValue(newForm,"__COLOUR__",config.colour) var targetHTML=document.getElementById(_self.getContainerId()) if(targetHTML===null){var targetHTML_multiple=document.querySelectorAll(".rolex-retailer-clock")} var xhr=new XMLHttpRequest() xhr.open("GET",newForm) xhr.onload=function(){if(xhr.status===200){var response=JSON.parse(xhr.responseText) if(response.url!=null){var iframeHtml='
' if(targetHTML_multiple!=null||targetHTML_multiple!=undefined){for(var i=0;i