PageSourceSearch

https://firstonline.thefirstgroup.com/Themes/TFG/js/main.js

js thefirstgroup.com collected 2026-10-02 08:44:33 UTC 32,691 bytes, 943 lines download raw bytes

1$(document).ready(function () {
2
3    var winWidth = $(window).width();
4    var winHeight = $(window).height();
5    // alert( 'Width ='+winWidth + ' & ' + 'Height =' + winHeight );
6
7
8    // RTL check --------------------------
9
10    var dirRtl = false;
11
12    if ($('body').hasClass('rtl')) {
13        dirRtl = true;
14    }
15
16    // Custom scrollbar style --------------------------
17
18    if ($('.scrollbar-inner').length) {
19        $('.scrollbar-inner').scrollbar({
20            isRtl: ($('body').hasClass('rtl')) ? true : false
21        });
22    }
23
24    //  Initialize masonry - Testimonials page --------------------------
25
26    //if( $('.grid').length ) {
27
28    //    $('.grid').isotope({
29    //        itemSelector: '.grid-item',
30    //        percentPosition: true,
31    //        masonry: {
32    //            columnWidth: '.grid-sizer',
33    //            gutter: '.gutter-sizer'
34    //        } 
35    //    });
36    //}
37
38
39    //  Initialize date picker --------------------------
40
41    if ($('.date-picker').length) {
42
43        jQuery('.date-picker').datetimepicker({
44            timepicker: false,
45            format: 'd/m/Y',
46            minDate: 0
47        });
48    }
49
50    // Menu "Hamburger" Icon action --------------------------
51
52    $('.menu-icon').click(function () {
53
54        $('html, body').toggleClass('overflow-hidden');
55        $(this).find('.nav-icon').toggleClass('open');
56        $('#main-header, .main-menu').toggleClass('menu-opened');
57
58    });
59
60    // Agents listing --------------------------
61
62    if ($(".agents-wrapper").length) {
63
64        // Read more / less toggle 
65        $('.read-more-toggle').click(function (e) {
66            e.preventDefault();
67
68            if (!$(this).hasClass('active')) {
69                $('.hidden-text').show();
70                $('.active-text').hide();
71            } else {
72                $('.hidden-text').hide();
73                $('.active-text').show();
74            }
75
76            $(this).toggleClass('active');
77            $(this).parent('.agent-content').find('.agent-description').toggleClass('active');
78        });
79
80        $(".agents-wrapper .row").slick({
81            centerMode: true,
82            rtl: ($('body').hasClass('rtl')) ? true : false,
83            centerPadding: '0px',
84            slidesToShow: 3,
85            responsive: [{
86                breakpoint: 700,
87                settings: {
88                    arrows: false,
89                    centerMode: true,
90                    centerPadding: '70px',
91                    slidesToShow: 1
92                }
93            }, {
94                breakpoint: 400,
95                settings: {
96                    arrows: false,
97                    centerMode: true,
98                    centerPadding: '40px',
99                    slidesToShow: 1
100                }
101            }
102            ]
103        });
104    }
105
106    // Services - Payment Options flip action --------------------------
107
108    $('.flip-open').click(function (e) {
109        e.preventDefault();
110        $(this).parents('.flip-container').addClass('flip-active');
111    });
112
113    $('.flip-close').click(function (e) {
114        $(this).parents('.flip-container').removeClass('flip-active');
115    });
116
117    // Construction Updates Gallery Slider --------------------------
118
119    if ($('.gallery-preview').length) {
120
121        $('.gallery-preview').slick({
122            slidesToShow: 1,
123            slidesToScroll: 1,
124            arrows: false,
125            fade: true,
126            asNavFor: '.gallery-nav',
127            responsive: [{
128                breakpoint: 991,
129                settings: {
130                    arrows: true,
131                    appendArrows: '.gallery-preview',
132                    prevArrow: '<div class="slick-prev slick-arrow"></div>',
133                    nextArrow: '<div class="slick-next slick-arrow"></div>'
134                }
135            }
136            ]
137        });
138
139        $('.gallery-nav').slick({
140            slidesToShow: 4,
141            slidesToScroll: 1,
142            asNavFor: '.gallery-preview',
143            focusOnSelect: true,
144            vertical: true,
145            verticalSwiping: true,
146            prevArrow: '<div class="slick-prev slick-arrow"></div>',
147            nextArrow: '<div class="slick-next slick-arrow"></div>',
148            responsive: [{
149                breakpoint: 1449,
150                settings: {
151                    slidesToShow: 3
152                }
153            }
154            ]
155        });
156
157        $(window).resize(function () {
158            clearTimeout(galArrows);
159            var galArrows = setTimeout(adjust_gallery_arrows_pos, 200);
160        });
161
162        adjust_gallery_arrows_pos();
163
164        function adjust_gallery_arrows_pos() {
165            var imgHeight = $('.gallery-preview').find('.figure-wrap').height();
166            $('.gallery-preview').find('.slick-arrow').css('top', imgHeight + 35);
167        }
168    }
169
170
171    // Properties Carousal Slider --------------------------
172
173    if ($(".properties-slider").length) {
174
175        $(".properties-slider").slick({
176            appendArrows: '.properties-module .slider-arrows',
177            prevArrow: '<div class="slick-prev slick-arrow"></div>',
178            nextArrow: '<div class="slick-next slick-arrow"></div>',
179            rtl: ($('body').hasClass('rtl')) ? true : false,
180            slidesToShow: 3,
181			//variableWidth: true,
182			//centerMode: true,
183            responsive: [{
184                breakpoint: 1026,
185                settings: {
186                    slidesToShow: 3
187                }
188            }, {
189                breakpoint: 767,
190                settings: {
191                    slidesToShow: 2
192                }
193            }, {
194                breakpoint: 480,
195                settings: {
196                    slidesToShow: 1
197                }
198            }
199            ]
200        });
201    }
202
203    // Titanium Rewards Tab - Service page --------------------------
204
205    // $('.tab-content-point:not(.current)').hide();
206
207    $('.titanium-tabs-wrapper .tablist li').click(function () {
208
209        var tab_id = $(this).attr('data-tab');
210        var offset = $(this).offset();
211        var offsetTop = offset.top - 50;
212
213        $('html, body ').animate({ scrollTop: offsetTop }, 500);
214
215        $('.tablist li').removeClass('current');
216        $('.tab-content-point').removeClass('current');
217
218        $(this).addClass('current');
219        $("#tab-" + tab_id).addClass('current');
220
221    });
222
223    //Titanium Rewards Main Accordian - Service page --------------------------
224    $('.titanium-tabs-wrapper .tab-content-point .accord-title').click(function () {
225
226        $('.titanium-tabs-wrapper .tab-content-point .accord-content').slideUp();
227        $('.titanium-tabs-wrapper .tab-content-point .accord-title').removeClass('open');
228        $('.titanium-tabs-wrapper .tab-content-point').removeClass('current');
229
230
231        if ($(this).next().is(":visible")) {
232            $(this).removeClass('open');
233            $(this).next().slideUp();
234
235        } else {
236            $(this).addClass('close');
237            $(this).next().slideDown(function () {
238                // Animation complete.
239                var top = $("#" + $(this).parent()[0].id).offset().top;
240                $('html, body').stop().animate({
241                    scrollTop: $("#" + $(this).parent()[0].id).offset().top
242                }, 500);
243            });
244
245        }
246    });
247
248    $(window).resize(function () {
249        var winWidth = $(window).width();
250
251        if (winWidth > 767) {
252            $('.tab-content-point.current .accord-content').show();
253
254        } else {
255            $('.titanium-tabs-wrapper .tab-content-point').removeClass('current');
256
257        }
258    });
259    $(window).load(function () {
260        var winWidth = $(window).width();
261
262        if (winWidth < 767) {
263            $('.titanium-tabs-wrapper .tab-content-point').removeClass('current');
264
265        }
266    });
267	
268	
269	if (window.location.pathname === "/") {
270		if (!getCookie("cielPopupShown")) {
271			setTimeout(function() {
272				$.fancybox.open({
273					href: '#ciel-popup',
274					type: 'inline',
275					openEffect: 'fade',
276					closeEffect: 'fade',
277					padding: 0,
278					width:800,
279					helpers: {
280						overlay: { closeClick: false }
281					}
282				});
283				setCookie("cielPopupShown", "yes", 30);
284			}, 3000);
285		}
286	}
287	
288
289    // Video model box initialization - Home page --------------------------
290
291    $("a.fancybox-video").click(function (e) {
292
293        $.fancybox({
294            'padding': 0,
295            'autoScale': false,
296            'wrapCSS': 'fancy-video-wrap',
297            'type': 'iframe',
298            'openEffect': "fade",
299            'closeEffect': "fade",
300            'width': 853,
301            'height': 480,
302            'href': this.href,
303            beforeShow: function () {
304                $("body").css({ 'overflow-y': 'hidden' });
305            },
306            afterClose: function () {
307                $("body").css({ 'overflow-y': 'visible' });
308            },
309            'helpers': {
310                overlay: {
311                    media: true,
312                    locked: false
313                }
314            }
315        });
316
317        return false;
318
319    });
320
321    //Breadcrumb --------------------------
322
323    var swipeBreadcrumb = function () {
324
325        var winWidth = $(window).width();
326
327        if (winWidth <= 500) {
328
329            var scrollPos = $('.tfg-breadcrumb ul').width();
330
331            if (scrollPos > 300) {
332
333                $('.tfg-breadcrumb').css("overflow-x", "auto");
334                $('.tfg-breadcrumb ul').css("margin-right", "40%");
335                $('.tfg-breadcrumb ul').css("margin-left", "15px");
336                $('.tfg-breadcrumb ul').css('width', scrollPos)
337                $('.tfg-breadcrumb').scrollLeft(scrollPos);
338            } else {
339
340                $('.tfg-breadcrumb').css('text-align', 'center');
341                $('.tfg-breadcrumb').css("overflow-x", "hidden");
342            }
343
344        } else {
345            $('.tfg-breadcrumb ul').css("margin-left", "");
346            $('.tfg-breadcrumb ul').css("margin-right", "");
347            $('.tfg-breadcrumb ul').css('width', "");
348            $('.tfg-breadcrumb').css("overflow-x", "hidden");
349        }
350    }
351
352    swipeBreadcrumb();
353
354    $(window).resize(function () {
355        swipeBreadcrumb();
356    });
357
358
359
360    // Construction status panel - Property landing page -----------------------------
361
362    $('.status-open-btn').click(function (e) {
363
364        e.preventDefault();
365
366        var offset = $(this).offset();
367        var winWidth = $(window).width();
368        var headerHeight = $('#main-header').outerHeight();
369
370        if (winWidth <= 480) {
371
372            $('#main-header').addClass('panel-opened');
373            $('.status-panel').css('top', headerHeight);
374            $('body, html').animate({ scrollTop: 0 });
375            panel_action();
376
377        } else {
378            panel_action(offset.top);
379        }
380
381        function panel_action(vOffset) {
382
383            $('body, html').animate({ scrollTop: vOffset + 'px' }, 500, function () {
384                $('body').addClass('overflow-hidden');
385                $('.status-panel').fadeIn(500);
386
387                if (dirRtl === true) {
388                    $('.status-content').fadeIn().animate({ marginLeft: 0 }, 500);
389                } else {
390                    $('.status-content').fadeIn().animate({ marginRight: 0 }, 500);
391                }
392
393            });
394        }
395
396    });
397
398    $(window).resize(function () {
399        var winWidth = $(window).width();
400
401        if (winWidth >= 480) {
402            $('.status-panel').animate({ 'top': 0 });
403        } else {
404            var headerHeight = $('#main-header').outerHeight();
405            $('.status-panel').animate({ 'top': headerHeight });
406        }
407    });
408
409    $('.status-close-btn').click(function () {
410
411        $('body').removeClass('overflow-hidden');
412        var panelWidth = $('.status-content').width();
413
414        if (dirRtl === true) {
415            $('.status-content').animate({ marginLeft: -panelWidth }, 500).fadeOut();
416        } else {
417            $('.status-content').animate({ marginRight: -panelWidth }, 500).fadeOut();
418        }
419        $('.status-panel').fadeOut(500);
420        $('#main-header').removeClass('panel-opened');
421
422    });
423
424
425    // My profile page --------------------------
426
427    $('.edit-btn').click(function (e) {
428
429        e.preventDefault();
430        $(this).hide();
431        var parent = $(this).parents('.user-info-box');
432        parent.find('.user-info-wrap').stop().slideUp();
433        parent.find('.edit-info-wrap').stop().slideDown().addClass('edit-active');
434    });
435
436    $('.cancel-edit').click(function (e) {
437
438        e.preventDefault();
439        $('.edit-btn').show();
440        var parent = $(this).parents('.user-info-box');
441        parent.find('.user-info-wrap').stop().slideDown();
442        parent.find('.edit-info-wrap').stop().slideUp().removeClass('edit-active');
443    });
444
445
446    // Service page top tab navigation mobile view -----------------------
447
448    $(window).load(function () {
449        set_active_tab();
450    });
451
452    $(window).resize(function () {
453        clearTimeout(setTimeout);
454        var resizeTimeOut = setTimeout(_removeTabStyle, 500);
455    });
456
457    function set_active_tab() {
458
459        if ($('.top-tab-nav').length) {
460            var active_page = $('.top-tab-nav').find('.tab-active').text();
461            $('.tab-active-page').text(active_page);
462        }
463    }
464
465    $('.tab-toggle').click(function () {
466
467        $(this).toggleClass('tab-dropped');
468        $(this).next('.top-tab-nav').slideToggle(500, 'easeInOutCirc');
469    });
470
471    function _removeTabStyle() {
472
473        var winWidth = $(window).width();
474        if (winWidth >= 768) {
475            $('.tab-toggle').removeClass('tab-dropped');
476            $('.top-tab-nav').removeAttr('style');
477        }
478    }
479
480    // -------------------------------------------------------------------------------------------------------------------------------
481
482    // Un-used code from here ==========================
483
484    // equal_columns_height( '.properties .row',  '.col-xs-6 .properties-info-wrap' );
485    // $('.gallery').load('http://staging.thefirstgroup.com/en/developments/tecom/grand-central/ #galleryconstruction');
486    // $('.gallery').load('http://2.bp.blogspot.com/-FkOVglPDfvA/UNXVBDt1j5I/AAAAAAAABdg/dgfPIXBAkCg/s1600/iframe.png'); 
487
488
489
490    function equal_columns_height(container, child) {
491
492        $(window).resize(function () {
493
494            $(child, this).css('height', 'auto');
495            get_height(container, child);
496
497            console.log(container, child);
498
499
500        });
501
502        function get_height(container, child) {
503            $(container).each(function () {
504                var highestBox = 0;
505
506                $(child, this).each(function () {
507                    if ($(this).height() > highestBox) {
508                        highestBox = $(this).height();
509                    }
510                });
511
512                $(child, this).height(highestBox);
513
514            });
515        }
516    }
517    // -------------------------------------------------------------------------------------------------------------------------------
518
519
520    // Gallery popup initialization - Properties Landing page --------------------------
521    $("a.gallery-popup").click(function (e) {
522
523        $(".fancybox").fancybox({
524            helpers: {
525                title: {
526                    type: 'outside'
527                },
528                overlay: {
529                    speedOut: 0,
530                    media: true,
531                    locked: false
532                }
533            }
534        });
535    });
536
537
538    // home-page view-details function
539
540    $('.view-more').click(function (e) {
541        e.preventDefault();
542        $(this).hide();
543        var parent = $(this).parents('.view-details-more');
544        parent.find('.details-wrap').slideDown('slow', 'linear');
545    });
546
547    $('.less-view').click(function (e) {
548        e.preventDefault();
549        $('.view-more').show();
550        var parent = $(this).parents('.view-details-more');
551        parent.find('.details-wrap').slideUp('fast');
552    });
553
554
555    //***********
556    //********** Email Verification
557    //**********
558
559    
560    // Disable copy paste
561    $('.reset-password-email #Password,.reset-password-email #repeatPassword').bind("cut copy paste", function (e) {
562        e.preventDefault();
563    });
564    
565    $('#reset-button').click(function (e) {
566        e.preventDefault();
567        var flag = true;
568        $('.required').css('display', 'none');
569        if ($('#Password').val() === '') {
570            $('.emailverification-password').css('display', 'block');
571            flag = false;
572        }
573        if ($('#repeatPassword').val() === '') {
574            $('.emailverification-repeat-password').css('display', 'block');
575            flag = false;
576        }
577
578        if (!flag) {
579            return false;
580        }
581
582        if ($('#Password').val() !== $('#repeatPassword').val()) {
583            $('.change-password-match').css('display', 'block');
584            return false;
585        }
586        //if (checkStrength($('#Password').val()) !== 'Strong') {
587        //    $('.change-password-complexity').css('display', 'block');
588        //    return false;
589        //}
590        var postData = {
591            Password: $('#Password').val(),
592            ConfirmPassword: $('#repeatPassword').val(),
593            EncryptedCode: $('#EncryptedCode').val()
594        };
595
596        $.ajax({
597            type: "POST",
598            url: "../customer/ResetPassword",
599            data: postData,
600            complete: function (data) {
601                debugger
602                var parsedData = JSON.parse(data.responseText);
603                if (parsedData.Status === 'Success') {
604                    $('.success-msg').text(parsedData.Message);
605                    $('.success-msg').css('display', 'block');
606                    $('#Password').val('');
607                    $('#repeatPassword').val('');
608                    setTimeout(function() {
609                        $('.success-msg').text(''); $('.success-msg').css('display', 'none');
610                        window.location = "/";
611                    }, 2000);
612                }
613                else {
614                    $('.error-msg').text(parsedData.Message);
615                    $('.error-msg').css('display', 'block');
616                    setTimeout(function () { $('.error-msg').text(''); $('.error-msg').css('display', 'none'); }, 1500);
617                }
618            },
619            error: function (xhr, ajaxOptions, thrownError) {
620            },
621            traditional: true
622        });
623    });
624
625
626    $('#product').change(
627        function () {
628            var selected = $('option:selected', this);
629            var optGroup = selected.parent()[0].label;
630            var selectedProductValue = selected.val();
631            $('#category_mdd').val(optGroup);
632            $('#product_mdd').val(selectedProductValue);
633        }
634    );
635	
636	if($('.rewards-container').length>0){
637		var propertyNumberInCMS=window.location.pathname.split('/')[window.location.pathname.split('/').length-1];
638		$.getJSON("https://svc.thefirstgroup.com/api/GetOwnerReturnsDetail
638s?propertyid=" +propertyNumberInCMS, function( data ) {
639			var _data=data;
640			if(data){
641				$('body').attr('data-unitId',_data.UnitSaleId);
642				checkForRewards();
643			}
644		});
645	}
646checkForHomePageRewards();
647	//REWARDS
648	function checkForHomePageRewards(){
649		if($('.rewards-home-page').length>0){
650			var cct=$('.main-menu').attr('data-cct');
651			if(cct){
652				var rewards;
653				var rewardsConfig;
654				
655				$.getJSON("https://svc.thefirstgroup.com/api/GetClientIncentives?clientid=" + cct)
656					.done(function(data){
657						rewards=data;	
658						if(rewards.length==0){						
659							$('.rewards-home-page').remove();						
660						}else{
661							$(rewards).each(function(rewardIndex,rewardItem){
662								//var unitSaleId=$('body').attr('data-unitId');
663								var matchingRewards=[];
664								var j=0;								
665								if(rewardItem.Incentives && rewardItem.Incentives.length>0){
666									$(rewardItem.Incentives).each(function(rewardItemIndex,reward_item){
667										var rewardURL="";
668										var new_item={
669											IncentiveId:reward_item.IncentiveId,
670											Name:reward_item.Name,
671											Redeemed:reward_item.Redeemed,
672											RedemptionRequested:reward_item.RedemptionRequested,
673											CertificateId:reward_item.CertificateId,
674											CreatedOn:reward_item.CreatedOn,
675											RedeemedOn:reward_item.RedeemedOn,
676											EligibleFrom:reward_item.EligibleFrom,
677											EligibilityExpiry:reward_item.EligibilityExpiry,	
678											RedemptionRequestedOn:reward_item.RedemptionRequested,
679											UnitSaleId:reward_item.UnitSaleId,
680											ClientId:reward_item.ClientId,														
681											Expired:Date.parse(reward_item.EligibilityExpiry)<new Date() && Date.parse(reward_item.EligibilityExpiry)>new Date(2000,1,1),														
682											AvailableText:'Redeem',										
683											RedeemedText:'Redeemed',
684											RedirectURL:rewardURL,
685											RequestType:reward_item.RequestType,
686											CCT_ID:cct,
687											PropertyName:reward_item.PropertyName,
688											UnitNr:reward_item.UnitNumber
689										};
690										if(!new_item.Expired){
691											matchingRewards.push(new_item);
692										}
693									});												
694								}
695								//if(matchingRewards.length==0){								
696								//	$('.rewards-home-page').remove();
697								//}else{
698								if(matchingRewards.length>0){
699									var row=$("<div class='row justify-content-center'></div>");
700									$('.rewards-home-page .container').append($(row));
701									$(row).append("<h3 class='mt-5 mb-4 w-100'>" + rewardItem.PropertyName + " (Unit: " + rewardItem.UnitNumber + ")</h3>");
702									var container=$(row);//$('.rewards-home-page .container .row');
703									$(matchingRewards).each(function(index,item){		
704										var outerItem=$('<div class="col-md-4"></div>');
705										var innerItem=$('<div class="reward-box mb-4"></div>');
706										$(outerItem).append($(innerItem));
707										var title=$('<div class="reward-title">' + item.Name + '</div>');
708										$(innerItem).append($(title));									
709										var actionLink=$('<button class="btn btn-dark redeem-btn text-uppercase redeem-inc"></button>');
710										if(item.Redeemed){										
711											$(actionLink).attr('disabled','disabled');
712											$(actionLink).text(item.RedeemedText);										
713										} else if(item.Expired){
714											$(actionLink).attr('disabled','disabled');
715											$(actionLink).text('Expired');										
716										} else if(item.RedemptionRequested){
717											$(actionLink).attr('disabled','disabled');
718											$(actionLink).text('Redemption Requested');
719										}
720										else{
721											var url='';
722											if(item.Name.toLowerCase().includes("emirates")){
723												url="https://invest.thefirstgroup.com/rewards-activation/?custom1=" + item.ClientId + "&emirates=true";
724											}else if(item.Name.toLowerCase().includes("dlm")){
725												url="https://www.dubailifestylemembership.com/redeem-dlm/?certificate=" + item.CertificateId;
726											}else if(item.Name.toLowerCase().includes("innercircle")){
727												url="https://innercircle.ae/enrollment.aspx?id=" + item.ClientId;
728											}										
729											if(url!=""){
730												actionLink=$('<a class="btn btn-dark redeem-btn text-uppercase redeem-inc" target="_blank"></a>');
731												$(actionLink).attr('href',url);
732												$(actionLink).text(item.AvailableText + " ↗");
733												$(actionLink).click(function(e){
734													window.dataLayer.push({ 'event': 'Reward Redemption', 'userId': item.CCT_ID, 'incentiveName':item.Name, 'formLocation': 'home page','propertyName':rewardItem.PropertyName,'unitNo':rewardItem.UnitNumber });
735												});
736											}else{
737												$(actionLink).click(function(e){
738													e.preventDefault();
739													$(actionLink).attr("disabled","disabled");
740													var postUrl="https://invest.thefirstgroup.com/fo-incentives/process.php"
741													var postData = 'inc_id='+item.IncentiveId + "&req_type=" + item.RequestType;
742													$.ajax({
743														url: postUrl,
744														type: 'POST',
745														data: postData,
746														success: function(response) {
747															alert("Thank you. Your request for redeeming " + item.Name + " has been received. We will get in touch with you shortly.");
748															$(actionLink).text("Redemption requested").attr('disabled',true);
749															window.dataLayer.push({ 'event': 'Reward Redemption', 'userId': item.CCT_ID, 'incentiveName':item.Name, 'formLocation': 'home page','propertyName':rewardItem.PropertyName,'unitNo':rewardItem.UnitNumber  });
750														}
751													});
752												});
753												$(actionLink).text(item.AvailableText);
754											}										
755										}
756										$(innerItem).append($(actionLink));
757										$(container).append($(outerItem));
758									});
759								}
760															
761							});
762						}
763					})
764					.fail(function(response){
765						console.log("Error getting CCT rewards: " + response);
766					});
767			}
768		}
769	}
770	
771	
772	function checkForRewards(){
773		if($('.rewards-container').length>0){	
774			
775			var cct=$('.main-menu').attr('data-cct');
776			if(cct){
777				var rewards;
778				var rewardsConfig;
779				var matchingRewards=[];
780				$.getJSON("https://svc.thefirstgroup.com/api/GetClientIncentives?clientid=" + cct)
781					.done(function(data){
782						rewards=data;	
783						if(rewards.length==0){						
784							$('.rewards-container').hide();						
785						}else{
786							var rewardsAdded=0;
787							$(rewards).each(function(rewardIndex,rewardItem){
788								var unitSaleId=$('body').attr('data-unitId');
789								var j=0;
790								if(rewardItem.UnitSaleId==unitSaleId){
791									if(rewardItem.Incentives && rewardItem.Incentives.length>0){
792										$(rewardItem.Incentives).each(function(rewardItemIndex,reward_item){
793											var rewardURL="";
794											var new_item={
795												IncentiveId:reward_item.IncentiveId,
796												Name:reward_item.Name,
797												Redeemed:reward_item.Redeemed,
798												RedemptionRequested:reward_item.RedemptionRequested,
799												CertificateId:reward_item.CertificateId,
800												CreatedOn:reward_item.CreatedOn,
801												RedeemedOn:reward_item.RedeemedOn,
802												EligibleFrom:reward_item.EligibleFrom,
803												EligibilityExpiry:reward_item.EligibilityExpiry,	
804												RedemptionRequestedOn:reward_item.RedemptionRequested,
805												UnitSaleId:reward_item.UnitSaleId,
806												ClientId:reward_item.ClientId,														
807												Expired:Date.parse(reward_item.EligibilityExpiry)<new Date() && Date.parse(reward_item.EligibilityExpiry)>new Date(2000,1,1),														
808												AvailableText:'Redeem',										
809												RedeemedText:'Redeemed',
810												RedirectURL:rewardURL,
811												RequestType:reward_item.RequestType,
812												CCT_ID:cct
813											};
814											if(!new_item.Expired){
815												matchingRewards.push(new_item);
816											}
817										});												
818									}
819									if(matchingRewards.length==0){								
820										$('.rewards-container').hide();
821									}else{
822										var container=$('.rewards-container .rewards');
823										$(matchingRewards).each(function(index,item){	
824											var outerItem=$('<div class="col-md-4"></div>');										
825											var innerItem=$('<div class="reward-box mb-4"></div>');
826											$(outerItem).append($(innerItem));
827											var title=$('<div class="reward-title">' + item.Name + '</div>');
828											$(innerItem).append($(title));									
829											var actionLink=$('<button class="btn btn-dark redeem-btn text-uppercase redeem-inc"></button>');
830											if(item.Redeemed){										
831												$(actionLink).attr('disabled','disabled');
832												$(actionLink).text(item.RedeemedText);										
833											} else if(item.Expired){
834												$(actionLink).attr('disabled','disabled');
835												$(actionLink).text('Expired');										
836											} else if(item.RedemptionRequested){
837												$(actionLink).attr('disabled','disabled');
838												$(actionLink).text('Redemption Requested');
839											}
840											else{
841												var url='';
842												if(item.Name.toLowerCase().includes("emirates")){
843													url="https://invest.thefirstgroup.com/rewards-activation/?custom1=" + item.ClientId + "&emirates=true";
844												}else if(item.Name.toLowerCase().includes("dlm")){
845													url="https://www.dubailifestylemembership.com/redeem-dlm/?certificate=" + item.CertificateId;
846												}else if(item.Name.toLowerCase().includes("innercircle")){
847													url="https://innercircle.ae/enrollment.aspx?id=" + item.ClientId;
848												}										
849												if(url!=""){
850													actionLink=$('<a class="btn btn-dark redeem-btn text-uppercase redeem-inc" target="_blank"></a>');
851													$(actionLink).attr('href',url);
852													$(actionLink).text(item.AvailableText + " ↗");
853													$(actionLink).click(function(e){
854														window.dataLayer.push({ 'event': 'Reward Redemption', 'userId': item.CCT_ID, 'incentiveName':item.Name, 'formLocation': 'inner page','propertyName':rewardItem.PropertyName,'unitNo':rewardItem.UnitNumber });
855													});
856												}else{
857													$(actionLink).click(function(e){
858														e.preventDefault();
859														$(actionLink).attr("disabled","disabled");
860														var postUrl="https://invest.thefirstgroup.com/fo-incentives/process.php"
861														var postData = 'inc_id='+item.IncentiveId + "&req_type=" + item.RequestType;
862														$.ajax({
863															url: postUrl,
864															type: 'POST',
865															data: postData,
866															success: function(response) {
867																alert("Thank you. Your request for redeeming " + item.Name + " has been received. We will get in touch with you shortly.");
868																$(actionLink).text("Redemption requested").attr('disabled',true);
869																window.dataLayer.push({ 'event': 'Reward Redemption', 'userId': item.CCT_ID, 'incentiveName':item.Name, 'formLocation': 'inner page','propertyName':rewardItem.PropertyName,'unitNo':rewardItem.UnitNumber });
870															}
871														});
872													});
873													$(actionLink).text(item.AvailableText);
874												}										
875											}
876											$(innerItem).append($(actionLink));
877											$(container).append($(outerItem));
878											rewardsAdded++;
879										});
880									}
881								}								
882							});
883							if(rewardsAdded==0){
884								$('.rewards-container').hide();
885							}
886						}
887					})
888					.fail(function(response){
889						console.log("Error getting CCT rewards: " + response);
890					});
891			}else{
892				$('.rewards-container').hide();	
893			}
894		}
895	}
896	
897	function checkForSharm_El(){
898		if($('.header-banner h1').text().toLowerCase().includes("sharm el")){
899			$('#pulseDevelopment').show();
900		}else{
901			$('#pulseDevelopment').hide();
902		}
903
904	}
905	
906	checkForSharm_El();
907}); // Jquery Document End here
908
909
910$(window).load(function () {
911
912    if ($('.grid').length) {
913
914        $('.grid').isotope({
915            itemSelector: '.grid-item',
916
917            masonry: {
918                columnWidth: '.grid-sizer',
919                gutter: '.gutter-sizer'
920            }
921        });
922    }
923});
924
925function setCookie(name, value, days) {
926    var d = new Date();
927    d.setTime(d.getTime() + (days*24*60*60*1000));
928    var expires = "expires=" + d.toUTCString();
929    document.cookie = name + "=" + encodeURIComponent(value) + ";" + expires + ";path=/";
930}
931
932function getCookie(name) {
933    var cname = name + "=";
934    var decodedCookie = decodeURIComponent(document.cookie);
935    var ca = decodedCookie.split(";");
936    for (var i = 0; i < ca.length; i++) {
937        var c = ca[i].trim();
938        if (c.indexOf(cname) === 0) {
939            return c.substring(cname.length, c.length);
940        }
941    }
942    return "";
943}

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.