var VizuryNotificationObject=VizuryNotificationObject||{NotificationOpen:"true",IframeEle:null,IframeBottom:null,ContainerHtmlId:"vizury-notification-container",cookie:null,advid:null,ImpressionLogUrl:"://www.vizury.com/Impression?",TemplateId:null,flag:!0,OnsiteBlurHtmlId:"vizury-notification-blur",OnsiteBlurEnabled:!1,reset:function(){VizuryNotificationObject.NotificationOpen="true"},createDivElementLocal:function(t){VizuryNotificationObject.reset(),VizuryNotificationObject.SetDivContent(t)},createDivElement:function(){var t=document.createElement("div");t.id=VizuryNotificationObject.ContainerHtmlId,document.body.appendChild(t),VizuryNotificationObject.makeAjaxCallStyle()},openTargetLink:function(t){var i=VizuryNotificationObject.ImpressionLogUrl+"click";VizuryNotificationObject.makeAjaxCall(i,"false"),window.open(t,"_blank").focus()},makeAjaxCallIE:function(t,i){xdr=new XDomainRequest,xdr.onload=function(){var t=xdr.responseText;0<t.length&&"true"===i&&VizuryNotificationObject.SetDivContent(t)},xdr.open("GET",t,!0),xdr.send()},makeAjaxCall:function(t,i){var e;if(1==!!window.XDomainRequest)VizuryNotificationObject.makeAjaxCallIE(t,i);else{try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){return!1}}}e.onreadystatechange=function(){if(4==e.readyState){var t=e.responseText;0<t.length&&"true"===i&&VizuryNotificationObject.SetDivContent(t)}},e.open("GET",t,!0),e.withCredentials=!0,e.send()}},getAdvid:function(){var t=pixel.detectCampaign();return t.substring(6,t.length)},getImpressionId:function(){var t=(new Date).getUTCMilliseconds(),i=Math.floor(1e8+9e8*Math.random());return VizuryNotificationObject.cookie+t.toString()+i.toString()},DetectUserAgent:function(){var t,i=navigator.userAgent,e=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(e[1])?"IE"+((t=/\brv[ :]+(\d+)/g.exec(i)||[])[1]||""):"Chrome"===e[1]&&null!=(t=i.match(/\bOPR\/(\d+)/))?"Opera"+t[1]:(e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=i.match(/version\/(\d+)/i))&&e.splice(1,1,t[1]),e[0]+e[1])},DetectMobileOrDesktop:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"Mobile":"Desktop"},CreateLogUrl:function(){var t=encodeURIComponent(window.location.href),i="https:"==document.location.protocol?"https":"http",e="DmpId="+VizuryNotificationObject.IframeEle.contentWindow.requestId+"&Id="+VizuryNotificationObject.IframeEle.contentWindow.id+"&vizid="+VizuryNotificationObject.cookie+"&force_adv_id=VIZVRM"+VizuryNotificationObject.advid+"&segid="+VizuryNotificationObject.IframeEle.contentWindow.segid+"&channelid="+VizuryNotificationObject.IframeEle.contentWindow.channelid+"&url="+t+"&pos="+VizuryNotificationObject.IframeEle.contentWindow.position+"&UserAgent="+VizuryNotificationObject.DetectUserAgent()+"&action=";VizuryNotificationObject.ImpressionLogUrl=i+VizuryNotificationObject.ImpressionLogUrl+e},fetchAnalyzeParameters:function(){var t=["page","user","fp2","prod","pname","online","appno","leadid","subprod","src","dest","doj","rd","ad","ch","inf","PageName","FlightCabin","FlightType"],e={};for(i in t)pixel.paramArray[t[i]]&&(e[t[i]]=pixel.paramArray[t[i]]);return e.deviceType=VizuryNotificationObject.DetectMobileOrDesktop(),encodeURIComponent(JSON.stringify(e))},makeAjaxCallStyle:function(){var t=encodeURIComponent(window.location.href);VizuryNotificationObject.cookie=pixel.getCookie("_vz"),VizuryNotificationObject.advid=VizuryNotificationObject.getAdvid();var i=VizuryNotificationObject.fetchAnalyzeParameters(),e=("https:"==document.location.protocol?"https://www.vizury.com/":"http://www.vizury.com/")+"GetContent?vizid="+VizuryNotificationObject.cookie+"&force_adv_id=VIZVRM"+VizuryNotificationObject.advid+"&url="+t+"&analyze_params="+i;VizuryNotificationObject.makeAjaxCall(e,"true")},SetDivContent:function(t){var i=t.split("<delimiter>");document.getElementById(VizuryNotificationObject.ContainerHtmlId).innerHTML=i[0],VizuryNotificationObject.SetIframeContent(i[1]),document.getElementById("vizury-notification-template").style.visibility="hidden",VizuryNotificationObject.CheckDeliveryWindow()},AdjustImageSize:function(){if(VizuryNotificationObject.IframeEle.contentWindow.window.hasOwnProperty("BannerJson")){var n=VizuryNotificationObject.IframeEle.contentWindow.position;VizuryNotificationObject.IframeEle.contentDocument.getElementById("container-div").style.border="none",0===n||1===n?VizuryNotificationObject.IframeEle.style.bottom="0px":2!==n&&3!==n||(VizuryNotificationObject.IframeEle.style.top="0px");var c=setInterval(function(){var t=null,i=VizuryNotificationObject.IframeEle.contentDocument.getElementById("container-div");if(i&&""!==i.innerHTML){var e=VizuryNotificationObject.IframeEle.contentDocument.getElementsByClassName("product");if((e=e.length?e[0]:void 0)&&(t=e.getElementsByTagName("img").length?e.getElementsByTagName("img")[0]:void 0),t&&0<parseInt(e.offsetWidth)&&0<parseInt(e.offsetHeight)){var o=new Image;o.onload=function(){VizuryNotificationObject.IframeEle.style.display="block",i.style.height=parseInt(e.offsetHeight).toString()+"px",i.style.width=parseInt(e.offsetWidth).toString()+"px",5===n||6===n||7===n||8===n?(VizuryNotificationObject.IframeEle.style.height=(parseInt(e.offsetHeight)+4).toString()+"px",VizuryNotificationObject.IframeEle.style.width=(parseInt(e.offsetWidth)+4).toString()+"px",VizuryNotificationObject.IframeBottom="-"+(parseInt(e.offsetHeight)+4).toString()+"px",VizuryNotificationObject.IframeRight="-"+(parseInt(e.offsetWidth)+4).toString()+"px"):(VizuryNotificationObject.IframeEle.style.height=(parseInt(e.offsetHeight)+26).toString()+"px",VizuryNotificationObject.IframeEle.style.width=(parseInt(e.offsetWidth)+21).toString()+"px",VizuryNotificationObject.IframeBottom="-"+(parseInt(e.offsetHeight)+26).toString()+"px",VizuryNotificationObject.IframeRight="-"+(parseInt(e.offsetWidth)+21).toString()+"px"),VizuryNotificationObject.IframeEle.contentDocument.getElementById("container-div").style.border="",document.getElementById("vizury-notification-template").style.visibility="visible",VizuryNotificationObject.OpenMaximizedOrMinimized()},o.src=t.src,clearInterval(c)}}},200)}else{var t=VizuryNotificationObject.IframeEle.contentWindow.height,i=VizuryNotificationObject.IframeEle.contentWindow.width,e=parseInt(t)+26,o=parseInt(i)+21;VizuryNotificationObject.IframeEle.style.height=e.toString()+"px",VizuryNotificationObject.IframeEle.style.width=o.toString()+"px",VizuryNotificationObject.IframeBottom="-"+e.toString()+"px",0===(n=VizuryNotificationObject.IframeEle.contentWindow.position)||1===n?VizuryNotificationObject.IframeEle.style.bottom=VizuryNotificationObject.IframeBottom:2!==n&&3!==n||(VizuryNotificationObject.IframeEle.style.top=VizuryNotificationObject.IframeBottom)}},OpenMaximizedOrMinimized:function(){1===VizuryNotificationObject.IframeEle.contentWindow.initialState&&VizuryNotificationObject.ForceToggle()},ForceToggle:function(){var t=t||VizuryNotificationObject.IframeEle.contentWindow.position;VizuryNotificationObject.GetAnchorText(t);VizuryNotificationObject.AlignMinimizeForCenterPositions(t),VizuryNotificationObject.ForceDirectionHide(VizuryNotificationObject.IframeEle,t),VizuryNotificationObject.NotificationOpen="false"},InitialPosition:function(){var t=VizuryNotificationObject.IframeEle.contentWindow.position;0===t||1===t?VizuryNotificationObject.IframeEle.style.bottom=VizuryNotificationObject.IframeBottom:2!==t&&3!==t||(VizuryNotificationObject.IframeEle.style.top=VizuryNotificationObject.IframeBottom)},CloseOrMinimize:function(){var t=VizuryNotificationObject.IframeEle,i=i||t.contentWindow.CloseOrMinimize;4===VizuryNotificationObject.IframeEle.contentWindow.position?(t.contentDocument.getElementById("div-minimise").style.display="none",t.contentDocument.getElementById("div-close").style.display="block"):0===i?(t.contentDocument.getElementById("div-minimise").style.display="none",t.contentDocument.getElementById("div-close").style.display="block"):1===i?(t.contentDocument.getElementById("div-minimise").style.display="block",t.contentDocument.getElementById("div-close").style.display="none"):t.contentDocument.getElementById("div-minimise").style.right="30px"},ShowMinimizeImageIcon:function(){var t=t||VizuryNotificationObject.IframeEle.contentWindow.position,i=VizuryNotificationObject.GetAnchorText(t);parent.document.getElementById(i).style.visibility="visible"},transAnimationTopAndBottom:function(t,i,e,o){var n=setInterval(function(){t.style[i]=e+"px",o<0?(e-=2)<o&&(t.style[i]=o+"px",VizuryNotificationObject.ShowMinimizeImageIcon(),clearInterval(n)):o<(e+=2)&&(t.style[i]=o+"px",clearInterval(n))},1)},triggerNotiBottom:function(t,i){VizuryNotificationObject.transAnimationTopAndBottom(t,"bottom",i,0)},triggerNotiTop:function(t,i){VizuryNotificationObject.transAnimationTopAndBottom(t,"top",i,0)},ForceDirectionHide:function(t,i){switch(i){case 0:case 1:case 8:t.style.bottom=parseInt(VizuryNotificationObject.IframeBottom)+"px";break;case 2:case 3:case 6:t.style.top=parseInt(VizuryNotificationObject.IframeBottom)+"px";break;case 5:t.style.right=parseInt(VizuryNotificationObject.IframeRight)+"px";break;case 7:t.style.left=parseInt(VizuryNotificationObject.IframeRight)+"px"}VizuryNotificationObject.ShowMinimizeImageIcon()},AnimateDirectionHide:function(t,i){switch(i){case 0:case 1:case 8:VizuryNotificationObject.transAnimationTopAndBottom(t,"bottom",0,parseInt(VizuryNotificationObject.IframeBottom));break;case 2:case 3:case 6:VizuryNotificationObject.transAnimationTopAndBottom(t,"top",0,parseInt(VizuryNotificationObject.IframeBottom));break;case 5:VizuryNotificationObject.transAnimationTopAndBottom(t,"right",0,parseInt(VizuryNotificationObject.IframeRight));break;case 7:VizuryNotificationObject.transAnimationTopAndBottom(t,"left",0,parseInt(VizuryNotificationObject.IframeRight))}},AnimateDirectionShow:function(t,i){switch(i){case 0:case 1:case 8:VizuryNotificationObject.transAnimationTopAndBottom(t,"bottom",parseInt(VizuryNotificationObject.IframeBottom),0);break;case 2:case 3:case 6:VizuryNotificationObject.transAnimationTopAndBottom(t,"top",parseInt(VizuryNotificationObject.IframeBottom),0);break;case 5:VizuryNotificationObject.transAnimationTopAndBottom(t,"right",parseInt(VizuryNotificationObject.IframeRight),0);break;case 7:VizuryNotificationObject.transAnimationTopAndBottom(t,"left",parseInt(VizuryNotificationObject.IframeRight),0)}},GetAnchorText:function(t){return 0==t||1==t||5==t||6==t||7==t||8==t?"AnchorText-01":"AnchorText-23"},Toggle:function(){var t=t||VizuryNotificationObject.IframeEle.contentWindow.position,i=VizuryNotificationObject.GetAnchorText(t);if(VizuryNotificationObject.AlignMinimizeForCenterPositions(t),"true"==VizuryNotificationObject.NotificationOpen){VizuryNotificationObject.AnimateDirectionHide(VizuryNotificationObject.IframeEle,t),VizuryNotificationObject.NotificationOpen="false";var e="";e=1==VizuryNotificationObject.TemplateId?VizuryNotificationObject.ImpressionLogUrl+"minimize":VizuryNotificationObject.IframeEle.contentWindow.window.config.impressionLogUrl+"minimize",VizuryNotificationObject.makeAjaxCall(e,"false"),VizuryNotificationObject.ToggleOnsiteBlur(!1,!1)}else{VizuryNotificationObject.AnimateDirectionShow(VizuryNotificationObject.IframeEle,t),document.getElementById(i).style.visibility="hidden",VizuryNotificationObject.NotificationOpen="true";e="";e=1==VizuryNotificationObject.TemplateId?VizuryNotificationObject.ImpressionLogUrl+"maximize":VizuryNotificationObject.IframeEle.contentWindow.window.config.impressionLogUrl+"maximize",VizuryNotificationObject.makeAjaxCall(e,"false"),VizuryNotificationObject.ToggleOnsiteBlur(!0,!1)}},SetIframeContent:function(t){var i=document.getElementById("vizury-notification-template").contentWindow.document;i.open(),i.write("<!DOCTYPE html>"),i.write(t),i.close(),VizuryNotificationObject.IframeEle=parent.document.getElementById("vizury-notification-template"),VizuryNotificationObject.CreateLogUrl()},close:function(){document.getElementById("vizury-notification-template").style.display="none";var t="";t=1==VizuryNotificationObject.TemplateId?VizuryNotificationObject.ImpressionLogUrl+"close":VizuryNotificationObject.IframeEle.contentWindow.window.config.impressionLogUrl+"close",VizuryNotificationObject.makeAjaxCall(t,"false"),VizuryNotificationObject.ToggleOnsiteBlur(!1,!1)},CheckDeliveryWindow:function(){var t=VizuryNotificationObject.IframeEle.contentWindow.From,i=VizuryNotificationObject.IframeEle.contentWindow.To,e=new Date;e.getHours(),e.getMinutes(),t.split(":"),i.split(":");VizuryNotificationObject.IdentifyEvent()},CallImpressionLogger:function(){var t="";t=1==VizuryNotificationObject.TemplateId?VizuryNotificationObject.ImpressionLogUrl+"impression":VizuryNotificationObject.IframeEle.contentWindow.window.config.impressionLogUrl+"impression",VizuryNotificationObject.makeAjaxCall(t,"false")},CreateOnsiteBlurDiv:function(){if(VizuryNotificationObject.IframeEle.contentWindow.notificationBlur&&1==VizuryNotificationObject.IframeEle.contentWindow.notificationBlur.enabled&&VizuryNotificationObject.IframeEle.contentWindow.notificationBlur.color){VizuryNotificationObject.OnsiteBlurEnabled=!0;var t=document.createElement("div");t.id=VizuryNotificationObject.OnsiteBlurHtmlId,document.getElementById("vizury-notification-container").appendChild(t),t.style="width: 100%; height: 100%; z-index: 199999970; position: fixed; top: 0; left: 0; opacity: 0.5",t.style.visibility="hidden",t.style.backgroundColor=VizuryNotificationObject.IframeEle.contentWindow.notificationBlur.color}},ToggleOnsiteBlur:function(t,i){i&&1===VizuryNotificationObject.IframeEle.contentWindow.initialState||VizuryNotificationObject.OnsiteBlurEnabled&&(document.getElementById(VizuryNotificationObject.OnsiteBlurHtmlId).style.visibility=t?"visible":"hidden")},IdentifyEvent:function(){VizuryNotificationObject.TemplateId=VizuryNotificationObject.IframeEle.contentWindow.Tid;var t=VizuryNotificationObject.IframeEle.contentWindow.eventId?VizuryNotificationObject.IframeEle.contentWindow.eventId:0,i=VizuryNotificationObject.IframeEle.contentWindow.notifyTrigger;switch(i&&(t=i.id,value=i.value),VizuryNotificationObject.CreateOnsiteBlurDiv(),t){case 0:VizuryNotificationObject.ExecuteEvent();break;case 1:VizuryNotificationObject.ExitEvent();break;case 2:VizuryNotificationObject.ExecuteEvent(value);break;case 3:VizuryNotificationObject.ScrollEvent(value);break;default:VizuryNotificationObject.ExecuteEvent()}},PullPageDown:function(){var t=document.createElement("div");t.setAttribute("id","vizury-pulldown-div"),t.style.height="50px",t.style.overflow="hidden";var i=document.getElementsByTagName("body")[0];i.insertBefore(t,i.firstChild)},PullPageUp:function(){var t=document.createElement("div");t.setAttribute("id","vizury-pullup-div"),t.style.height="50px",t.style.overflow="hidden",document.getElementsByTagName("body")[0].appendChild(t)},RenderStaticOnsiteNotification:function(t){VizuryNotificationObject.CloseOrMinimize(),VizuryNotificationObject.AdjustImageSize(),VizuryNotificationObject.InitialPosition(),0===t||1===t?VizuryNotificationObject.triggerNotiBottom(VizuryNotificationObject.IframeEle,parseInt(VizuryNotificationObject.IframeBottom)):2!==t&&3!==t||VizuryNotificationObject.triggerNotiTop(VizuryNotificationObject.IframeEle,parseInt(VizuryNotificationObject.IframeBottom)),document.getElementById("vizury-notification-template").style.visibility="visible",VizuryNotificationObject.CallImpressionLogger()},AlignMinimizeForCenterPositions:function(t){if(5===t||7===t){var i="translate(0%,-"+parseInt(VizuryNotificationObject.IframeEle.style.height)/2+"px)";document.getElementById("AnchorText-01").style.transform=i}else if(6===t||8===t){i="translate(-"+parseInt(VizuryNotificationObject.IframeEle.style.width)/2+"px,0%)";document.getElementById("AnchorText-01").style.transform=i}},ExecuteEvent:function(t){var i=t?1e3*t:1,e=e||VizuryNotificationObject.IframeEle.contentWindow.position;VizuryNotificationObject.IframeEle.contentWindow.eventId;switch(VizuryNotificationObject.TemplateId){case 1:case 3:VizuryNotificationObject.IframeEle.contentWindow.isActive&&setTimeout(function(){VizuryNotificationObject.RenderStaticOnsiteNotification(e),VizuryNotificationObject.ToggleOnsiteBlur(!0,!0)},i);break;case 6:default:setTimeout(function(){VizuryNotificationObject.CloseOrMinimize(),VizuryNotificationObject.AdjustImageSize(),VizuryNotificationObject.ToggleOnsiteBlur(!0,!0),VizuryNotificationObject.CallImpressionLogger()},i)}},ExitEvent:function(){var t=document.documentElement;t.addEventListener("mouseleave",function(t){if(20<t.clientY)return;e()}),t.addEventListener("keydown",function(t){{if(i)return;if(!t.metaKey||76!==t.keyCode)return}i=!0,e()});var i=!1;function e(){1==VizuryNotificationObject.flag&&(VizuryNotificationObject.ExecuteEvent(),VizuryNotificationObject.flag=!1)}},ScrollEvent:function(e){var t,i,o;t=window,i="scroll",o=function(t){var i=((window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop||0)+(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0))/Math.max(document.body.scrollHeight||0,document.documentElement.scrollHeight||0,document.body.offsetHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0,document.documentElement.clientHeight||0)*100;e<i&&1==VizuryNotificationObject.flag&&(VizuryNotificationObject.ExecuteEvent(),VizuryNotificationObject.flag=!1)},t.addEventListener?t.addEventListener(i,o,!1):t.attachEvent&&t.attachEvent("on"+i,o)}};

