var _gaq = _gaq || [];
var hsbConfig = {
baseurl: "\/\/www.highstreetmobile.com\/_themes\/banner\/css\/riviera",
ipad: { experimentsID:  "" , variations: [{"template":"<aside id=\"smart-app-banner-highstreet\" class=\"hsb-wrap hsb-riviera\" style=\"display: none\"><div class=\"hsb-device\"><div class=\"hsb-speaker\"><\/div><div class=\"hsb-camera\"><\/div><div class=\"hsb-screen\"><\/div><div class=\"hsb-home-button\"><\/div><div class=\"hsb-touch-id\"><\/div><\/div><div class=\"hsb-content\"><h1 class=\"hsb-title\">Entdecke die Rivi\u00e8ra Maison App<\/h1><ul class=\"hsb-benefits\"><li>Superschnell<\/li> <li>Einfach zu handhaben<\/li> <li>Ausgestattet mit anwenderfreundlichen Zahlungsm\u00f6glichkeiten<\/li><\/ul><div class=\"hsb-content-left\"><p class=\"hsb-already-installed\">Hast du unsere App?<\/p><a class=\"hsb-open\">App \u00f6ffnen<\/a><\/div><div class=\"hsb-content-right\"><a class=\"hsb-download\">Download<\/a><\/div><span class=\"hsb-rating\"><ul class=\"hsb-stars\"><\/ul>reviews<\/span><\/div><a href=\"#\" class=\"hsb-close\"><\/a><\/aside>","style":"bottom-banner"}] },
iphone: { experimentsID:  "" , variations: [{"template":"<aside id=\"smart-app-banner-highstreet\" class=\"hsb-wrap hsb-riviera\" style=\"display: none\"><div class=\"hsb-device\"><div class=\"hsb-speaker\"><\/div><div class=\"hsb-camera\"><\/div><div class=\"hsb-screen\"><\/div><div class=\"hsb-home-button\"><\/div><div class=\"hsb-touch-id\"><\/div><\/div><div class=\"hsb-content\"><h1 class=\"hsb-title\">Entdecke die Rivi\u00e8ra Maison App<\/h1><ul class=\"hsb-benefits\"><li>Und erfahre ein entspanntes und inspirierendes Shopping-Erlebnis auf deinem iPhone<\/li>  <\/ul><div class=\"hsb-content-left\"><p class=\"hsb-already-installed\">Hast du unsere App?<\/p><a class=\"hsb-open\">App \u00f6ffnen<\/a><\/div><div class=\"hsb-content-right\"><a class=\"hsb-download\">Download<\/a><\/div><span class=\"hsb-rating\"><ul class=\"hsb-stars\"><\/ul>reviews<\/span><\/div><a href=\"#\" class=\"hsb-close\"><\/a><\/aside>","style":"bottom-banner"}] },
android: { experimentsID:  "" , variations: [{"template":"<aside id=\"smart-app-banner-highstreet\" class=\"hsb-wrap hsb-riviera\" style=\"display: none\"><div class=\"hsb-device\"><div class=\"hsb-speaker\"><\/div><div class=\"hsb-camera\"><\/div><div class=\"hsb-screen\"><\/div><div class=\"hsb-home-button\"><\/div><div class=\"hsb-touch-id\"><\/div><\/div><div class=\"hsb-content\"><h1 class=\"hsb-title\">Entdecke die Rivi\u00e8ra Maison App<\/h1><ul class=\"hsb-benefits\"><li>Und erfahre ein entspanntes und inspirierendes Shopping-Erlebnis auf deinem Smartphone<\/li>  <\/ul><div class=\"hsb-content-left\"><p class=\"hsb-already-installed\">Hast du unsere App?<\/p><a class=\"hsb-open\">App \u00f6ffnen<\/a><\/div><div class=\"hsb-content-right\"><a class=\"hsb-download\">Download<\/a><\/div><span class=\"hsb-rating\"><ul class=\"hsb-stars\"><\/ul>reviews<\/span><\/div><a href=\"#\" class=\"hsb-close\"><\/a><\/aside>","style":"bottom-banner"}] },
analyticsID: "",
urlscheme: "riviera:\/\/",
itunesID:  "1225222186" ,
playID:  "com.rivieramaison.highstreet.app" ,
cookieExpiration: 14,
requiredOSVersion: {'ios': '8.0', 'android': '5.0'},
appstoreUrl:  "itms-apps:\/\/itunes.apple.com\/de\/app\/id1225222186" ,
playstoreUrl:  "market:\/\/details?id=com.rivieramaison.highstreet.app" ,
blacklistedUserAgents:  [] ,
hideBannerWhenNoDeeplink: 0
};

