1/* 2DO NOT TAKE A COPY OF THIS FILE! 3DO NOT COPY PARTS OF THIS FILE! 4THIS SCRIPT IS DYNAMICALLY GENERATED! 5*/ 6 7if(typeof AvvioWS == 'undefined') 8{ 9 var AvvioWS = {}; 10} 11 12/* CONFIG OPTIONS FROM OUTSIDE */ 13if ( ! AvvioWS.hasOwnProperty('debug') ) AvvioWS.debug = false; 14/* INTERNAL VALUES */ 15AvvioWS.languages = ["en"]; 16AvvioWS.lang = false 17AvvioWS.ref = (document.referrer) ? ('&r='+encodeURIComponent(document.referrer)) : ''; 18AvvioWS.loc = (document.URL) ? ('&l='+encodeURIComponent(document.URL)) : ''; 19AvvioWS.cachebuster = '&b=' + Math.round(Math.random() * 999999); 20AvvioWS.version = "&v=55b07f4f93e3a3bc55ef636fc546f2f3"; 21AvvioWS.appLocations = {"crm":"https:\/\/secure.radcork.com\/crm\/site\/Radisson Cork\/"}; 22 23AvvioWS.getLanguage = function() { 24 if(this.lang != false) 25 return this.lang; 26 return this.languages[0]; 27}; 28 29AvvioWS.getAppBaseURL = function(appName) { 30 return AvvioWS.appLocations[appName] || null; 31}; 32 33AvvioWS.getGenericURL = function(appName, lang, extra, args={}) { 34 var url = AvvioWS.getAppBaseURL(appName); 35 if(url == null) 36 return null; 37 38 if(lang !== null) 39 { 40 if(AvvioWS.languages.indexOf(lang) > -1) 41 url += lang + '/'; 42 } 43 44 url += extra; 45 46 delete args.lang; 47 const u = new URLSearchParams(args).toString(); 48 49 if(u.length > 0) 50 url += '?' + u; 51 52 var sep = (url.indexOf('?') == -1) ? '?' : '&'; 53 url += sep + 'fw_notemplate=1'; 54 55 return url; 56}; 57 58AvvioWS.getGenericModalURL = function(appName, lang, extra, args={}) { 59 if(url = AvvioWS.getGenericURL(appName, lang, extra, args)) 60 return 'javascript:AvvioWS.openBookingEngine(\''+url+'\');'; 61 return null; 62}; 63 64(function() { 65 var event = new CustomEvent('avvioWSSLoaded'); 66 document.dispatchEvent(event); 67 68 var d = document.getElementsByClassName('allora-action'); 69 for(let i=0; i<d.length; i++) 70 { 71 var lang = d[i].getAttribute('data-allora-lang'); 72 var args = {} 73 try 74 { 75 args = JSON.parse(d[i].getAttribute('data-allora-args') || '{}'); 76 } 77 catch(error) 78 { 79 console.log('Invalid JSON in data-allora-args attribute'); 80 } 81 82 if(d[i].getAttribute('data-allora-action') == 'modal-index') 83 { 84 if(url = AvvioWS.getGenericModalURL('convert5', lang, 'index.html', args)) 85 d[i].setAttribute('href', url); 86 } 87 else if(d[i].getAttribute('data-allora-action') == 'modal-results') 88 { 89 if(url = AvvioWS.getGenericModalURL('convert5', lang, 'results.php', args)) 90 d[i].setAttribute('href', url); 91 } 92 else if(d[i].getAttribute('data-allora-action') == 'modal-room') 93 { 94 var roomID = d[i].getAttribute('data-allora-roomID'); 95 var requiredArgs = {viewtype:'roomrate', partya:0, roomcode:roomID}; 96 if((url = AvvioWS.getGenericModalURL('convert5', lang, 'results.php', {...requiredArgs, ...args})) && ! isNaN(roomID)) 97 d[i].setAttribute('href', url); 98 } 99 else if(d[i].getAttribute('data-allora-action') == 'modal-rate') 100 { 101 var rateID = d[i].getAttribute('data-allora-rateID'); 102 var requiredArgs = {partya:0, noerr:1}; 103 if((url = AvvioWS.getGenericModalURL('convert5', lang, 'rate/'+rateID+'.html', {...requiredArgs, ...args})) && ! isNaN(rateID)) 104 d[i].setAttribute('href', url); 105 } 106 else if(d[i].getAttribute('data-allora-action') == 'modal-rategroup') 107 { 108 var rateGroupID = d[i].getAttribute('data-allora-rateGroupID'); 109 if((url = AvvioWS.getGenericModalURL('convert5', lang, 'rate_group/'+rateGroupID+'.html', {...args})) && ! isNaN(rateGroupID)) 110 d[i].setAttribute('href', url); 111 } 112 else if(d[i].getAttribute('data-allora-action') == 'modal-roomgroup') 113 { 114 var roomGroupCode = d[i].getAttribute('data-allora-roomGroupCode'); 115 var requiredArgs = {viewtype:'roomrate', partya:0, roomgroup:roomGroupCode}; 116 if((url = AvvioWS.getGenericModalURL('convert5', lang, 'results.php', {...requiredArgs, ...args}))) 117 d[i].setAttribute('href', url); 118 } 119 else if(d[i].getAttribute('data-allora-action') == 'modal-vouchers') 120 { 121 if(url = AvvioWS.getGenericModalURL('vouchers5', lang, 'index.html', {...args})) 122 d[i].setAttribute('href', url); 123 } 124 } 125 126 var event = new CustomEvent('avvioWSSDocumentParsed'); 127 document.dispatchEvent(event); 128 129}()); 130 131AvvioWS.openBookingEngineIndex = function(args={}) { 132 if(url = AvvioWS.getGenericURL('convert5', args.lang||null, 'index.html', args)) 133 AvvioWS.openBookingEngine(url); 134}; 135 136AvvioWS.openBookingEngineResults = function(args={}) { 137 if(url = AvvioWS.getGenericURL('convert5', args.lang||null, 'results.html', args)) 138 AvvioWS.openBookingEngine(url); 139}; 140 141AvvioWS.openBookingEngineRoom = function(roomID, args={}) { 142 var requiredArgs = {viewtype:'roomrate', partya:0, roomcode:roomID}; 143 if(url = AvvioWS.getGenericURL('convert5', args.lang||null, 'results.php', {...requiredArgs, ...args})) 144 AvvioWS.openBookingEngine(url); 145}; 146 147AvvioWS.openBookingEngineRate = function(rateID, args={}) { 148 var requiredArgs = {partya:0, noerr:1}; 149 if(url = AvvioWS.getGenericURL('convert5', args.lang||null, 'rate/'+rateID+'.html', {...requiredArgs, ...args})) 150 AvvioWS.openBookingEngine(url); 151}; 152 153AvvioWS.openBookingEngineRateGroup = function(rateGroupID, args={}) { 154 if(url = AvvioWS.getGenericURL('convert5', args.lang||null, 'rate_group/'+rateGroupID+'.html', {...args})) 155 AvvioWS.openBookingEngine(url); 156}; 157 158AvvioWS.openBookingEngineRoomGroup = function(roomGroupCode, args={}) { 159 var requiredArgs = {viewtype:'roomrate', partya:0, roomgroup:roomGroupCode}; 160 if(url = AvvioWS.getGenericURL('convert5', args.lang||null, 'results.php', {...requiredArgs, ...args})) 161 AvvioWS.openBookingEngine(url); 162}; 163 164AvvioWS.openVoucherEngineIndex = function(args={}) { 165 if(url = AvvioWS.getGenericURL('vouchers5', args.lang||null, 'index.html', args)) 166 AvvioWS.openBookingEngine(url); 167}; 168 169AvvioWS.openVoucherBalanceChecker = function(args={}) { 170 if(url = AvvioWS.getGenericURL('vouchers5', args.lang||null, 'balance_login.html', args)) 171 AvvioWS.openBookingEngine(url); 172}; 173 174/* 175=================================================== 176AI Tracking 177*/ 178 179AvvioWS.deployAI = function() 180{ 181 var aiLocation= 'https://secure.radcork.com/ai/rpc/Radisson%20Cork/image?el=nscs1YvxuWqzsR8098h854hg2R1lvaOkl3HY4OOGNeA' + this.cachebuster + this.ref + this.loc; 182 const aiImg = document.createElement('img'); 183 aiImg.src = aiLocation; 184 aiImg.width = 1; 185 aiImg.height = 1; 186 aiImg.id = 'avvioAIImage'; 187 document.querySelector('body').appendChild(aiImg); 188};const modalStyle = document.createElement('style'); 189modalStyle.textContent = atob('OnJvb3R7IC0tYm9yZGVyLXJhZGl1cy0xeDogOHB4OyB9I2F2dmlvLWxvZGl2IHsgZGlzcGxheTpmbGV4OyBmbGV4LXdyYXA6d3JhcDsgYWxpZ24taXRlbXM6Y2VudGVyOyBqdXN0aWZ5LWNvbnRlbnQ6Y2VudGVyOyB6LWluZGV4OiAxMDAxMDAwO30jYXZ2aW8tbW9kYWwtZnJhbWV7IHotaW5kZXg6IDEwMTAwMDsgfSNhdnZpby1sb2Rpdi5hdnZpby1sb2FkZXI6Ym
189Vmb3JlIHsJcG9zaXRpb246IGFic29sdXRlOwl0b3A6IGNhbGMoNTAlIC0gMjRweCk7CWxlZnQ6IGNhbGMoNTAlIC0gMjRweCk7CWJvcmRlcjogOHB4IHNvbGlkICM4QzkxOTY7CWJvcmRlci1yYWRpdXM6IDUwJTsJYm9yZGVyLXRvcDogOHB4IHNvbGlkIHRyYW5zcGFyZW50Owl3aWR0aDogNDhweDsJaGVpZ2h0OiA0OHB4Owktd2Via2l0LWFuaW1hdGlvbjogc2hvdy1zcGlubmVyIDAuMnMsIHNwaW4gMXMgMC4ycyBsaW5lYXIgaW5maW5pdGU7CWFuaW1hdGlvbjogc2hvdy1zcGlubmVyIDAuMnMsIHNwaW4gMXMgMC4ycyBsaW5lYXIgaW5maW5pdGU7CWJveC1zaXppbmc6IGJvcmRlci1ib3g7IAljb250ZW50OiAiIjsJb3BhY2l0eTogLjg7fUAtd2Via2l0LWtleWZyYW1lcyBzcGluIHsJMCUgeyAtd2Via2l0LXRyYW5zZm9ybTogcm90YXRlKDBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgwZGVnKTsgfQkxMDAlIHsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB9fUBrZXlmcmFtZXMgc3BpbiB7CTAlIHsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgwZGVnKTsgdHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7IH0JMTAwJSB7IC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfX1ALXdlYmtpdC1rZXlmcmFtZXMgc2hvdy1zcGlubmVyIHsJZnJvbSB7IC13ZWJraXQtdHJhbnNmb3JtOiBzY2FsZSgwKTsgdHJhbnNmb3JtOiBzY2FsZSgwKTt9CXRvIHsgLXdlYmtpdC10cmFuc2Zvcm06IHNjYWxlKDEpOyB0cmFuc2Zvcm06IHNjYWxlKDEpO319QGtleWZyYW1lcyBzaG93LXNwaW5uZXIgewlmcm9tIHt0cmFuc2Zvcm06IHNjYWxlKDApO30JdG8ge3RyYW5zZm9ybTogc2NhbGUoMSk7fX0='); 190document.head.appendChild(modalStyle); 191 192AvvioWS.deployModalFunctions = function() 193{ 194 const lodiv = document.createElement('div'); 195 lodiv.id = 'avvio-lodiv'; 196 lodiv.style.position = 'fixed'; 197 lodiv.style.left = 0; 198 lodiv.style.top = 0; 199 lodiv.style.height = '100dvh'; 200 lodiv.style.width = '100dvw'; 201 lodiv.style.zindex = '50000'; 202 lodiv.style.display = 'none'; 203 document.body.appendChild(lodiv); 204 AvvioWS.postToWidget = function(message) 205 { 206 var af = document.getElementById('avvio-frame'); 207 if(af !== null) 208 af.contentWindow.postMessage(message,'*'); 209 } 210 AvvioWS.closeModal = function () 211 { 212 // updating continue feed url without page reload. 213 AvvioWS.postToWidget({type:"updateContinueFeedLink"}); 214 215 document.getElementById('avvio-lodiv').classList.remove('avvio-loader'); 216 const element = document.getElementById('avvio-modal-frame'); 217 setTimeout(function(){ 218 if(element) 219 element.remove(); 220 document.getElementById('avvio-lodiv').style.display='none'; 221 //document.getElementById('avvio-frame').style.opacity = 1; 222 document.body.style.overflowY = AvvioWS.avvioReBodyOverflow; 223 //document.body.style.position = AvvioWS.avvioReBodyPosition; 224 document.body.style.width = AvvioWS.avvioReBodyWidth; 225 }, 200); 226 227 let modalWrapper = document.getElementById("avvioFakeModalWrapper"); 228 if(modalWrapper) 229 modalWrapper.style.display = "none"; 230 } 231 AvvioWS.openModal = function openModal(url, transparent, noLoader) 232 { 233 if( ! url) 234 return; 235 236 let lodiv = document.getElementById('avvio-lodiv'); 237 lodiv.style.display = 'flex'; 238 239 var mframe = document.createElement('iframe'); 240 mframe.id = 'avvio-modal-frame'; 241 mframe.setAttribute('frameborder',0); 242 mframe.setAttribute('allow','web-share'); 243 mframe.src = url; 244 mframe.style.height = '100dvh'; 245 mframe.style.width = '100dvw'; 246 247 if(transparent) 248 { 249 mframe.setAttribute("allowTransparency", true); 250 mframe.setAttribute("background", "transparent"); 251 mframe.visibility = "hidden"; 252 } 253 254 lodiv.appendChild(mframe); 255 256 AvvioWS.avvioReBodyOverflow = document.body.style.overflowY; 257 AvvioWS.avvioReBodyWidth = document.body.style.width; 258 259 document.body.style.overflowY = 'hidden'; 260 document.body.style.width = '100%'; 261 262 setTimeout(function () { 263 if ( ! noLoader) 264 lodiv.classList.add('avvio-loader'); 265 mframe.addEventListener('load', function () { 266 lodiv.classList.remove('avvio-loader'); 267 mframe.visibility = "visible"; 268 }, { 'once': true }); 269 }, 150); 270 }; 271 AvvioWS.openBookingEngine = function openBookingEngine(url) 272 { 273 let wrapper = document.getElementById("avvioFakeModalWrapper"); 274 const alignment = "avvio-modal-center"; 275 276 if( ! wrapper) 277 { 278 let fontAwesome = document.querySelector("#fa-v5-font-face"); 279 //console.log(fontAwesome); 280 281 wrapper = document.createElement("div"); 282 wrapper.id = "avvioFakeModalWrapper"; 283 wrapper.style.display = "none"; 284 285 let shadowRoot = wrapper.attachShadow({ mode: "open" }); 286 287 let frame = document.getElementById("avvio-lodiv"); 288 let frameZIndex = getComputedStyle(frame).zIndex; 289 290 const shadowHTML = document.createElement("html"); 291 shadowRoot.appendChild(shadowHTML); 292 293 const shadowHead = document.createElement("head"); 294 shadowHTML.appendChild(shadowHead); 295 296 let staticPath = "https://ar.avvio.com/crm/templates/ConsumerSide/StaticContent/mainbe/"; 297 298 // Firefox wants the weird double quote 299 let font = new FontFace("'Font Awesome 7 Pro'", "url(" + staticPath + "css/fontawesome7.2.0/webfonts/fa-regular-400.woff2) format('woff2')"); 300 document.fonts.add(font); 301 302 // Chrome doesn't like it 303 let font2 = new FontFace("Font Awesome 7 Pro", "url(" + staticPath + "css/fontawesome7.2.0/webfonts/fa-regular-400.woff2) format('woff2')"); 304 document.fonts.add(font2); 305 306 let cssFiles = [ 307 staticPath + "css/fontawesome7.2.0/css/all.min.css", 308 staticPath + "css/designsystem.css", 309 ]; 310 311 for(let file of cssFiles) 312 { 313 let shadowStyle = document.createElement("link"); 314 shadowStyle.setAttribute("rel", "stylesheet"); 315 shadowStyle.setAttribute("type", "text/css"); 316 shadowStyle.setAttribute("href", file) 317 shadowHead.appendChild(shadowStyle); 318 } 319 320 const shadowBody = document.createElement("body"); 321 shadowHTML.appendChild(shadowBody); 322 323 let modalbg = document.createElement("div"); 324 modalbg.setAttribute("id", "avvioFakeModal__background"); 325 modalbg.setAttribute("class", "avvio-modal__background"); 326 modalbg.style.zIndex = frameZIndex - 1; 327 328 let modal = document.createElement("div"); 329 modal.setAttribute("id", "avvioFakeModal"); 330 modal.setAttribute("class", "avvio-modal avvio-modal-center"); 331 shadowBody.appendChild(modalbg); 332 333 let header = document.createElement("div"); 334 header.setAttribute("class", "avvio-modal__header noheader"); 335 modal.appendChild(header); 336 337 let button = document.createElement("button"); 338 button.setAttribute("id", "avvioFakeModal__closeBtn"); 339 button.setAttribute("type", "button"); 340 button.setAttribute("class", "button-icon button-icon--plain closeModal closelink"); 341 header.appendChild(button); 342 343 let buttonIcon = document.createElement("i"); 344 buttonIcon.setAttribute("class", "button-icon__icon far fa-fw fa-times"); 345 buttonIcon.addEventListener("click", AvvioWS.closeModal); 346 button.appendChild(buttonIcon); 347 348 let content = document.createElement("div"); 349 content.setAttribute("class", "avvio-modal__content"); 350 modal.appendChild(content); 351 352 let mainScroll = document.createElement("div"); 353 mainScroll.setAttribute("class", "avvio-modal__main avvio-modal__main-scroll"); 354 content.appendChild(mainScroll); 355 356 let loader = document.createElement("div"); 357 loader.setAttribute("id", "loader"); 358 mainScroll.appendChild(loader); 359 360 let body = document.getElementsByTagName("body")[0]; 361 modalbg.appendChild(modal); 362 body.appendChild(wrapper); 363 364 window.addEventListener("message", function (event) { 365 if( ! event.data) 366 return; 367 368 if(event.data.type !== "resizeFake") 369 return; 370 371 modal.style.top = event.data.top + "px"; 372 modal.style.left = event.data.left + "px"; 373 modal.style.width = event.data.width + "px"; 374 modal.style.height = event.data.height + "px"; 375 //console.log(event.data); 376 // 377 modal.setAttribute("dir", event.data.rtl ? "rtl" : false); 378 }); 379 } 380 381 let modal = wrapper.shadowRoot.getElementById("avvioFakeModal"); 382 modal.style.top = ""; 383 modal.style.left = ""; 384 385 switch (alignment) { 386 case 'avvio-modal-left': 387 case 'avvio-modal-right': 388 modal.style.height = "100dvh"; 389 break; 390 391 default: 392 case 'avvio-modal-center': 393 modal.style.height = "735.2px"; 394 break; 395 } 396 397 AvvioWS.openModal(url, true); 398 }; 399 window.addEventListener('message', e => { 400 const key = e.message ? 'message' : 'data'; 401 const data = e[key]; 402 403 if(data.avvio && 'https://secure.radcork.com/crm/site/Radisson%20Cork/'.indexOf(e.origin + '/') != 0) 404 {
405 console.log('Origin does not match location'); 406 // TODO KK this needs to be tested 407 // return; 408 } 409 410 if(data.type == 'openModal') { 411 AvvioWS.openModal(data.url); 412 } 413 else if(data.type == 'openBookingEngine') { 414 AvvioWS.openBookingEngine(data.url); 415 } 416 else if(data.type == 'closeModal') { 417 AvvioWS.closeModal(); 418 } 419 },false); 420 421 window.addEventListener('keydown', function(evt) { 422 evt = evt || window.event; 423 var isEscape = false; 424 if('key' in evt) 425 isEscape = (evt.key === 'Escape' || evt.key === 'Esc'); 426 else 427 isEscape = (evt.keyCode === 27); 428 429 if(isEscape) 430 AvvioWS.closeModal(); 431 }); 432}; /* semicolon not optional *//* 433=================================================== 434CRM Tracking 435*/ 436 437AvvioWS.deployCRM = function() 438{ 439 var fullLocation = '//secure.radcork.com/crm/rpc/Radisson%20Cork/image?el=nscs1YvxuWqzsR8098h854hg2R1lvaOkl3HY4OOGNeA' + this.cachebuster + this.ref + this.loc; 440 if( ! window.avvio_crm_firstexecution) { 441 window.avvio_crm_firstexecution = true; 442 fullLocation += '&firstexecution=1'; 443 } 444 445 const crmImage = document.createElement('img'); 446 crmImage.src = fullLocation; 447 crmImage.width = 1; 448 crmImage.height = 1; 449 document.querySelector('body').appendChild(crmImage); 450}; 451AvvioWS.deployRequired=function() 452{ 453 if ( this.debug ) console.log("WSS:deployRequired" ); 454} 455 456AvvioWS.deployFunctional=function() 457{ 458 if ( this.debug ) console.log("WSS:deployFunctional" ); 459 460 if ( AvvioWS.hasOwnProperty('deployAI') ) AvvioWS.deployAI(); 461 if ( AvvioWS.hasOwnProperty('deployRE') ) AvvioWS.deployRE(); 462 //AvvioWS.deployModalFunctions(); 463} 464 465AvvioWS.deployStatistical=function() 466{ 467 if ( this.debug ) console.log("WSS:deployStatistical" ); 468 469 if ( AvvioWS.hasOwnProperty('deployCRM') ) AvvioWS.deployCRM(); 470} 471 472AvvioWS.deployMarketing=function() 473{ 474 if ( this.debug ) console.log("WSS:deployMarketing" ); 475} 476AvvioWS.deployModalFunctions(); 477 478/* 479=================================================== 480ACC 481*/ 482 483 484if ( typeof AvvioCC == 'undefined' ) 485{ 486 // if the parent did not define AvvioCC yet, then we just create one here 487 // and make sure ACC kicks off init straight away 488 var AvvioCC = {}; 489 490 // IMPORTANT: 491 // AvvioCC values (if any) need to be defined by parent page before WSS is loaded/executed! 492 AvvioCC.variablesAfterScript=false; 493} 494 495// IMPORTANT: 496// if ACC is loaded through WSS, then any avvio related scripts are controlled by the WSS 497// the parent page should not deploy avvio::crm or avvio:ai scripts 498// gtm should not deploy avvio:crm or avvio:ai scripts 499AvvioCC.userDeploysAvvio=true; 500 501AvvioWS.deployACC = function() 502{ 503 /* global code */ 504 var path="https://secure.radcork.com/crm/rpc/Radisson%20Cork/ACC_js.php"; 505 506 if ( this.lang != false ) 507 path+='lang='+this.lang; 508 509 const script = document.createElement('script'); 510 script.src = "https://secure.radcork.com/crm/rpc/Radisson%20Cork/ACC_js.php"; 511 document.querySelector('head').appendChild(script); 512} 513 514AvvioWS.deployACC();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.