PageSourceSearch

https://concertinisrael.com/homepage/homepage.js?c=12

js concertinisrael.com collected 2026-09-26 03:11:21 UTC 66,704 bytes, 1,417 lines download raw bytes

1var QueryString = getQueryString();
2let signUp=false
3function getQueryString() {
4    for (var e = {}, n = window.location.search.substring(1), o = n.split("&"), t = 0; t < o.length; t++) {
5        var r = o[t].split("=");
6        if ("undefined" == typeof e[r[0]])
7            e[r[0]] = decodeURIComponent(r[1]);
8        else if ("string" == typeof e[r[0]]) {
9            var i = [e[r[0]], decodeURIComponent(r[1])];
10            e[r[0]] = i;
11        } else
12            e[r[0]].push(decodeURIComponent(r[1]));
13    }
14    return e;
15}
16function gapi_init() {
17    gapi.load('auth2', function(){
18        auth2 = gapi.auth2.init({
19            client_id: '925559398483-ac1e3r1qldjmofebfv1tmo6j26sua1o9.apps.googleusercontent.com'
20        });
21        var login_elem=$('.bt.hcc-quick-reg-gl').get(0);
22        auth2.attachClickHandler(login_elem, {},
23            function(googleUser) {
24                window.tick_g_login(googleUser.getAuthResponse().id_token);
25            });
26    });
27}
28
29$(document).ready(function () {
30    var catEnum = Object.freeze({"music":1, "food":2, "party":3,"artist":4,"lesson":5,"sport":6})
31    var path= window.location.href.split(/[/]+/);
32    var page=path.pop();
33    var pagepath=path.pop();
34    limit=48;
35    cat_id=0;
36    if(pagepath=='page'){
37        if($.isNumeric(page)&& page!=0){
38            limit= 48+(32*(page));
39        }
40        else{
41            if(catEnum[page]){
42                cat_id=catEnum[page];
43                $('.het-category a').removeClass('select');
44                $('.het-category a[data-cat="'+cat_id+'"]').addClass('select');
45            }
46        }
47    }
48
49        window.onclick = function (e) {
50            if (!($(e.target).hasClass('homepage-menu-small')) && !($(e.target).hasClass('homepage-menu-menu')))
51                $('.homepage').removeClass('mobile');
52            if (!($(e.target).parents('.homepage-events').length))
53                $('.homepage-events-title').removeClass('search-open');
54            if (!($(e.target).parents('.homepage-concat').length)){
55                $('.homepage').removeClass('display');
56
57                if (($('.homepage-concat .joining').length)) {
58                    $('.homepage-concat-close-bt').click();
59                    $('.homepage-concat .joining').remove();
60                }
61                //$('.hcc-details-required input').val('');
62            }
63        };
64        eventTyps();
65        limit=pagepath=='page'?limit:($(window).width() > 800 ? 12 : 6);
66        buildEvents(limit,0);
67        if ($(window).width() <= 800)
68            $(window).on('load',function () {
69                $('html, body').stop().animate({
70                    scrollTop: ($(".homepage-events-title").offset().top)/4
71                }, 500);
72            });
73
74        $(document).on('click', function (e) {
75            if(!$(e.target).hasClass("het-cellular-menu") && !$(e.target).hasClass("cell-menu-cont") && ($(".cell-menu-cont").length==1)) {
76                $(".cell-menu-cont").remove();
77                $('body').css('overflow','auto');
78            }
79        });
80
81        var eventsbydate = [];
82        var dayOfWeek = ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'];
83        var flagMoreEvent = false;
84        var flag = false;
85        var flaghere = false;
86
87        function eventTyps() {
88            var eventTyps = [];
89
90            eventTyps.push({
91                name: 'culture',
92                title: 'אירועים, כנסים<br />ומקומות ישיבה',
93                link: 'https://tickchak.co.il/events',
94                text: 'כל הכלים למפיק תחת קורת גג אחת, אירועים מורכבים מאוד נהפכים להיות קלים כל כך, בטיקצ\'אק.',
95                image: "https://static.tickchak.co.il/all/dln_00zby1WMMRVb5hkQHpXSLh0cYJlaTJERCZTbU9ycSFWWKdkVNFlVOJUbhRWR_090TQZp0R1B3cGRmUCFlZmhHWUFURuhFd.jpg_cddef8b6-39c7-4bb7-a83d-2f91a6167d96.jpg",
96                example: ''
97            });
98
99            eventTyps.push({
100                name: 'visitor',
101                title: 'מתחמים<br />ופסטיבלים',
102                link: 'https://tickchak.co.il/festivals',
103                text: 'אתר אישי וממותג משלך, עם כל הפעילויות שלך, תחת הדומיי×
103Ÿ שלך, ועם מערכת לניהול קהלים.',
104                image: "https://static.tickchak.co.il/images/homepage/festival.jpg",
105                example: ''
106            });
107
108            eventTyps.push({
109                name: 'goose',
110                title: 'חוגים, קורסים<br />וסדנאות',
111                link: 'https://tickchak.co.il/courses',
112                text: 'מהפכה אמיתית! תוכלו לנהל הוראות קבע, ולבנות תוכנית קורסים וחוגים בדיוק לפי הצרכים שלכם, בקלות, ובטיקצ\'אק.',
113                image: "https://static.tickchak.co.il/images/homepage/classes.jpg",
114                example: 'https://tickchak.co.il/home/192'
115            });
116
117            eventTyps.push({
118                name: 'seats',
119                title: 'מרכזי מבקרים',
120                link: 'https://tickchak.co.il/museums',
121                text: 'מוזיאונים, אתרי טבע ותרבות - יש לנו בשורה עבורכם. עד שלא תנסו לא תאמינו כמה קל לנהל את המכירה ואת הכניסה למתחם.',
122                image: "https://static.tickchak.co.il/images/homepage/visitorsCenter.jpg",
123                example: 'https://tickchak.co.il/1297?ref=r1'
124            });
125
126            eventTyps.push({
127                name: 'lector',
128                title: 'גיוסי המונים',
129                link: 'https://givechak.co.il/',
130                text: 'עם גיבצ\'אק, פלטפורמת גיוס ההמונים שלנו, תגייסו הרבה יותר מהר, ובקלות.',
131                image: "https://static.tickchak.co.il/all/dln_00zcZFkMwcldulFeJJHaxJUMKlFei5WVGpXW0R3Yv5EUx1EVR52LBxUSlx2L_090TQZp0R1B3cGRmUCFlZmhHWUFURuhFd.jpg_2d51b15d-6791-449d-9d22-d6515f13cbfd.jpg",
132                example: 'https://tickchak.co.il/146?ref=nwc'
133            });
134
135
136
137
138            function getCurrentevent(cname) {
139                var index = -1;
140                $.each(eventTyps, function (i, v) {
141                    if (v.name == cname) {
142                        index = i;
143                        return false;
144                    }
145                });
146                return index;
147            }
148             
149              
150            $('.hetc-events-ex').click(function () {
151                var cindex = getCurrentevent($(this).attr('data-event'));
152                var et = eventTyps[cindex];
153                while($('.hetc-specific-event').length>1)
154                    $('.hetc-specific-event').eq(0).remove();
155                $('.hetc-specific-event').attr('class', 'hetc-specific-event ' + et.name);
156                $('.hetc-specific-event-text-container p').text(et.text);
157                $('.hetc-specific-event-tag').html('<a href="'+et.link+'">'+et.title+'</a>');
158                $('.hetc-specific-event-img').css("background-image", "url(" + et.image 
158+ ")");
159                $('.hetc-specific-event-text-container .btb a').attr("href", et.example);
160                var index = ($(this).parents('.hetc-events')).index();
161                // hetc-events transport
162                $('.homepage-eventTypes').attr('class', 'homepage-eventTypes section opened');
163                switch (parseInt(index / 2)) {
164                    case 1:
165                        $('.homepage-eventTypes').addClass('second');
166                        break;
167                    case 2:
168                        $('.homepage-eventTypes').addClass('third');
169                        break;
170                    case 3:
171                        $('.homepage-eventTypes').addClass('fourth');
172                        break;
173                    case 4:
174                        $('.homepage-eventTypes').addClass('fifth');
175                        break;
176
177                }
178                if ($(window).width() <= 800)
179                    makeScroll($(this).parents('.hetc-event'));
180            });
181            $('.hetc-specific-event-close').click(function () {
182                $('.homepage-eventTypes').removeClass('opened');
183            });
184        }
185
186        $('.homepage-events').on('click', '.hec-events-evnet', function () {
187            ($(this).find('.hec-events-evnet-details')).find('a')[0].click();
188        });
189        $('.hetc-event.svg').click(function () {
190            ($(this).find('.hetc-events-ex'))[0].click();
191        });
192        var swiper_tickchak;
193        var swiper_image;
194        var swiper_title;
195        var swiper_days;
196        var swiper_customers;
197
198    setTimeout(function () {
199        swiper_customers = new Swiper('.sslider.swiper-container', {
200            // loop: 'true',
201            autoplay: true,
202            width: $(window).width()<800?6651*.5:6651,
203            autoplayDisableOnInteraction: true,
204            speed: 60000,
205            loop: true,
206            spaceBetween: 0,
207            autoplay: {
208                delay: 0,
209                disableOnInteraction: true,
210                loopPreventsSlide: false,
211            },
212
213        });
214    }, 100);
215
216        setTimeout(function () {
217            swiper_tickchak = new Swiper('.tslider-slider', {
218                direction: 'horizontal',
219                height: 600
220            });
221            swiper_tickchak.on('onSlideChangeStart', function () {
222                var index = swiper_tickchak.activeIndex;
223                $('.tslider-top .tslider-sec').removeClass('selected').eq(index).addClass('selected');
224                $('.tslide-' + (index + 1) + ' .tslide-bg').stop().css({
225                    transform: 'scale(0)',
226                    opacity: 0
227                }).animate({opacity: 1}, {
228                    duration: 400,
229                    step: function (now, fx) {
230                        $(this).css({transform: 'scale(' + now + ')'});
231                    }
232                });
233            });
234            swiper_image = new Swiper('.homepage-specificevent-container', {
235                // loop: 'true',
236                autoplay: {delay: 3000},
237                autoplayDisableOnInteraction: false,
238                speed: 2000,
239                effect: 'fade',
240                fade: {crossFade: true}
241            });
242            swiper_title = new Swiper('.homepage-title .contain', {
243                // loop: 'true',
244                autoplay: {delay: 3000},
245                autoplayDisableOnInteraction: false,
246                speed: 5000,
247                effect: 'fade'
248            });
249        }, 500);
250
251        $('.tslider-top .tslider-sec').click(function () {
252            $('.tslider-sec').removeClass('selected');
253            $(this).addClass('selected');
254            $('.tslider-bg p').removeClass('selected');
255            $('.tslider-bg p:nth-child(' + ($(this).index() + 1) + ')').addClass('selected');
256            swiper_tickchak.slideTo($(this).index());
257        });
258        $('.r-btn').click(function () {
259            if (typeof ga === 'function')
260                ga('tickchak_global.send', 'event', 'research', 'create_event_open_top');
261            createEvent();
262        });
263        $('.homepage-concat-close-bt').click(function () {
264            if (typeof ga === 'function')
265                ga('tickchak_global.send', 'event', 'research', 'create_event_exit');
266            $('.homepage').removeClass("display");
267            $('.hcc-details-required input').val('');
268        });
269        $('.ha-createEvent').click(function () {
270            createEvent();
271        });
272        $('.homepage-price-createEvent').click(function () {
273            createEvent();
274        });
275        $('.r-btn').click(function () {
276            if (typeof ga === 'function')
277                ga('tickchak_global.send', 'event', 'research', 'create_event_open_slider');
278            createEvent();
279        });
280
281        $(document).on('click','.hetc-specific-event-text-container .btb a',function(e){
282            e.preventDefault();
283            createEvent();
284        });
285
286        $('.red-tag, .l-btn').click(function () {
287            window.open("https://tickchak.co.il/11435?ref=r1");
288        });
289        $('.homepage-events-more').click(function () {
290            $(".homepage-events-more").prop('new_load',1);
291            var num = $(window).width() > 800 ? 8 : 6;
292            var offset = $(window).width() > 800 ? (num/2) : 1;
293
294            buildEvents(num, ($('.homepage-events-all').children().length) * offset);
295        });
296        $('.het-category a').click(function () {
297            $('.het-category a').removeClass('select');
298            $(this).addClass('select');
299            makeScroll($(".homepage-events-title"));
300            buildEvents($(window).width() > 800 ? 12 : 6);
301        });
302        $(".het-cellular-menu").click(function () {
303            $('html, body').stop().animate({
304                scrollTop: ($(".homepage-events-title").offset().top)/15
305            }, 500);
306            $('body').css('overflow','hidden');
307            $('<div class="cell-menu-cont">' +
308                    '<div class="cell-menu-all">כל האירועים</div>' +
309                    '<div class="cell-menu-music">מוזיקה</div>' +
310                    '<div class="cell-menu-food">אוכל</div>' +
311                    '<div class="cell-menu-party">מסיבות</div>' +
312                    '<div class="cell-menu-art">אמנות</div>' +
313                    '<div class="cell-menu-lecture">שיעורים</div>' +
314                    '<div class="cell-menu-sport">ספורט</div>' +
315                    '<div class="cell-menu-title">קטגוריות' +
316                        '<p></p>' +
317                    '</div>' +
318                '</div>').insertAfter($(this)).find("div").click(function () {
319                $(".het-category a:eq("+$(this).index()+")").click();
320                if ($(this).text()!="כל האירועים") {
321                    $(".het-byDate").text($(this).text()).css("text-align", "left");
322                }else {
323                    $(".het-byDate").text("אירוע לפי יום ושעה").css("text-align", "right");
324                }
325                $(".cell-menu-cont").remove();
326                $('body').css('overflow','auto');
327            });
328            $(".cell-menu-title p").click(function () {
329                $(this).parents(".cell-menu-cont").remove();
330                $('body').css('overflow','auto');
331            });
332        });
333        $('.het-byDate').click(function () {
334            $('.homepage-events').addClass('calendaropen');
335            $('.calendaropen').css({height: '834px'});
336            $('.homepage-events-allhidden').css({height: '609.5px'});
337            $('.he-bydate-calendar-Y div').removeClass('selected');
338            $('.he-bydate-calendar-M div').removeClass('selected');
339            var date = new Date();
340            $('.he-bydate-calendar-Y div').filter(function () {
341                return this.innerHTML == date.getFullYear()
342            }).addClass('selected');
343            $('.he-bydate-calendar-M div').filter(function () {
344                return this.innerHTML == (date.getMonth() + 1)
345            }).addClass('selected');
346            buildEventsByDate(date.getUTCDate());
347            makeScroll($(".homepage-events-bydate"));
348        });
349        $('.he-bydate-close.close').click(function () {
350            $('.homepage-events').removeClass('calendaropen');
351            buildEvents($(window).width() > 800 ? 12 : 6);
352        });
353        $('.hmm-recommend-face').click(function () {
354
355        });
356        $('.slide-up').click(function () {
357            var index = swiper_days.activeIndex + 2;
358            gotonNextevent(index);
359
360        });
361        $('.slide-down').click(function () {
362            var index = swiper_days.activeIndex;
363            gotonPrevevent(index);
364            // while( !eventsbydate[index].length )
365            //     index--;
366            // if(!eventsbydate[index]){
367            //
368            // }else{
369            //     swiper_days.slideTo(index-1)
370            //     buildeventsDay(index)
371            // }
372
373        });
374    $('body').append('<div class="signUpIframe"><iframe src="'+tickchak_app_domain+'/signUp" onload="signUpIframeOnLoad()"/></div>');
375    $('.signUpIframe iframe').click(function(e){
376        e.stopPropagation();
377    });
378    $('.signUpIframe').click(function(e){
379        $('body').find('.signUpIframe').removeClass('show');
380    })
381
382
383        function gotonNextevent(index) {
384            for (var i = index; i < eventsbydate.length; i++) {
385                if (!eventsbydate[index].length)
386                    index++;
387                else
388                    break;
389            }
390
391            if (!eventsbydate[index]) {
392                $('.slide-up').addClass('disabled');
393                if ($(window).width() <= 800) {
394                    $('.he-bydate-events-numEvents').html('לא קיימים אירועים');
395                    $('.he-bydate-container').css({height: '320px'});
396                    $('.homepage-events').css({height: '684.5px'});
397                    $('.homepage-events-bydate').css({height: '684.5px'});
398                    $('.homepage-events-allhidden').css({height: '609.5px'});
399                }
400
401            } else {
402                $('.slide-down').removeClass('disabled');
403                flag = true;
404                swiper_days.slideTo(index - 1);
405                buildeventsDay(index);
406                flag = false;
407            }
408            checkNextdisabled(index + 1);
409            checkPrevdisabled(index - 1);
410            // return index!==eventsbydate.length;
411            return eventsbydate[index];
412        }
413
414        function gotonPrevevent(index) {
415            for (var i = index; i > 0; i--) {
416                if (!eventsbydate[index].length)
417                    index--;
418                else
419                    break;
420            }
421
422            if (!eventsbydate[index]) {
423                $('.slide-down').addClass('disabled');
424                if ($(window).width() <= 800) {
425                    $('.he-bydate-events-numEvents').html('לא קיימים אירועים');
426                    $('.he-bydate-container').css({height: '320px'});
427                    $('.homepage-events').css({height: '684.5px'});
428                    $('.homepage-events-bydate').css({height: '684.5px'});
429                    $('.homepage-events-allhidden').css({height: '609.5px'});
430                }
431
432            } else {
433                $('.slide-up').removeClass('disabled');
434                flag = true;
435                swiper_days.slideTo(index - 1);
436                buildeventsDay(index);
437                flag = false;
438            }
439            checkPrevdisabled(index - 1);
440        }
441
442        function checkNextdisabled(index) {
443            for (var i = index; i < eventsbydate.length; i++) {
444                if (!eventsbydate[index].length)
445                    index++;
446                else
447                    break;
448            }
449
450            if (!eventsbydate[index])
451                $('.slide-up').addClass('disabled');
452            else
453                $('.slide-up').removeClass('disabled');
454
455        }
456
457        function checkPrevdisabled(index) {
458            for (var i = index; i > 0; i--) {
459                if (!eventsbydate[index].length)
460                    index--;
461                else
462                    break;
463            }
464
465            if (!eventsbydate[index])
466                $('.slide-down').addClass('disabled');
467            else
468                $('.slide-down').removeClass('disabled');
469
470        }
471
472
473        function createEvent() {
474            if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
475                window.open(tickchak_app_domain + '/signUp', '_blank');
476                return;
477            }
478            if(signUp)
479                window.open(tickchak_app_domain, '_blank')
480            else
481                $('body').find('.signUpIframe').addClass('show');
482            return;
483            $('html, body').stop().animate({
484                scrollTop: 0
485            }, 500);
486            setTimeout(function () {
487                $('.homepage').addClass("display")
488            }, 520);
489        }
490
491        $('.het-search input').keyup(function () {
492            $(this).keypress(function(e) {
493                    if(e.which == 13) { // press enter
494                        makeScroll($(".homepage-events-title"));
495                    }
496                });
497            buildEvents($(window).width() > 800 ? 12 : 6);
498        });
499
500        function buildEvents(limit, offset) {
501            return;
502            var fields = '';
503            var events = '';
504            var i = 0;
505            var past;
506            var clicktext;
507            var content;
508            var in_stock;
509            if (!flaghere) {
510                flaghere = true;
511                limit = limit ? limit : 4;
512                offset = offset ? offset : 0;
513                if (!offset)
514                    $('.homepage-events-all').html('');
515                var k = $('.homepage-events-all').children().length;
516                $.post('/ajax/homepage/get_events', {
517                    'limit': limit,
518                    'offset': offset,
519                    'search': $('.het-search input').val(),
520                    'cat_id': $('.het-category a.select').attr('data-cat')
521                }, function (data) {
522                        var numreturnd = data.events.length;
523                        if (data.events.length)
524                            var eventContainer = '<div class="homepage-events-container' + k + '"><div class="hec-events">';
525                        $.each(data.events, function (i, v) {
526                            var all_date = v.time_openstart_date;
527                            var day_only_res = all_date.substring(0,2);
528                            var month_and_year = all_date.substring(3);
529                            var month_only = month_and_year.substring(0,3)
530                            var month_no_dot = month_only.substring(0,2)
531                            var year_only = month_and_year.substring(3)
532                            var whole_year = "20"+year_only
533                            var week_days=["ראשון","שני","שלישי","רביעי", "חמישי","שישי","שבת"]
534                            var our_new_date = new Date(month_no_dot+"/"+
534day_only_res+"/"+whole_year);
535                            var day_in_the_week = our_new_date.getDay()
536                            var has_no_date;
537                            if (v.time_end && v.time_end < v.dnow) {
538                                past = 'past';
539                                clicktext = 'לדף האירוע';
540                                content = '<div class="past-event">'+'אירוע' + '<br>' + "שהיה"+'</div>'+'<div class="past_event_date">'+all_date+'</div><div class="past_event_time">'+'<br>'+(v.time_openstart_time?v.time_openstart_time:'')+'</div><div class="past_day_of_week">'+(week_days[day_in_the_week]?week_days[day_in_the_week]:"")+'</div>'
541                                has_no_date = ""
542                            }
543                            else if (v.time_end && v.time_end > v.dnow){
544                                past = '';
545                                clicktext = 'להזמנת כרטיסים';
546                                content = '<div class="big-nice-date">' + (day_only_res) + '</div><br><div class="hece-evnet-details-date-date">' + (month_only?(month_only)+"20"+(year_only):"") + '</div><div class="hece-evnet-details-date-time">' + (v.time_openstart_time?v.time_openstart_time:'') + '</div><div class="day_of_week">'+(week_days[day_in_the_week]?week_days[day_in_the_week]:"")+'</div>';
547                                has_no_date = ""
548                            }
549                            else{
550                                past = '';
551                                clicktext = 'להזמנת כרטיסים';
552                                content = ''
553                                has_no_date = " has_no_date"
554                            }
555                            if(v.type=="product"){
556                            clicktext="לדף המכירה"
557                            }
558
559                            in_stock =!v.in_stock?'<div class="hec-events-evnet-outofstock">אזל המלאי</div>':'';
560                            clicktext = !v.in_stock?'לדף האירוע':clicktext;
561
562                            eventContainer += '<div class="hec-events-evnet" data-eid="' + v.eid + '"'+ ((v.tickchak_index)?'is-attach="'+v.tickchak_index+'"':"")+'' + ((v.active)?'is-active="'+v.active+'"':"")+'>'+in_stock+'<div class="hec-events-evnet-img" style="background-image:url(' + v.fb_img + ');"></div><div class="hec-events-evnet-details"><div class="bt btb hec-eed-taketicket">' + clicktext + '<a href="https://' + v.link + '" target="_blank"></a></div><div class="hece-evnet-details-title'+has_no_date+'">' + v.title + '</div><div class="hece-evnet-details-about'+has_no_date+'">' + v.description + '</div><div class="hece-evnet-details-bottom"><div class="hece-evnet-details-date ' + past + '">' + content + '</div><div class="hece-evnet-details-location">' + (v.location?v.location:"") + '</div></div></div></div>';
563
564                            if ($(window).width() > 800) {
565                                if ((i + 1) % 4 == 0 && (i + 1) !== limit) {
566                                    eventContainer += '</div></div>';
567                                    k++;
568                                    eventContainer += '<div class="homepage-events-container' + k + '"><div class="hec-events">';
569                                }
570                            }
571                            else {
572                                if ((i + 1) !== numreturnd) {
573                                    eventContainer += '</div></div>';
574                                    k++;
575                                    eventContainer += '<div class="homepage-events-container' + k + '"><div class="hec-events">';
576                                }
577                            }
578
579                        });
580                        if (data.events.length)
581                            eventContainer += '</div></div>';
582                        $('.homepage-events-all').append(eventContainer);
583                        if ((offset || data.events.length>12) && (data.events.length > 0 || ($('.homepage-events-all').height()) > ($('.homepage-events-allhidden').height()))) {
584
585                            var exist = $('.homepage-events-all').height();
586                            if(data.events.length==0)
587                            {
588                                $('.homepage-events').css({height: exist+95 + 'px'});
589                                $('.homepage-events-allhidden').css({height: exist + 'px'});
590                            }
591                            else{
592                                $('.homepage-events').css({height: exist-105 + 'px'});
593                                $('.homepage-events-allhidden').css({height: exist-180 + 'px'});
594                            }
595
596                        }
597                        if (!offset && data.events.length<=12) {
598                            if ($(window).width() > 800) {
599                                $('.homepage-events').css({height: '834px'});
600                                $('.homepage-events-allhidden').css({height: '759px'});
601                            }
602                            else {
603                                $('.homepage-events').css({height: '1845px'});
604                                $('.homepage-events-allhidden').css({height: '1770px'});
605                            }
606                        }
607
608                        flaghere = false;
609                });
610
611            }
612
613        }
614        
615        function buildEventsByDate(day_in_month) {
616            $.post('/ajax/homepage/get_eventsByDate', {
617                'year': $('.he-bydate-calendar-Y div.selected').html(),
618                'month': $('.he-bydate-calendar-M div.selected').html()
619            }, function (data) {
620                var days = new Date($('.he-bydate-calendar-Y div.selected').html(), $('.he-bydate-calendar-M div.selected').html(), 0).getDate();
621                eventsbydate = new Array(days);
622                for (var i = 1; i <= days; i++)
623                    eventsbydate[i] = new Array();
624                var events = '';
625                $.each(data, function (i, v) {
626                    eventsbydate[parseInt(v.day_in_month)].push(v);
627                });
628                buildDaysMonthslide(day_in_month);
629            })
630        }
631
632        function buildDaysMonthslide(day_in_month) {
633
634            var days = new Date($('.he-bydate-calendar-Y div.selected').html(), $('.he-bydate-calendar-M div.selected').html(), 0).getDate();
635            var slides = '';
636            for (var i = 1; i <= days; i++) {
637                var day = i >= 10 ? i : '0' + i;
638                var d = dayOfWeek[(new Date($('.he-bydate-calendar-Y div.selected').html() + '.' + $('.he-bydate-calendar-M div.selected').html() + '.' + i)).getDay()]
639                slides += '<div class="swiper-slide"><div class="heb-calendar-Dd-text">יום ' + d + '</div><div class="heb-calendar-Dd-num">' + day + '</div><div class="heb-calendar-Dd-month">' + $('.he-bydate-calendar-M div.selected').attr('data-hint') + '</div></div>'
640            }
641            $('.he-bydate-calendar-D .swiper-wrapper').html('');
642            $('.he-bydate-calendar-D .swiper-wrapper').html(slides);
643
644            if (swiper_days)
645                swiper_days.destroy();
646            swiper_days = new Swiper('.he-bydate-calendar-D .contain', {
647                direction: 'vertical',
648                height: 600
649            });
650
651            swiper_days.on('slideChange', function () {
652                if (!flag) {
653                    if (swiper_days.previousIndex < swiper_days.activeIndex) {
654                        if ($('.slide-up').hasClass('disabled')){
655                            flag=true;
656                            swiper_days.slideTo(swiper_days.previousIndex);
657                            flag=false;
658                        }
659                        else
660                            gotonNextevent(swiper_days.activeIndex + 1);
661                    }
662                    else {
663                        if ($('.slide-down').hasClass('disabled')){
664                            flag=true;
665                            swiper_days.slideTo(swiper_days.previousIndex);
666                            flag=false;
667                        }
668                        else
669                            gotonPrevevent(swiper_days.activeIndex);
670                    }
671                }
672
673            });
674            $('.he-bydate-container').html('');
675            $('.slide-up,.slide-down').removeClass('disabled');
676            var success=gotonNextevent(day_in_month);
677            if(!success){
678                gotonNextevent(1)
679            }
680
681
682        }
683
684        function buildeventsDay(day) {
685            var events = '';
686            var h;
687            var past;
688            var clicktext;
689            var content;
690            var in_stock;
691            $.each(eventsbydate[day], function (i, v) {
692                if (v.time_end < v.dnow) {
693                    past = 'past';
694                    clicktext = 'לדף האירוע';
695                    content = 'אירוע שהיה';
696                }
697                else {
698                    past = '';
699                    clicktext = 'להזמנת כרטיסים';
700                    content = '<div class="hece-evnet-details-date-date">' + (v.time_openstart_date?v.time_openstart_date:'') + '</div><div class="hece-evnet-details-date-time">' + (v.time_openstart_time?v.time_openstart_time:'') + '</div>';
701                }
702                in_stock =!v.in_stock?'<div class="hec-events-evnet-outofstock">אזל המלאי</div>':'';
703                clicktext = !v.in_stock?'לדף האירוע':clicktext;
704
705                if ($(window).width() <= 800) {
706                    events += '<div class="homepage-events-container' + i + '"><div class="hec-events">';
707                }
708                events += '<div class="hec-events-evnet" data-eid="' + v.eid + '">'+in_stock+'<div class="hec-events-evnet-img" style="background-image:url(' + v.fb_img + ');"></div><div class="hec-events-evnet-details"><div class="bt btb hec-eed-taketicket">
708' + clicktext + '<a href="https://' + v.link + '" target="_blank"></a></div><div class="hece-evnet-details-title">' + v.title + '</div><div class="hece-evnet-details-about">' + v.description + '</div><div class="hece-evnet-details-bottom"><div class="hece-evnet-details-date ' + past + '">' + content + '</div><div class="hece-evnet-details-location">' + (v.location?v.location:"") + '</div></div></div></div>'
709                if ($(window).width() <= 800) {
710                    events += '</div></div>';
711                }
712            });
713            $('.he-bydate-container').html(events);
714            if ($(window).width() <= 800) {
715                if (eventsbydate[day].length == 1)
716                    $('.he-bydate-events-numEvents').html('יש אירוע אחד היום!');
717                else
718                    $('.he-bydate-events-numEvents').html('יש ' + eventsbydate[day].length + ' אירועים היום!');
719                if (eventsbydate[day].length <= 6) {
720
721                    $('.he-bydate-container').css({height: (eventsbydate[day].length) * 320 + 'px'});
722                    h = $('.he-bydate-container').height();
723                    $('.homepage-events').css({height: h + 364.5 + 'px'});
724                    $('.homepage-events-bydate').css({height: h + 364.5 + 'px'});
725                    $('.homepage-eventsday-more').hide();
726                }
727                else {
728                    $('.he-bydate-container').css({height: '1920px'});
729                    h = $('.he-bydate-container').height();
730                    $('.homepage-events').css({height: h + 364.5 + 'px'});
731                    $('.homepage-events-bydate').css({height: h + 364.5 + 'px'});
732                    $('.homepage-eventsday-more').show();
733                }
734            }
735        }
736        $('.homepage-eventsday-more').click(function () {
737            var numh = $('.he-bydate-container').height() / 320;
738            if (eventsbydate[swiper_days.activeIndex + 1].length > numh) {
739                $('.he-bydate-container').css({height: (numh * 320) + 320 + 'px'});
740                var h = $('.he-bydate-container').height();
741                $('.homepage-events').css({height: h + 364.5 + 'px'});
742                $('.homepage-events-bydate').css({height: h + 364.5 + 'px'});
743            }
744            if ((numh + 1) == eventsbydate[swiper_days.activeIndex + 1].length)
745                $('.homepage-eventsday-more').hide();
746
747        });
748
749
750        $(".homepage-events-all").on('mouseover', "div[class^='homepage-events-container']:last-child", function () {
751            flagMoreEvent = true;
752            setTimeout(function () {
753                if (flagMoreEvent) {
754                    $('.homepage-events-more').click();
755                }
756            }, 300)
757        });
758
759        $(".homepage-events-all").on('mouseleave', "div[class^='homepage-events-container']:last-child", function () {
760            flagMoreEvent = false;
761        });
762
763
764        $(window).scroll(function (e) {
765            if($('.homepage').hasClass('display') && (($('.homepage').find('.joining').length) || ($('.homepage').find('.term').length) || ($('.homepage').find('.conflict').length))) {
766                prevent_scroll_page(true);
767            }
768            else {
769                prevent_scroll_page(false);
770            }
771
772            if ($(window).scrollTop() > 115) {
773                if ($('.homepage').hasClass('display')) {
774                    $('.homepage').removeClass('display');
775                }
776                $('.homepage').addClass('scroll');
777                if ($(window).width() > 800)
778                    $('.homepage').addClass('scroll-menue');
779                $('.homepage-title').addClass('up');
780                if ($(window).scrollTop() > ($('.homepage-eventTypes').offset().top + 900))
781                    if ($('.homepage-eventTypes').hasClass('opened')) {
782                        $('.homepage-eventTypes').removeClass('opened');
783                        $('.homepage-eventTypes').removeClass('second');
784                        $('.homepage-eventTypes').removeClass('third');
785                    }
786
787                $('.homepage-title .contain').css({opacity:(700-$(window).scrollTop())/800});
788
789            }
790            else {
791                $('.homepage-title .contain').css({opacity:1});
792                $('.homepage').removeClass('scroll');
793                $('.homepage').removeClass('scroll-menue');
794                $('.homepage-title').removeClass('up');
795
796                if($('.hcc-details-required input').map(function(){return $(this).val()}).get().join('')!=''){
797                    $('.homepage').addClass('display');
798
799                    //   $('html,body').scrollTop(0);
800                }
801            }
802
803
804        });
805        var old_width = $(window).width();
806        $(window).resize(function () {
807            if (old_width == $(window).width() || $('.calendaropen').length)
808                return;
809            old_width = $(window).width();
810            buildEvents($(window).width() > 800 ? 12 : 6);
811        });
812        $('.homepage-menu-small').click(function () {
813            $('.homepage').removeClass('scroll-menue');
814            if ($(window).width() < 800) {
815                $('.homepage').addClass('mobile');
816            }
817        });
818
819        $('homepage-menu-menu li').click(function () {
820
821        });
822        $('.homepage-menu-menu a').click(function () {
823            var slide_to = $(this).attr('data-goto');
824            $('.homepage').removeClass('mobile');
825            makeScroll($('.homepage-' + slide_to));
826        });
827        $('.he-bydate-calendar-M .hbcm-m').click(function () {
828            $('.he-bydate-calendar-M div').removeClass('selected');
829            $(this).addClass('selected');
830            buildEventsByDate(1);
831        });
832        $('.he-bydate-calendar-Y div').click(function () {
833            $('.he-bydate-calendar-Y div').removeClass('selected');
834            $(this).addClass('selected');
835            buildEventsByDate(1);
836        });
837        $('.het-search').click(function () {
838            $('.homepage-events-title').addClass('search-open')
839        });
840        $('.go-contact').click(function () {
841            $('.homepage').removeClass('display')
842            setTimeout(function () {
843                $('.homepage-menu-menu a[data-goto="simplecontact"]').click()
844            },350)
845
846        })
847
848        function prevent_scroll_page(scrollLock) {
849            var  previousScrollTop = 0;
850            if(scrollLock) {
851                $(window).scrollTop(previousScrollTop);
852            }
853            previousScrollTop = $(window).scrollTop();
854        }
855        
856        function makeScroll($elem) {
857            var scrollto = 0;
858            var offset = 60;
859
860            // if(page!='') {
861            var $top_elem = $elem;
862            if ($top_elem.length > 0)
863                scrollto = $top_elem.offset().top - offset;
864            //     else
865            //         return;
866            // }
867
868            $('html, body').stop().animate({
869                scrollTop: scrollto
870            }, 500);
871        }
872
873
874        //
875        function valid(is_focusout) {
876            var notify=false;
877            var notify_name;
878            $('.hcc-details-required input,.hcc-details-required div').each(function(){
879                if($(this).parent().attr('name')=='email')
880                    $(this).val($(this).val().trim())
881                var valid=contact_validation($(this).parent().attr('name'),$(this).val().trim(),false);
882                if(valid!='ok') {
883                    notify=valid; //msg
884                    notify_name=$(this).attr('category'); //element name
885                    return false;
886                }
887            });
888            if(notify) {
889                if($('.mininotify').length && $('.mininotify').text()==notify && is_focusout)
890                    return false;
891                $('.mininotify').remove();
892                $(".notify").removeClass('notify');
893                $('.hcc-d-'+notify_name).parent().addClass('notify');
894                $('.hcc-d-'+notify_name).before('<div class="mininotify"></div>');
895                $('.mininotify').attr("data-hint", notify).animate({left:'50%'},300,'swing');
896                return false;
897            }
898            return true;
899        }
900        //
901
902        $(document).on('blur','.hcc-details-required input',function(){
903            if(valid(true) && $('.mininotify').length){
904                $('.mininotify').animate({left:550,opacity:0},300,'swing');
905                setTimeout(function () {
906                    $('.mininotify').remove();
907                    $(".notify").removeClass('notify');
908                },500);
909            }
910        });
911        $('.hcc-d-terms').click(function () {
912            $(this).toggleClass('selected');
913        })
914
915        $('.contact-bt-send').click(function () {
916            var d = new Date();
917            var month = d.getMonth()+1;
918            var day = d.getDate();
919            var minutes= d.getMinutes()
920            var hours = d.getHours();
921            if(minutes<10)
922                minutes="0"+minutes;
923            if(hours<10)
924                hours="0"+hours;
925            var time = hours + ":" + minutes;
926            var output = d.getFullYear() + '/' +
927                (month<10 ? '0' : '') + month + '/' +
928                (day<10 ? '0' : '') + day;
929            var in_charge_of="בחר איש שיווק"
930            var new_customer = "חדש";
931            var phone_only_digits= $('.inp-contact-phone').val();
932            phone_only_digits = phone_only_digits.replace(/\D/g,'')
933            var fields = {};
934            fields.fname = $('.inp-contact-fname').val();
935            fields.lname = $('.inp-contact-lname').val();
936            fields.phone = phone_only_digits;
937            fields.email = $('.inp-contact-email').val();
938            fields.message = $('.inp-contact-message').val();
939            fields.date=output;
940            fields.time=time;
941            fields.status=new_customer;
942            fields.through="simple_contact";
943            fields.in_charge_of=in_charge_of;
944            fields.ref=QueryString.ref?QueryString.ref:null
945            fields.tz=''
946            fields.size_event=0
947
948
949            if (fields.fname.length < 2) {
950                $('.inp-contact-fname').addClass('notify');
951                return;
952            } else {
953                $('.inp-contact-fname').removeClass('notify');
954            }
955            if (fields.lname.length < 2) {
956                $('.inp-contact-lname').addClass('notify');
957                return;
958            } else {
959                $('.inp-contact-lname').removeClass('notify');
960            }
961
962            if (fields.email.length < 4) {
963                $('.inp-contact-email').addClass('notify');
964                return;
965            } else {
966                $('.inp-contact-email').removeClass('notify');
967            }
968
969
970
971            $(this).addClass('sending').text('שולח...');
972            var $this = $(this);
973            $.post('/ajax/homepage/post_simple_contact', fields, function (data) {
974                if (data.result == 'ok') {
975                    var array_url = window.location.href;
976                    var q_string_index = array_url.indexOf('?');
977                    var q_string = '';
978                    if (q_string_index !== -1) {
979                        q_string = array_url.slice(q_string_index, array_url.length);
980                        array_url = array_url.slice(0, q_string_index);
981                    }
982                    window.history.pushState({ url: window.location.href },'','/thankyou2/'+q_string)
983
984                    $('head').append('<script>gtag(\'event\', \'conversion\', {\'send_to\': \'AW-770209806/KZVMCJn-3MIBEI7woe8C\'})</script>')
985                    $('head').append('<script>fbq(\'track\', \'StartTrial\');</script>')
986
987
988                    $this.text('תודה :)');
989                    setTimeout(function () {
990                        $this.text('שלח');
991                        $this.removeClass('sending');
992                        $('.contact-right input,.contact-right textarea').val('');
993                    }, 6500);
994                }
995                else {
996                    console.log(data);
997                    $this.text('מצטערים, אירעה שגיאה.');
998                }
999            }, 'json')
1000            fields.link=''
1001            $.post('/ajax/homepage/post_new_lead', fields, function (data) {
1002            })
1003
1004        });
1005
1006        // facebook quick register
1007        $(".bt.hcc-quick-reg-fb").click(function () {
1008            FB.login(
1009                function(response){
1010                    if(response.status!='connected')
1011                        return;
1012                        $.post('/ajax/homepage/get_fb_details',{'fb_access_token':response.authResponse.accessToken},function(data){
1013                            $(".hcc-d-firstName").val(data.name);
1014                            $(".hcc-d-lastName").val(data.ln);
1015                            $(".hcc-d-mail").val(data.email);
1016                            $('.hcc-d-phone').parent().addClass('notify');
1017                            $('.hcc-d-phone').before('<div class="mininotify"></div>');
1018                            $('.mininotify').attr("data-hint", "מספר הטלפון לא חוקי").animate({left:'50%'},300,'swing');
1019                        },'json').fail(function(data){console.log(data.responseText);});
1020                },
1021                {scope: 'public_profile,email'});
1022                // $.post('/ajax/homepage/post_new_lead', fields, function (data) {
1023                // })
1024
1025        });
1026
1027        // google quick register
1028        window.tick_g_login=function(token){
1029            $.post('/ajax/homepage/get_gl_details',{'gl_access_token':token},function(data){
1030                $(".hcc-d-firstName").val(data.name);
1031                $(".hcc-d-lastName").val(data.ln);
1032                $(".hcc-d-mail").val(data.email);
1033                $('.hcc-d-phone').parent().addClass('notify');
1034                $('.hcc-d-phone').before('<div class="mininotify"></div>');
1035                $('.mininotify').attr("data-hint", "מספר הטלפון לא חוקי").animate({left:'50%'},300,'swing');
1036            },'json').fail(function(data){console.log(data.responseText);});
1037            this.console.log(fields)
1038            // $.post('/ajax/homepage/post_new_lead', fields, function (data) {
1039            // })
1040        };
1041
1042
1043
1044        $(".hcc-producer").keyup(function(event) {
1045            if (event.keyCode === 13) {
1046                $(".hcc-bt-send").click();
1047            }
1048        });
1049
1050        function contact_validation(field_name, field_text, is_send){
1051            if (field_text.length == 0 && (!is_send))
1052                return 'ok';
1053            switch(field_name){
1054                case 'first':
1055                    if (field_text.length < 2){
1056                        $('.hcc-d-firstName').parent().addClass('notify');
1057                        return 'השם קצר מדי';
1058                    }
1059                    return 'ok';
1060                case 'last':
1061                    if (field_text.length < 2) {
1062                        $('.hcc-d-lastName').parent().addClass('notify');
1063                        return 'שם המשפחה קצר מדי';
1064                    }
1065                    return 'ok';
1066                case 'email':
1067                    if ((field_text.length < 2) || (!(field_text.match(/^\S+@\S+\.\S+$/g)))) {
1068                        $('.hcc-d-mail').parent().addClass('notify');
1069                        return 'כתובת המייל לא חוקית';
1070                    }
1071                    return 'ok';
1072                case 'phone':
1073                    if ((field_text.length < 2) || (!(field_text.match(/^0[57][\d]{8}$/g)))) {
1074                        $('.hcc-d-phone').parent().addClass('notify');
1075                        return 'מספר הטלפון לא חוקי, הזינו טלפון נייד';
1076                    }
1077                    return 'ok';
1078                case 'size_event':
1079                    if ((field_text== "0")) {
1080                        $('.hcc-d-size-event').parent().addClass('notify');
1081                        return 'יש לבחור סדר גודל של אירוע';
1082                    }
1083                    return 'ok';
1084                case 'tz':
1085                    if (field_text.length == 0) {
1086                        $('.hcc-d-tz').parent().addClass('notify');
1087                        return 'יש להזין תעודת זהות / ח.פ.';
1088                    }
1089                    return 'ok';
1090            }
1091        }
1092
1093        function package_update_fildes(){
1094            var d = new Date();
1095            var month = d.getMonth()+1;
1096            var day = d.getDate();
1097            var minutes= d.getMinutes();
1098            var hours = d.getHours();
1099            if(minutes<10)
1100                minutes="0"+minutes;
1101            if(hours<10)
1102                hours="0"+hours;
1103            var time = hours + ":" + minutes;
1104            var output = d.getFullYear() + '/' +
1105                (month<10 ? '0' : '') + month + '/' +
1106                (day<10 ? '0' : '') + day;
1107
1108
1109            var in_charge_of="בחר איש שיווק"
1110            var new_customer = "חדש";
1111            var phone_only_digits= $('.hcc-d-phone').val().trim();
1112            phone_only_digits = phone_only_digits.replace(/\D/g,'')
1113            var fields = {};
1114            fields.fname = $('.hcc-d-firstName').val().trim();
1115            fields.lname = $('.hcc-d-lastName').val().trim();
1116            fields.phone = phone_only_digits;
1117            fields.email = $('.hcc-d-mail').val().trim();
1118            fields.comments = $('.hcc-d-comments').val().trim();
1119            fields.size_event = $('.hcc-d-size-event').val();
1120            fields.tz = $('.hcc-d-tz').val().trim();
1121            fields.date=output;
1122            fields.time=time;
1123            fields.status=new_customer;
1124            fields.through="serious_contact";
1125            fields.message="";
1126            fields.in_charge_of=in_charge_of;
1127
1128            fields.company = $('.hcc-d-production').val();
1129            fields.companyProfile = $('.hcc-d-cp').val();
1130            fields.emailtoClient = $('.hcc-d-mailToClient').val();
1131            fields.phonetoClient = $('.hcc-d-phoneToClient').val();
1132            fields.companyAddress = $('.hcc-d-addresProduction').val();
1133            fields.website = $('.hcc-d-website').val();
1134            fields.package=1;
1135            fields.ref=QueryString.ref?QueryString.ref:null
1136
1137
1138
1139            return fields;
1140        }
1141
1142        $('.hcc-bt-send').click(function () {
1143
1144            var fields = package_update_fildes();
1145
1146            var $this = $(this);
1147            if($this.hasClass('bt-rotate') || $this.text()!='המשך')
1148                return;
1149            $('.hcc-details-required').removeClass('notify')
1150            if (contact_validation('first', fields.fname, true) != 'ok')
1151                return;
1152            if (contact_validation('last', fields.lname, true) != 'ok')
1153                return;
1154            if (contact_validation('email', fields.email, true) != 'ok')
1155                return;
1156            if (contact_validation('phone', fields.phone, true) != 'ok')
1157                return;
1158            if (contact_validation('size_event', fields.size_event, true) != 'ok')
1159                return;
1160            if (contact_validation('tz', fields.tz, true) != 'ok')
1161                return;
1162
1163            // if (!(fields.phonetoClient).match(/\S+@\S+\.\S+/) && (fields.phonetoClient !== "")) {
1164            //     $('.hcc-d-mailToClient').parent().addClass('notify');
1165            //     return;
1166            // }
1167            if(true){
1168                $('.homepage-concat').append('<div class="term"><div class="term-container"><div class="term-close close"></div><div class="_arrow term-prev"></div><div class="term-title">צרו דף מכירה <br><label>תקנון</label></div><div class="term-content _scroll"></div><div class="term-content-btn">מאשר תקנון</div></div></div>')
1169                $('.term-content-btn').addClass('show')
1170                $('.term-content').scroll(function () {
1171                        if (Math.round($('.term-content').get(0).scrollHeight - $('.term-content').get(0).clientHeight) <= Math.round($('.term-content').scrollTop() + 10))
1172                            $('.term-content-btn').addClass('show')
1173
1174                });
1175                $('.term-close').click(function () {
1176                    $('.homepage-concat-close-bt').click();
1177                });
1178                $('.term-prev').click(function (e) {
1179                    $('.homepage-concat .term').remove();
1180                    e.stopImmediatePropagation();
1181                });
1182                $(".term-content").load("/terms.html");
1183                $('.term-content-btn').click(function (e) {
1184                    if(!$(this).hasClass('show')){
1185                        alert('יש לקרוא את התקנון כדי לאשרו');
1186                        return;
1187                    }
1188                    e.stopImmediatePropagation();
1189
1190                    $('.homepage-concat .term').remove();
1191                    rotate_bt();
1192                    $this.addClass('bt-rotate');
1193                    $.post('/ajax/homepage/check_has_package',{'email':fields.email},function (data) {
1194                        $this.removeClass('bt-rotate');
1195                        loading_rotate_anim.stop();
1196                        $this.removeAttr('style');
1197                        if(data.result=='ok'){
1198                            if(data.has_package){
1199                                $('.homepage-concat').append('<div class="conflict"><div class="conflict-container"><div class="conflict-close close"></div><div class="_arrow conflict-prev"></div><div class="conflict-title">צרו דף מכירה <br><label>מפיק האירוע</label></div><div class="conflict-content _box">שובבים!<br> יש לכם כבר חבילה אצלינו, האם תרצו להקים חבילה חדשה או להמשיך עם החבילה הקיימת?</div><div class="conflict-btn"><div class="conflict-btn-new">חבילה חדשה</div><div class="conflict-btn-prev">תודה שהזכרתם!</div></div></div></div>');
1200                                $('.homepage-concat .conflict-close').click(function () {
1201                                    $('.homepage-concat-close-bt').click();
1202                                });
1203                                $('.conflict-prev').click(function (e) {
1204                                    e.stopImmediatePropagation();
1205                                    $('.homepage-concat .conflict').remove();
1206                                });
1207                                $('.conflict-btn-new').click(function () {
1208                                    $.post('/ajax/homepage/valid_new_package', {'email':fields.email}, function (data) {
1209                                        if(data.result == "ok"){
1210                                            $('.homepage-concat .conflict,.homepage-concat .term').remove();
1211                                            post_contact("הצטרף חדש");
1212                                        }
1213                                        else {
1214                                            var fields = package_update_fildes();
1215                                            fields.link=''
1216                                            fields.message="הלקוח ניסה לרשום חבילה נוספת מעל 3 חבילות.";
1217                                            $.post('/ajax/homepage/post_new_lead', fields, function (data) {
1218                                            });
1219                                            alert("אין אפשרות לפתוח יותר מ-3 חבילות. נציגינו יחזרו אליך בימים הקרובים.");
1220                                        }
1221                                    })
1222                                });
1223                                $('.conflict-btn-prev').click(function () {
1224                                    $('.homepage-concat .conflict').remove();
1225                                    $('.homepage-concat-close-bt').click();
1226                                    window.open("https://"+data.link);
1227
1228                                });
1229                            }
1230                            else{
1231                                post_contact("מתעניין חדש");
1232                            }
1233
1234                        }
1235
1236                    });
1237                   
1238                    function post_contact(join) {
1239                        rotate_bt();
1240                        $this.addClass('bt-rotate');
1241                        $.post('/ajax/homepage/post_contact', fields, function (data) {
1242                            if (data.result == 'ok') {
1243                                // var join="הצטרף חדש"
1244                                fields.status=join;
1245                                fields.link=data.pid;
1246                                $.post('/ajax/homepage/post_new_lead', fields, function (data) {
1247                                })
1248                                var array_url = window.location.href;
1249                                var q_string_index = array_url.indexOf('?');
1250                                var q_string = '';
1251                                if (q_string_index !== -1) {
1252                                    q_string = array_url.slice(q_string_index, array_url.length);
1253                                    array_url = array_url.slice(0, q_string_index);
1254                                }
1255                                window.history.pushState({ url: window.location.href },'','/thankyou1/'+q_string)
1256                                $('head').append('<script>gtag(\'event\', \'conversion\', {\'send_to\': \'AW-770209806/KZVMCJn-3MIBEI7woe8C\'})</script>');
1257                                $('head').append('<script>fbq(\'track\', \'StartTrial\');</script>');
1258                                $('.homepage-concat').append('<div class="joining"><div class="joining-container "><div class="joining-close close"></div><div class="joining-title">צרו דף מכירה <br><label>מפיק האירוע</label></div><div class="joining-content"></div><div class="joining-content-img"></div></div></div>');
1259                                $('.joining-content').html('<div>ואאו!</div>אתם הבעלים של חבילת '+fields.fname+' '+fields.lname+'<br> ממש עכשיו קבלתם מייל לסיום התהליך ולכניסה למערכת. בהצלחה!' +
1260                                    '<br><div class="bt joining-btn-resend">לא קיבלתי, שלח פרטים מחדש!</div><div class="bt joining-btn-thanks">תודה</div>');
1261                                $('.joining-close').click(function () {
1262                                    $('.homepage-concat .joining').remove();
1263                                    $('.homepage-concat-close-bt').click();
1264                                });
1265
1266                                // $this.html('הטופס נשלח בהצלחה, נשוב אליכם בהקדם').css({
1267                                //     'pointer-events': 'none',
1268                                //     'cursor': 'default'
1269                                // });
1270                                if (typeof ga === 'function')
1271                                    ga('tickchak_global.send', 'event', 'research', 'create_event_send');
1272                                // setTimeout(function () {
1273                                //     $('.homepage').removeClass('display');
1274                                //     $('.homepage-concat .joining').remove();
1275                                //     $this.html('המשך').removeAttr('style');
1276                                //     $('.hcc-details input').val('');
1277                                //
1278                                //
1279                                // }, 10000)
1280                                $('.joining-content .joining-btn-resend').click(function (e) {
1281                                    $('.homepage-concat .joining').remove();
1282                                    $('.homepage').addClass('display');
1283
1284                                    e.stopImmediatePropagation();
1285
1286                                });
1287                                $('.joining-content .joining-btn-thanks').click(function () {
1288                                    $('.homepage-concat .joining').remove();
1289                                    $('.homepage-concat-close-bt').click();
1290                                });
1291
1292
1293                            }
1294                            else {
1295                                console.log(data);
1296                                $this.text('מצטערים, אירעה שגיאה.');
1297                            }
1298                            $this.attr('style', "");
1299                            $this.removeClass('bt-rotate');
1300                            loading_rotate_anim.stop();
1301                            $('.hcc-bt-send').removeClass('bt-rotate')
1302
1303                        }, 'json')
1304
1305                    }
1306                });
1307            }
1308            else{
1309                rotate_bt();
1310                $this.addClass('bt-rotate');
1311                $.post('/ajax/homepage/post_contact', fields, function (data) {
1312                    if (data.result == 'ok') {
1313
1314                        $this.html('הטופס נשלח בהצלחה, נשוב אליכם בהקדם').css({
1315                            'pointer-events': 'none',
1316                            'cursor': 'default'
1317                        });
1318
1319                        if (typeof ga === 'function')
1320                            ga('tickchak_global.send', 'event', 'research', 'create_event_send');
1321                        setTimeout(function () {
1322                            $('.homepage').removeClass('display');
1323                            $this.html('המשך').removeAttr('style');
1324                            $('.hcc-details input').val('');
1325                        }, 4000)
1326                    }
1327                    else {
1328                        console.log(data);
1329                        $this.text('מצטערים, אירעה שגיאה.');
1330                    }
1331                    $this.attr('style', "");
1332                    $this.removeClass('bt-rotate');
1333                    loading_rotate_anim.stop();
1334                    $('.hcc-bt-send').removeClass('bt-rotate')
1335                }, 'json')
1336                fields.link=''
1337            $.post('/ajax/homepage/post_new_lead', fields, function (data) {
1338            })
1339        }
1340
1341
1342        });
1343        var transform_styles = ['-webkit-transform', '-ms-transform', '-moz-transform', '-o-transform', 'transform'];
1344        var loading_rotate_anim;
1345
1346        function rotate_bt() {
1347            loading_rotate_anim = $({t: 0}).animate({t: 1}, {
1348                duration: 600,
1349                easing: 'linear',
1350                step: function (now) {
1351                    rotate($('.bt.bt-rotate'), now * 360);
1352                },
1353                complete: function () {
1354                    rotate_bt();
1355                }
1356            });
1357        }
1358
1359        
1360        function rotate(elem, deg) {
1361            for (i in transform_styles) {
1362                $(elem).css(transform_styles[i], 'rotate(' + deg + 'deg)');
1363            }
1364        }
1365
1366
1367        setTimeout(function(){
1368            if(QueryString.open_reg){
1369                if (typeof ga === 'function')
1370                    ga('tickchak_global.send', 'event', 'research', 'create_event_email_link');
1371                createEvent();
1372            }
1373        },100);
1374
1375      handlePortalIframe( $('.portal,.portal-mobile'));
1376})
1377
1378
1379$(document).on('click','.prevent-link',function(e){
1380    e.preventDefault();
1381});
1382
1383/*$(document).ready(function(){
1384    var ti;
1385    if(QueryString.open_reg){
1386        ti=setInterval(function(){
1387            var s=$('.orslider-container').get(0).swiper;
1388            if(!s) return;
1389            s.removeSlide(8);
1390            s.removeSlide(5);
1391            s.removeSlide(4);
1392            clearInterval(ti);
1393        },50)
1394    }
1395});*/
1396window.addEventListener('message', function (message){
1397    if (message.origin === tickchak_app_domain) {
1398        var msg = message.data;
1399        if (msg && msg.buttonClick ) {
1400            switch(msg.buttonClick){
1401                case 'signUp':
1402                    if(!$('body').find('.signUpIframe').hasClass('show')){
1403                        signUp=true
1404                        break;
1405                    }
1406                    $('body').find('.signUpIframe').removeClass('show');
1407                    window.open(tickchak_app_domain, '_blank')
1408                    break;
1409                case 'close':
1410                    $('body').find('.signUpIframe').removeClass('show');
1411                    break;
1412            }
1413
1414        }
1415    }
1416});
1417

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.