if(!window.console&&!console){var console=console||{};console.log=console.log||function(){}}var MJS=MJS||{},headTag=document.getElementsByTagName("head")[0]||document.documentElement;MJS.isXhtml=!1;MJS.cookieSupport=!0;try{document.write("")}catch(e$$5){MJS.isXhtml=!0}try{document.cookie.split(";")}catch(e$$6){MJS.cookieSupport=!1}
if(!MJS.loadScript){MJS.loadScript=function(a,c,d){var d=d||headTag,b=document.createElement("script");b.setAttribute("type","text/javascript");d.appendChild(b);b.setAttribute("src",a);if(c){var e=function(){c(b);b.removeEventListener("load",e,!1)};b.addEventListener("load",e,!1)}};window.MJSwrite=window.MJSw=function(a,c){var d=document.getElementById(a);if(document.createRange){var b=document.createRange();b.selectNodeContents(document.createElement("div"));b.deleteContents();b=b.createContextualFragment(c);
d.insertBefore(b,d.childNodes[0])}else d.insertAdjacentHTML("afterBegin",c)};var syncScriptTags=function(a){for(var c=document.getElementById(mads_ad_element_id).getElementsByTagName("script"),d=0;d<c.length;d++){var b=c[d];if(!0!==b.isLoaded)a?b.isLoaded=!0:b.src?MJS.loadScript(b.src):(b=b.innerHTML||"",b=b.replace("console.log(e);","throw e;"),eval(b))}};MJS.getXXIDCookie=function(){if(MJS.cookieSupport){var a,c,d,b=document.cookie.split(";");for(a=0;a<b.length;a++)if(c=b[a].substr(0,b[a].indexOf("=")),
d=b[a].substr(b[a].indexOf("=")+1),c=c.replace(/^\s+|\s+$/g,""),"mads_xxid_cookie"==c)return unescape(d)}};MJS.setXXIDCookie=function(a,c){if(MJS.cookieSupport){var d=new Date;d.setDate(d.getDate()+c);d=escape(a)+(null==c?"":"; expires="+d.toUTCString());document.cookie="mads_xxid_cookie="+d}};var MADSGetAd=function(a){this.initConfig(a);this.request()};MADSGetAd.prototype.initConfig=function(a){this.config=a||{};this.config.mads_type=a.mads_type||"live";this.config.mads_width_min=void 0!==a.mads_width_min?
a.mads_width_min:1;this.config.mads_width_max=void 0!==a.mads_width_max?a.mads_width_max:400;this.config.mads_height_min=void 0!==a.mads_height_min?a.mads_height_min:1;this.config.mads_height_max=void 0!==a.mads_height_max?a.mads_height_max:100;this.config.mads_width_optional=a.mads_width_optional||"false";this.config.mads_height_optional=a.mads_height_optional||"false";this.config.geolocation=a.geolocation||!1};MADSGetAd.prototype.request=function(){var a='<request type="'+this.config.mads_type+
'" zoneid="'+this.config.mads_zone_id+'" secret="'+this.config.mads_secret+'">',a=a+["<adselection_preferences>",'<width min="'+this.config.mads_width_min+'" max="'+this.config.mads_width_max+'" optional="'+this.config.mads_width_optional+'"/>','<height min="'+this.config.mads_height_min+'" max="'+this.config.mads_height_max+'" optional="'+this.config.mads_height_optional+'"/>',"</adselection_preferences>"].join(""),c=MJS.getXXIDCookie(),a=a+"<userinfo>";c&&(a+="<xxid>"+c+"</xxid>");this.config.geolocation&&
(a+=["<currentlocation>",'<gps latitude="'+this.config.geolocation.latitude+'" longitude="'+this.config.geolocation.longitude+'" radius="1000"/>',"</currentlocation>"].join(""));a=escape(a+"</userinfo></request>").replace("+","%2B").replace("%20","+").replace("*","%2A").replace("/","%2F").replace("@","%40");c=(new Date).getTime();a=("https:"==document.location.protocol?"https:":"http:")+"//eu1.madsone.com/req/adrequestjs.php?a="+a+"&u=&h=&d=false&n="+c;MJS.isXhtml?MJS.loadScript(a+"&elid="+this.config.mads_ad_element_id):
document.write('<script type="text/javascript" src="'+a+'"><\/script>')};MADSGetAd.prototype.write=MJSwrite}if(MJS.isXhtml)document.write=function(a){window.MJSw(window.mads_ad_element_id,a)};var mads_ad_element_id=mads_ad_element_id,mads_zone_id=mads_zone_id,mads_secret=mads_secret;void 0===window.mads_adrequest_autoload&&(mads_adrequest_autoload=!0);if(window.mads_ask_geolocation)window.mads_adrequest_autoload=!1;
if(mads_zone_id&&mads_secret){var config={mads_ad_element_id:window.mads_ad_element_id,mads_type:window.mads_type,mads_zone_id:window.mads_zone_id,mads_secret:window.mads_secret,mads_width_min:window.mads_width_min,mads_width_max:window.mads_width_max,mads_height_min:window.mads_height_min,mads_height_max:window.mads_height_max,mads_width_optional:window.mads_width_optional,mads_height_optional:window.mads_height_optional};window.mads_adrequest_autoload&&new window.MADSGetAd(config);window.mads_ask_geolocation&&
navigator.geolocation&&function(a){navigator.geolocation.getCurrentPosition(function(c){a.geolocation={latitude:c.coords.latitude,longitude:c.coords.longitude};var d=document.getElementById("debug_el");if(d)d.innerHTML="latitude: "+c.coords.latitude+"<br>longitude: "+c.coords.longitude;new window.MADSGetAd(a)},function(){new window.MADSGetAd(a)},{timeout:5E3,maximumAge:9E5,enableHighAccuracy:!0})}(config)};