if ( document.readyState != "loading" ) { setTimeout(function() { hsbStart(); }, 100); } else { document.addEventListener("DOMContentLoaded", function() { hsbStart(); }) };
function Cookie(name,opts){function find(){var start=document.cookie.indexOf(name+"=");if(-1==start)return null;if(name!=document.cookie.substr(start,name.length))return null;var len=start+name.length+1,end=document.cookie.indexOf(";",len);return-1==end&&(end=document.cookie.length),JSON.parse(unescape(document.cookie.substring(len,end)))}function getOptions(include_expires){include_expires=include_expires!==!1;var opts=[];for(key in options)if(options[key])if("expires"==key){if(include_expires){var today=new Date,ttl=864e5*options.expires;opts.push("expires="+new Date(today.getTime()+ttl).toUTCString()),opts.push("max-age="+ttl/1e3)}}else"secure"==key?opts.push("secure"):opts.push(key+"="+options[key]);return opts.length?";"+opts.join(";"):""}if(!name||"string"!=typeof name)throw"Cookie name must be a valid string: "+name+" ("+typeof name+") given.";this.name=name;var data=find()||{},options={};opts=opts||{},options.expires=opts.expires||null,options.domain=opts.domain||null,options.path=opts.path||null,options.secure=opts.secure||!1,this.get=function(key){return data[key]},this.set=function(key,value){data[key]=value,this.save()},this["delete"]=function(key){delete that.data[key],this.save()},this.save=function(){document.cookie=this.name+"="+escape(JSON.stringify(data))+getOptions()},this.destroy=function(){document.cookie=this.name+"="+getOptions(!1)+";expires=Thu, 01 Jan 1970 00:00:00 GMT;max-age:0"}}var hsbStart=function(){function getDeviceInfo(){var userAgent=navigator.userAgent,isiPad=/iPad/i.test(userAgent),isiPod=/iPod/i.test(userAgent),isiPhone=/iPhone/i.test(userAgent),isAndroid=/Android/i.test(userAgent);device="unknown",isiPod?device="iphone":isiPhone?device="iphone":isiPad?device="ipad":isAndroid&&(device="android");var deviceInfo={os:"",version:0,supported:!1,device:device};if(isiPad||isiPhone||isiPod){deviceInfo.os="ios";var version,match=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);void 0!==match&&null!==match?(version=[parseInt(match[1],10),parseInt(match[2],10),parseInt(match[3]||0,10)],deviceInfo.version=parseFloat(version.join(".")),deviceInfo.version>=hsbConfig.requiredOSVersion.ios&&(deviceInfo.supported=!0)):deviceInfo.supported=!0}else if(isAndroid){ua=userAgent.toLowerCase();var match=ua.match(/android\s([0-9\.]*)/);deviceInfo.os="android",match[1]?(deviceInfo.version=match[1],deviceInfo.version>=hsbConfig.requiredOSVersion.android&&(deviceInfo.supported=!0)):deviceInfo.supported=!0}return deviceInfo}var i,minimumAppRating=4,zoomdelay=100,deviceInfo=getDeviceInfo(),analyticsjs="function"==typeof ga;for(i=0;i<hsbConfig.analyticsID.length;i++)analyticsjs?ga("create",hsbConfig.analyticsID[i],"auto",{name:"bannertracker"+i}):_gaq.push(["bannertracker"+i+"._setAccount",hsbConfig.analyticsID[i]]);var trackEvent=function(name,message){message="undefined"!=typeof message?message+" - "+appUrl:appUrl;var i;for(i=0;i<hsbConfig.analyticsID.length;i++)analyticsjs?ga("bannertracker"+i+".send","event","Smart App Banner",name,message):_gaq.push(["bannertracker"+i+"._trackEvent","Smart App Banner",name,message])},trackError=function(message){trackEvent("Error",message)},appUrl=null!=document.querySelector("meta[property='al:ios:url']")?document.querySelector("meta[property='al:ios:url']").getAttribute("content"):void 0;if(void 0==appUrl){if(hsbConfig.hideBannerWhenNoDeeplink)return;if("undefined"!=typeof smartAppBannerContent){var category=smartAppBannerContent.category?"categories/"+smartAppBannerContent.category:"",product=smartAppBannerContent.product?"products/"+smartAppBannerContent.product:"";category=category||product?category:"home",appUrl=hsbConfig.urlscheme+category+(product?"/":"")+product}else appUrl=hsbConfig.urlscheme+"home"}if(deviceInfo.supported){if("undefined"!=typeof hsbConfig.blacklistedUserAgents&&hsbConfig.blacklistedUserAgents.length>0)for(i=0;i<hsbConfig.blacklistedUserAgents.length;i++)if("undefined"!=typeof hsbConfig.blacklistedUserAgents[i]&&""!=hsbConfig.blacklistedUserAgents[i]&&-1!=navigator.userAgent.indexOf(hsbConfig.blacklistedUserAgents[i]))return;var cookie=new Cookie("smart-app-banner",{path:"/",expires:hsbConfig.cookieExpiration});if(!cookie.get("hidden")){var prototypeAvailable="undefined"!=typeof Prototype,jqueryAvailable="undefined"!=typeof jQuery;if(!prototypeAvailable&&!jqueryAvailable)return void console.error("HS Smart banner: Neither Prototype or Jquery found, canceling");var updateZoom=function($banner,portraitmode){setTimeout(function(){var css,devicewidth=portraitmode?window.screen.width:window.screen.height,windowwidth=window.innerWidth,zoom=windowwidth/devicewidth;"ios"==deviceInfo.os?css={zoom:zoom,fontSize:10*zoom+"px"}:"android"==deviceInfo.os&&(portraitmode||(zoom=1),css={zoom:zoom}),prototypeAvailable?$banner.setStyle(css):jqueryAvailable&&$banner.css(css)},zoomdelay)},hide=function($banner){prototypeAvailable?($banner.removeClassName("hsb-show").addClassName("hsb-hide"),setTimeout(function(){$banner.addClassName("hidden").addClassName("hsb-hidden")},1e3)):jqueryAvailable&&($banner.removeClass("hsb-show").addClass("hsb-hide"),setTimeout(function(){$banner.addClass("hidden").addClass("hsb-hidden")},1e3))},showBanner=function(variation){if(0!==hsbConfig[deviceInfo.device].variations.length){if("undefined"==typeof hsbConfig[deviceInfo.device].variations[variation])return void trackError("Variation not found --"+variation);var $banner=loadTemplate(variation,appUrl);loadStylesheet(variation,function(){document.getElementsByClassName("hsb-device")[0].className+=" hsb-"+deviceInfo.os,document.getElementsByClassName("hsb-content")[0].className+=" hsb-"+deviceInfo.os;var downloadButton=document.getElementsByClassName("hsb-download")[0],content=(document.getElementsByClassName("hsb-open")[0],document.getElementsByClassName("hsb-content")[0]),leftContent=document.getElementsByClassName("hsb-content-left")[0],rightContent=document.getElementsByClassName("hsb-content-right")[0];"ipad"==deviceInfo.device&&(leftContent.style.textAlign="center",rightContent.style.marginBottom="0px",leftContent.getElementsByClassName("hsb-already-installed")[0].style["float"]="right",leftContent.getElementsByClassName("hsb-already-installed")[0].style.clear="both",leftContent.getElementsByClassName("hsb-open")[0].style["float"]="right",leftContent.getElementsByClassName("hsb-open")[0].style.clear="both"),"ios"==deviceInfo.os?downloadButton.href=hsbConfig.appstoreUrl:"android"==deviceInfo.os&&(downloadButton.href=hsbConfig.playstoreUrl),"ios"!=deviceInfo.os&&(content.className+=" hsb-no-deeplink"),prototypeAvailable?$banner.addClassName("hsb-show"):jqueryAvailable&&$banner.addClass("hsb-show"),cookie.get("shown")||cookie.set("shown",!0),trackEvent("View")})}},loadTemplate=function(variation,appUrl){prototypeAvailable?$$("body")[0].insert({top:hsbConfig[deviceInfo.device].variations[variation].template}):jqueryAvailable&&$("body").prepend(hsbConfig[deviceInfo.device].variations[variation].template);var $banner;if(prototypeAvailable?$banner=$("smart-app-banner-highstreet"):jqueryAvailable&&($banner=$("#smart-app-banner-highstreet")),"undefined"!=typeof $banner){loadAppRating($banner);var mql=window.matchMedia("(orientation: portrait)");updateZoom($banner,mql.matches),mql.addListener(function(m){updateZoom($banner,mql.matches)});var $download;prototypeAvailable?$download=$banner.down(".hsb-download"):jqueryAvailable&&($download=$banner.find(".hsb-download"));var $open;prototypeAvailable?$open=$banner.down(".hsb-open"):jqueryAvailable&&($open=$banner.find(".hsb-open")),$download&&("ios"==deviceInfo.os?appstoreUrl=hsbConfig.appstoreUrl:"android"==deviceInfo.os&&(appstoreUrl=hsbConfig.playstoreUrl),$download.on("touchend",function(e){prototypeAvailable?Event.stop(e):jqueryAvailable&&e.stopPropagation(),window.location=appstoreUrl,window.setTimeout(function(){hide($banner)},100),cookie.set("downloaded",!0),trackEvent("Download app"),trackEvent("Download")})),$open&&$open.on("touchend",function(e){prototypeAvailable?Event.stop(e):jqueryAvailable&&e.stopPropagation(),window.location=appUrl,window.setTimeout(function(){hide($banner)},100),cookie.set("opened",!0),trackEvent("Open app"),trackEvent("Open")}),$banner.on("touchstart","a",function(e,el){prototypeAvailable?el.addClassName("down").addClassName("hsb-down"):jqueryAvailable&&$(el).addClass("down").addClass("hsb-down")}),$banner.on("touchend","a",function(e,el){prototypeAvailable?el.removeClassName("down").removeClassName("hsb-down"):jqueryAvailable&&$(el).removeClass("down").removeClass("hsb-down")});var $close;return prototypeAvailable?$close=$banner.down(".hsb-close"):jqueryAvailable&&($close=$banner.find(".hsb-close")),$close.on("touchend",function(e){prototypeAvailable?Event.stop(e):jqueryAvailable&&e.stopPropagation(),cookie.set("hidden",!0),trackEvent("Close"),hide($banner)}),$banner}},loadStylesheet=function(variation,callback){if(prototypeAvailable){var $stylesheet=new Element("link",{type:"text/css",rel:"stylesheet",href:hsbConfig.baseurl+"-"+deviceInfo.device+"-"+hsbConfig[deviceInfo.device].variations[variation].style+".css?v=1499697301884"});$stylesheet.on("load",function(){callback()}),$$("head")[0].insert($stylesheet)}else jqueryAvailable&&($("<link/>",{rel:"stylesheet",href:hsbConfig.baseurl+"-"+device+"-"+hsbConfig[deviceInfo.device].variations[variation].style+".css?v=1499697301884"}).appendTo("head"),setTimeout(function(){callback()},500))},loadExperiment=function(javascriptUrl,callback){var $javascript=new Element("script",{type:"text/javascript",src:javascriptUrl}),called=!1,fallback=setTimeout(function(){called=!0,callback(0)},6e3);$javascript.on("load",function(){var variation=cxApi.chooseVariation();clearTimeout(fallback),called||callback(variation)}),$$("head")[0].insert($javascript)},loadAppRating=function($banner){var $rating;if(prototypeAvailable?$rating=$banner.down(".hsb-rating"):jqueryAvailable&&($rating=$banner.find(".hsb-rating")),"undefined"!=typeof $rating){"ipad"==deviceInfo.device&&(document.getElementsByClassName("hsb-rating")[0].style.display="inline-block");var $stars;prototypeAvailable?$stars=$rating.down(".hsb-stars"):jqueryAvailable&&($stars=$rating.find(".hsb-stars")),getAppRating(hsbConfig.itunesID,function(object){if("undefined"!=typeof object.rating&&"undefined"!=typeof object.ratingCount){if(object.rating<minimumAppRating)return;for(var roundedRating=Math.floor(object.rating),hasHalf=object.rating>roundedRating,starHTMLString="",i=1;6>i;i++)roundedRating>=i?starHTMLString+='<li class="hsb-star hsb-star-full"></li>':(starHTMLString+='<li class="hsb-star hsb-star-empty"></li>',hasHalf&&roundedRating==i-1&&(starHTMLString+='<li class="hsb-star hsb-star-half"></li>'));prototypeAvailable?($stars.insert({bottom:starHTMLString,after:" "+object.ratingCount+" "}),$rating.addClassName("hsb-show")):($stars.append(starHTMLString).after(" "+object.ratingCount+" "),$rating.addClass("hsb-show"))}},{country:"nl"})}},getAppRating=function(id,callback,params){params=params||{},params.id=id;var onSuccessFunction=function(response){var data;if(prototypeAvailable?data=response.responseJSON:jqueryAvailable&&(data=response),data.resultCount>0){var v=data.results[0],obj={};obj.rating=v.averageUserRating,obj.ratingCount=v.userRatingCount,v.hasOwnProperty("averageUserRatingForCurrentVersion")&&v.averageUserRatingForCurrentVersion>=v.averageUserRating&&v.userRatingCountForCurrentVersion>=10&&(obj.rating=v.averageUserRatingForCurrentVersion,obj.ratingCount=v.userRatingCountForCurrentVersion),callback(obj)}else"country"in params?callback({}):getAppRating(id,callback,{country:"nl"})},itunesUrl="https://itunes.apple.com/lookup";if(prototypeAvailable){new Ajax.JSONRequest(itunesUrl,{parameters:params,method:"get",onSuccess:onSuccessFunction})}else jqueryAvailable&&$.ajax({url:itunesUrl,data:params,dataType:"jsonp",success:onSuccessFunction})};hsbConfig[deviceInfo.device].variations.length>1&&hsbConfig[deviceInfo.device].experimentsID?loadExperiment("//www.google-analytics.com/cx/api.js?experiment="+hsbConfig[deviceInfo.device].experimentsID,showBanner):showBanner(0)}}};"undefined"!=typeof Prototype&&(Ajax.JSONRequest=Class.create(Ajax.Base,function(){var id=0,head=document.getElementsByTagName("head")[0]||document.body;return{initialize:function($super,url,options){$super(options),this.options.url=url,this.options.callbackParamName=this.options.callbackParamName||"callback",this.options.timeout=this.options.timeout||10,this.options.invokeImmediately=Object.isUndefined(this.options.invokeImmediately)?!0:this.options.invokeImmediately,!Object.isUndefined(this.options.parameters)&&Object.isString(this.options.parameters)&&(this.options.parameters=this.options.parameters.toQueryParams()),this.options.invokeImmediately&&this.request()},_cleanup:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.transport&&Object.isElement(this.transport)&&(this.transport.remove(),this.transport=null)},request:function(){var response=new Ajax.JSONResponse(this),key=this.options.callbackParamName,name="_prototypeJSONPCallback_"+id++,complete=function(){Object.isFunction(this.options.onComplete)&&this.options.onComplete.call(this,response),Ajax.Responders.dispatch("onComplete",this,response)}.bind(this);void 0!==this.options.parameters[key]?name=this.options.parameters[key]:this.options.parameters[key]=name,this.options.parameters[key]=name;var url=this.options.url+((this.options.url.include("?")?"&":"?")+Object.toQueryString(this.options.parameters));window[name]=function(json){this._cleanup(),window[name]=void 0,response.status=200,response.statusText="OK",response.setResponseContent(json),Object.isFunction(this.options.onSuccess)&&this.options.onSuccess.call(this,response),Ajax.Responders.dispatch("onSuccess",this,response),complete()}.bind(this),this.transport=new Element("script",{type:"text/javascript",src:url}),Object.isFunction(this.options.onCreate)&&this.options.onCreate.call(this,response),Ajax.Responders.dispatch("onCreate",this),head.appendChild(this.transport),this.timeout=setTimeout(function(){this._cleanup(),window[name]=Prototype.emptyFunction,Object.isFunction(this.options.onFailure)&&(response.status=504,response.statusText="Gateway Timeout",this.options.onFailure.call(this,response)),complete()}.bind(this),1e3*this.options.timeout)},toString:function(){return"[object Ajax.JSONRequest]"}}}()),Ajax.JSONResponse=Class.create({initialize:function(request){this.request=request},request:void 0,status:0,statusText:"",responseJSON:void 0,responseText:void 0,setResponseContent:function(json){this.responseJSON=json,this.responseText=Object.toJSON(json)},getTransport:function(){return this.request?this.request.transport:void 0},toString:function(){return"[object Ajax.JSONResponse]"}})),"undefined"!=typeof jQuery&&"undefined"==typeof Prototype&&$.extend({getCss:function(urls,callback,nocache){"undefined"==typeof nocache&&(nocache=!1),$.when($.each(urls,function(i,url){nocache&&(url+="?_ts="+(new Date).getTime()),$.get(url,function(){$("<link>",{rel:"stylesheet",type:"text/css",href:url}).appendTo("head")})})).then(function(){"function"==typeof callback&&callback()})}});