PageSourceSearch

https://www.alljobs.co.il/JavaScript/Users/Site/VipBox-Services.js?ver=08_10_2025_013859

js alljobs.co.il collected 2026-09-24 09:46:13 UTC 55,518 bytes, 1,061 lines download raw bytes

1
2///
3/// vip box services
4///
5
6var VipBoxServices = (function () {    
7
8    //Globals
9    var UserData = [];
10    var Regions = [];
11    var BindVipClickButton_Interval = null;
12    var RecommendedJobsLoder_Interval = null;
13    var tabName = "";
14  
15    // open popup registration
16    function OpenRegistration(TabName) {
17        //showLoginFrame();
18        window.showAuthFrame();
19        return;
20        /******************************************************/
21        //Bind Click -- > Open Singin / Register PopUp Iframe
22        /******************************************************/      
23        //$.colorbox({
24        //    transition: "fade",
25        //    speed: 350,
26        //    iframe: true,
27        //    fastIframe: false,
28        //    scrolling: false,
29        //    href: "/SignIn/?SignInPointID=4&P=" + top.location.href.replace(/&/gi, "%26") + "%26tab=" + TabName,
30        //    initialWidth: "400px",
31        //    width: "450px",
32        //    opacity: 0.5,
33        //    overlayClose: false,
34        //    fixed: false,//set as absolute positioning 
35        //    onLoad: function () {
36        //        //set popup css
37        //        $('body').append('<style id="VipRegiserBoxCss" type="text/css">' +
38        //                         '#cboxLoadedContent{border:none !important}' +
39        //                         '#cboxClose{width:13px;height:15px;background:url(/images/LandingPage_B/FrameSignUp/Close.jpg) no-repeat;position:absolute;top:10px;left:20px;right:auto;cursor:pointer;text-indent:-9999px}' +
40        //                         '#cboxLoadingOverlay{display:none !important;}' +
41        //                         '#cboxLoadingGraphic{display:none !important;}' +
42        //                         '</style>'
43        //                     );
44        //    },
45        //    onOpen: function () {                
46        //        $("#colorbox").hide();
47        //        $('#cboxClose').css({ width: 0 + 'px' });
48        //    },
49        //    onComplete: function () {                
50        //        /*********************************************************/
51        //        //set fucos on iframe elment for the fire submit function
52        //        /*********************************************************/
53
54        //        var ColorBoxFrame = $("#cboxLoadedContent > iframe");
55
56        //        if (ColorBoxFrame != undefined) {
57        //            $(ColorBoxFrame).load(function () {
58        //                $(ColorBoxFrame).focus();
59        //                $(ColorBoxFrame).contents().find("body").focus();
60        //                $(ColorBoxFrame).contents().find("#body-container").css('width', '85%');
61        //                parent.$('iframe.cboxIframe').height($(ColorBoxFrame).contents().find("body").height() + 15);//set iframe new height
62        //                if ($(ColorBoxFrame).contents().find("div#link-text-box").attr("class") == "link-log-in")
63        //                    $(this).colorbox.resize();//resize the color box size                   
64        //            });                    
65        //        }
66        //        /*****/
67        //        //END
68        //        /*****/
69
70        //        setTimeout(function () {
71        //            $('#cboxClose').css({ width: 13 + 'px' });
72        //        }, 350);
73        //    },
74        //    onClosed: function () {
75        //        $('#VipRegiserBoxCss').remove();
76        //    }
77        //});
78        /*****/
79        //END
80        /*****/
81    }
82
83    // set regions
84    function SetRegionsData()
85    {
86        try {
87            $.ajax({
88                type: 'GET',
89                url: '/SearchResultsMobile.ashx',
90                dataType: "json",
91                async: false,
92                cache: true,
93                data: {
94                    action: "getSearchEngineData",
95                    categories: false,
96                    regions: true,
97                    types: false
98                },
99                success: function (response) {                                     
100                    for (var i = 0; i < response.Regions.length; i++) { // for each region
101                        for (var j = 0; j < response.Regions[i].Cities.length; j++) { // for each city
102                            if (response.Regions[i].Cities[j].Name.indexOf("`") || response.Regions[i].Cities[j].Name.indexOf("``")) {  // if city name contains special charcters                    
103                                if (response.Regions[i].Cities[j].Name.indexOf("``")) {
104                                    var regex = new RegExp('``', 'g');
105                                    response.Regions[i].Cities[j].Name = response.Regions[i].Cities[j].Name.replace(regex, '"');
106                                }
107                                if (response.Regions[i].Cities[j].Name.indexOf("`")) {
108                                    var regex = new RegExp('`', 'g');
109                                    response.Regions[i].Cities[j].Name = response.Regions[i].Cities[j].Name.replace(regex, "'");
110                                }
111                            }
112                        }
113                    }
114
115                    Regions = response.Regions;                    
116                },
117                error: function (request, status, error) {                    
118                }
119            });
120        } catch (err) {            
121        }
122    }
123
124    //set loder
125    function SetPopUPLoder(action) {
126        switch (action.toLowerCase()) {
127            case 'on': { $('#popup-container >div.popup-overlay').show(); $('#popup-container >div.popup-loder').show(); break; }
128            case 'off': { $('#popup-container >div.popup-overlay').hide(); $('#popup-container >div.popup-loder').hide(); break; }
129            default: { break; }
130        }
131    }
132
133    // get regions
134    function GetRegionsData() {
135        return Regions;
136    }
137
138    // get vip box user data
139    function GetUserData() {
140        try {
141            //get user data
142            $.ajax({
143                type: 'GET',
144                url: '/User/WS/VipBox.ashx',
145                async: false,
146                cache: false,
147                dataType: "json",
148                data: {
149                    Method: "GetUserData"
150                },
151                success: function (_response) {                    
152                    UserData = _response;                    
153                },
154                error: function (err) {
155                    //error
156                }
157            });
158        }
159        catch (e) {
160           //error
161        }
162    }
163
164    // Close Vip Box Pop UP
165    function ClosePopUP() {        
166        $('#popup-container').stop(true, false).animate({ opacity: 0 }, 100, function () {
167            $(this).hide();
168        });
169        $('#vip-box-container > div.arrow-right').stop(true, false).animate({ opacity: 0 }, 100, function () {
170            $(this).hide();
171        });
172        tabName = "";
173
174        if ($('div#map-popup-container').length > 0 && $('div#map-popup-container').is(':visible'))
175            //remove map details popup
176            $('div#map-popup-container').remove();
177    }
178
179    // get templet html content
180    //<param index='1' name='Object.TabName'>what tab was pressed by user</param>
181    //<param index='1' name='Object.MouseEnter'>is called from mouseenter action</param>    
182    function GetTemplet(Object) {
183        try {
184            //set control agent back to hidden container if exsits
185            if ($('div#agent-controls-container > div.agent > div#UserControlContainer').length == 0) {
186                $('div#agent-controls-container > div.agent').append($('div.agent > div#UserControlContainer'));
187            }
188
189            //set control region back to hidden container if exsits
190            if ($('div#agent-controls-container > div.region > div#UserControlContainer').length == 0) {
191                $('div#agent-controls-container > div.region').append($('div.region > div#UserControlContainer'));
192            }
193
194
195            //set templet in the popup for each tab
196            switch (Object.TabName) {
197                case 'recommended_jobs_container': {
198
199                    //if tab is all ready open don't run the same code again
200                    if (tabName == Object.TabName && tabName != "")
201                        return;
202
203                    tabName = Object.TabName;
204
205                    //if user has one or more than one normal cv file and can enter the vip recommended jobs tool than don't open upload cv file popup
206                    if (VipBoxServices.GetIsUserHasCvFile() && (VipBoxServices.GetIsRecommendedJobsEnterGranted() || VipBoxServices.GetIsPaying())) {
207                        //close popup
208                        ClosePopUP();
209
210                        //open vip tool 
211                        if (!Object.MouseEnter)//only if clicked on tab
212                            OpenVipTool(Object.TabName);
213                    } else {
214                        //display the white arrow
215                        $('#vip-box-container > div.arrow-right').show().stop(true, false).animate({ opacity: 1 }, 0);
216
217                        //insert templet html content into the popup
218                        var ContentElment = (VipBoxServices.GetIsRecommendedJobsEnterGranted()) ? $('#recommended-jobs-templet') : $('#only-for-vip-templet');
219
220                        if ($('#popup-container').is(":visible")) {
221
222                            //delete all html content
223                            $('#popup-container > div.popup-inner-container > div.popup-content-container').html('');
224
225                            //set new width and height
226                            $('#popup-container').animate({ opacity: 1, width: $(ContentElment).outerWidth(true) + 'px', height: $(ContentElment).outerHeight(true) + 'px' }, 100, function () {
227                                //set popup width and height to html content                                
228                                $('#popup-container > div.popup-inner-container > div.popup-content-container').html($(ContentElment).html());                               
229                            });
230                        }
231                        else {
232                            //set new width and height
233                            $('#popup-container').show().animate({ opacity: 1, width: $(ContentElment).outerWidth(true) + 'px', height: $(ContentElment).outerHeight(true) + 'px' }, 0, function () {
234                                //set popup width and height to html content                    
235                                $('#popup-container > div.popup-inner-container > div.popup-content-container').html('').html($(ContentElment).html());
236                            });
237                        }
238
239                        //create interval for bind on mouseover event
240                        BindVipClickButton__Interval = setInterval(function () {
241                            if ($('#popup-container > div.popup-inner-container > div.popup-content-container > div > div > div.VipBoxPurchaseButton').length > 0) {
242                                //bind vip click button event
243                                $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div > div.VipBoxPurchaseButton').unbind("click").bind("click", function () {
244                                    top.location.href = '/User/Register/CreditCard.aspx?CameFrom=VipBox_recommended_jobs';
245                                });
246
247                                //clear Interval
248                                clearInterval(BindVipClickButton__Interval);
249                            }
250                        }, 100);
251                    }
252
253                    break;
254                }
255                case 'jobs_on_map_container': {
256                    
257                    //remove this popup if exsits
258                    if ($('div#map-popup-container').length > 0){
259                        $('div#map-popup-container').remove();
260
261                        //change button's ui
262                        $('div.JobsOnMap_Container > div.MapDisplayButton').css({ 'background': 'url("/images/JobsOnMap/ButtonMap_Grey.jpg") no-repeat' });
263                        $('div.JobsOnMap_Container > div.listDisplayButton').css({ 'background': 'url("/images/JobsOnMap/ButtonList_Orange.jpg") no-repeat' });
264                    }
265
266                    //if tab is all ready open don't run the same code again
267                    if (tabName == Object.TabName)
268                        return;
269
270                    tabName = Object.TabName;
271
272                    //if user dont have city id then open update city id 
273                    if (
274                         (typeof searchEngine != "undefined" && VipBoxServices.GetUserCityID() == -1)//case searchEngin object exsits and user city id is empty
275                         ||
276                         (typeof searchEngine != "undefined" && searchEngine.getUrlParameters().position == "" && jobAppCategories.getCategoriesList() == "")//case searchEngin object exsits and user city id is empty
277                         ||
278                         (typeof searchEngine == "undefined" && (VipBoxServices.GetUserCityID() == -1 || VipBoxServices.GetUserAgentCategories() == "" || VipBoxServices.GetUserAgentRegions() == ""))//case searchEngin object don't exsits and user city id is empty and user has no agent at all
279                       )
280                    {
281                        //parmeters is agent/region/city is visable
282                        var city = false;
283                        var agent = false;
284                        var region = false;
285
286                        //hide or show city update field                        
287                        if (VipBoxServices.GetUserCityID() != -1) {
288                            $('#Jobs-on-map-templet > div > div.city').hide();
289                        }
290                        else {
291                            $('#Jobs-on-map-templet > div > div.city').show();
292                            city = true;
293                        }
294
295                        //display the white arrow
296                        $('#vip-box-container > div.arrow-right').show().stop(true, false).animate({ opacity: 1 }, 0);
297
298                        //display agent dropdownlist only for uploadsingle.aspx
299                        if (typeof searchEngine != "undefined") {
300                            if (searchEngine.getUrlParameters().position == "") {
301                                $('#Jobs-on-map-templet > div > div.agent').show();
302                                agent = true;
303                            }
304                            else {
305                                $('#Jobs-on-map-templet > div > div.agent').hide();                                
306                            }                            
307                            $('#Jobs-on-map-templet > div > div.region').hide();
308                        }
309                        else {
310
311                            if (VipBoxServices.GetUserAgentCategories() == ""){
312                                $('#Jobs-on-map-templet > div > div.agent').show();
313                                agent = true;
314                            }
315                            else {
316                                $('#Jobs-on-map-templet > div > div.agent').hide();
317                            }
318
319                            if (VipBoxServices.GetUserAgentRegions() == ""){
320                                $('#Jobs-on-map-templet > div > div.region').show();
321                                region = true
322                            }                                
323                            else {
324                                $('#Jobs-on-map-templet > div > div.region').hide();
325                            }                                
326                        }                                                                        
327
328                        //set agent/region/city margin css
329                        if (agent && region && (!city)) {
330                            $('#Jobs-on-map-templet > div > div.region').css({ 'margin': '0px 0px 0px 0px' });
331                        }
332                        else if ((!city) && (!region)) {
333                            $('#Jobs-on-map-templet > div > div.agent').css({ 'margin': '0px 0px 0px 0px' });
334                        }
335
336                        //insert templet html content into the popup
337                        var ContentElment = $('#Jobs-on-map-templet');                                                                                              
338
339                        if ($('#popup-container').is(":visible")) {
340
341                            //delete all html content
342                            $('#popup-container > div.popup-inner-container > div.popup-content-container').html('')                            
343
344                            //set new width and height
345                            $('#popup-container').animate({ opacity: 1, width: $(ContentElment).outerWidth(true) + 'px', height: $(ContentElment).outerHeight(true) + 'px' }, 100, function () {                                
346
347                                //set popup width and height to html content                    
348                                $('#popup-container > div.popup-inner-container > div.popup-content-container').html($(ContentElment).html());
349                                                                
350                                //user have to create agent
351                                if ((VipBoxServices.GetUserAgentCategories() == "" || VipB
351oxServices.GetUserAgentRegions() == "") && (typeof searchEngine == "undefined")) {
352                                    //add region agent control to heml templet
353                                    $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.agent').append($("div.agent > div#UserControlContainer"));
354                                    //add region region control to heml templet
355                                    $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.region').append($("div.region > div#UserControlContainer"));
356                                }
357                                else {
358
359                                    if ((typeof searchEngine != "undefined") && searchEngine.getUrlParameters().position == "") {
360                                        //add region agent control to heml templet
361                                        $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.agent').append($("div.agent > div#UserControlContainer"));
362                                    }
363                                    else {
364                                        $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.agent').hide();
365                                    }
366                                    $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.region').hide();
367
368                                }
369                            });
370                        }
371                        else {
372
373                            //set new width and height                            
374                            $('#popup-container').show().animate({ opacity: 1, width: $(ContentElment).outerWidth(true) + 'px', height: $(ContentElment).outerHeight(true) + 'px' }, 0, function () {
375                                
376                                //set popup width and height to html content                    
377                                $('#popup-container > div.popup-inner-container > div.popup-content-container').html('').html($(ContentElment).html());
378
379                                //user have to create agent
380                                if ((VipBoxServices.GetUserAgentCategories() == "" || VipBoxServices.GetUserAgentRegions() == "") && (typeof searchEngine == "undefined")) {
381                                    //add region agent control to heml templet
382                                    $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.agent').append($("div.agent > div#UserControlContainer"));
383                                    //add region region control to heml templet
384                                    $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.region').append($("div.region > div#UserControlContainer"));
385                                }
386                                else {
387
388                                    if ((typeof searchEngine != "undefined") && searchEngine.getUrlParameters().position == "") {
389                                        //add region agent control to heml templet
390                                        $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.agent').append($("div.agent > div#UserControlContainer"));
391                                    }
392                                    else {
393                                        $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.agent').hide();
394                                    }
395                                    $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.region').hide();
396                                }
397                            });
398                        }                        
399                    }
400                    else {
401                        //close popup
402                        ClosePopUP();
403                       
404                        if (!Object.MouseEnter)//only if clicked on tab
405                            //open the map
406                            OpenVipTool(Object.TabName);
407                    }
408
409                    //open ticke on each user action after clicked on map tab
410                    if (agent && city) { $('div.subheader').html("נשאר לך להשלים רק עוד שני פרטים:"); VipBoxServices.OpenTicketUserPressOnTab("displayed_complete_area_and_location"); }
411                    else if (city) { $('div.subheader').html("נשאר לך להשלים רק עוד פרט אחד:"); VipBoxServices.OpenTicketUserPressOnTab("displayed_complete_location"); }
412                    else if (agent) { $('div.subheader').html("נשאר לך להשלים רק עוד פרט אחד:"); VipBoxServices.OpenTicketUserPressOnTab("displayed_complete_area"); }
413
414                    break;
415                }
416                case 'jobs_from_social_networks_container': {
417
418                    //if tab is all ready open don't run the same code again
419                    if (tabName == Object.TabName)
420                        return;
421
422                    tabName = Object.TabName;
423
424                    if (VipBoxServices.GetIsPaying()) {//is vip user
425
426                        //close popup
427                        ClosePopUP();
428
429                        if (!Object.MouseEnter)//only if clicked on tab
430                            //open cv check panel
431                            OpenVipTool(Object.TabName);
432                    }
433                    else {
434                        //display the white arrow
435                        $('#vip-box-container > div.arrow-right').show().stop(true, false).animate({ opacity: 1 }, 0);
436
437                        //insert templet html content into the popup
438                        var ContentElment = $('#only-for-vip-templet');
439
440                        if ($('#popup-container').is(":visible")) {
441
442                            //delete all html content
443                            $('#popup-container > div.popup-inner-container > div.popup-content-container').html('');
444
445                            //set new width and height
446                            $('#popup-container').animate({ opacity: 1, width: $(ContentElment).outerWidth(true) + 'px', height: $(ContentElment).outerHeight(true) + 'px' }, 100, function () {
447                                //set popup width and height to html content                    
448                                $('#popup-container > div.popup-inner-container > div.popup-content-container').html($(ContentElment).html());
449                            });
450                        }
451                        else {
452                            //set new width and height
453                            $('#popup-container').show().animate({ opacity: 1, width: $(ContentElment).outerWidth(true) + 'px', height: $(ContentElment).outerHeight(true) + 'px' }, 0, function () {
454                                //set popup width and height to html content                    
455                                $('#popup-container > div.popup-inner-container > div.popup-content-container').html('').html($(ContentElment).html());
456                            });
457                        }
458
459                        //create interval for bind on mouseover event
460                        BindVipClickButton__Interval = setInterval(function () {
461                            if ($('#popup-container > div.popup-inner-container > div.popup-content-container > div > div > div.VipBoxPurchaseButton').length > 0) {
462                                //bind vip click button event
463                                $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div > div.VipBoxPurchaseButton').unbind("click").bind("click", function () {
464                                    top.location.href = '/User/Register/CreditCard.aspx?CameFrom=VipBox_social_networks';
465                                });
466
467                                //clear Interval
468                                clearInterval(BindVipClickButton__Interval);
469                            }
470                        }, 100);                       
471                    }                    
472
473                    break;
474                }              
475                case 'reviewing_resumes_container': {
476
477                    //if tab is all ready open don't run the same code again
478                    if (tabName == Object.TabName)
479                        return;
480
481                    tabName = Object.TabName;
482
483                    if (VipBoxServices.GetIsPaying()) {//is vip user
484
485                        //close popup
486                        ClosePopUP();
487
488                        if (!Object.MouseEnter)//only if clicked on tab
489                            //open cv check panel
490                            OpenVipTool(Object.TabName);
491                    }
492                    else {
493                        //display the white arrow
494                        $('#vip-box-container > div.arrow-right').show().stop(true, false).animate({ opacity: 1 }, 0);
495
496                        //insert templet html content into the popup
497                        var ContentElment = $('#only-for-vip-templet');                        
498
499                        if ($('#popup-container').is(":visible")) {
500                            //delete all html content
501                            $('#popup-container > div.popup-inner-container > div.popup-content-container').html('');
502
503                            //set new width and height
504                            $('#popup-container').animate({ opacity: 1, width: $(ContentElment).outerWidth(true) + 'px', height: $(ContentElment).outerHeight(true) + 'px' }, 100, function () {                                
505                                //set popup width and height to html content                    
506                                $('#popup-container > div.popup-inner-container > div.popup-content-container').html($(ContentElment).html());
507                            });
508
509
510                        }
511                        else {
512                            //set new width and height
513                            $('#popup-container').show().animate({ opacity: 1, width: $(ContentElment).outerWidth(true) + 'px', height: $(ContentElment).outerHeight(true) + 'px' }, 0, function () {
514                                //set popup width and height to html content                    
515                                $('#popup-container > div.popup-inner-container > div.popup-content-container').html('').html($(ContentElment).html());
516                            });
517                        }                        
518
519                        //create interval for bind on mouseover event
520                        BindVipClickButton__Interval = setInterval(function () {
521                            if ($('#popup-container > div.popup-inner-container > div.popup-content-container > div > div > div.VipBoxPurchaseButton').length > 0) {
522                                //bind vip click button event
523                                $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div > div.VipBoxPurchaseButton').unbind("click").bind("click", function () {
524                                    top.location.href = '/User/Register/CreditCard.aspx?CameFrom=VipBox_reviewing_resumes';
525                                });
526
527                                //clear Interval
528                                clearInterval(BindVipClickButton__Interval);
529                            }
530                        }, 100);
531
532                       
533                    }                    
534
535                    break;
536                }
537                //case 'online_map_container': {
538                //    //close popup
539                //    ClosePopUP();
540
541                //    if (!Object.MouseEnter)//only if clicked on tab
542                //        //open cv check panel
543                //        OpenVipTool(Object.TabName);
544                //    break;
545                //}
546                case 'join_Vip_container': {
547                    //only for not vip users
548                    if (!VipBoxServices.GetIsPaying())
549                        OpenVipTool(Object.TabName);
550                }
551                default: {break; }
552            }
553
554        } catch (e) {
555
556        }
557
558    }
559
560    // get tool content
561    //<param index='1' name='TabName'>what tab was pressed by user</param>
562    function OpenVipTool(TabName) {        
563        
564        try {
565            switch (TabName) {
566                case 'recommended_jobs_container': {
567                    
568                    //create overlay DIV elment
569                    var overLay = $("<div id='map-vip-box-overlay'></div>");
570                    //create loder DIV elment
571                    var loder = $("<div id='map-vip-box-loder'></div>")
572
573                    //appen all HTML elment to body
574                    $(top.document.body).append(overLay);
575                    $(top.document.body).append(loder);
576
577                    //check if file exsits
578                    if (typeof RecommandedJobsLoadAndInit == 'undefined')
579                    {
580                        //add javascript file
581                        var js_1 = document.createElement('script');
582                        js_1.type = 'text/javascript';
583                        js_1.id = "jsRecommandedJobsLoadAndInit";
584                        js_1.src = "/JavaScript/Users/Site/RecommandedJobsLoadAndInit.js?ver=" + new Date().getTime();
585                        top.$('head').append(js_1);
586                    }
587
588                    //if sessionguid exists AND this is explorer browser 9 OR upper OR not explorer browser then open the recommend vip tool
589                    if ($('#hdnSessionGuid').val() != '-1' && !($.browser.msie && (navigator.userAgent.indexOf('Trident') == '-1' || navigator.userAgent.indexOf("Trident/4.0") != -1))) {
590                        //open the recommended jobs
591                        RecommandedJobsLoadAndInit('CameFromVipBox');
592                    }
593                    
594                    //set loder remove ehwn recommended jobs init is compleate
595                    RecommendedJobsLoder_Interval = setInterval(function () {
596                        if (top.$("#divRecommandedJobsParentLayout").length > 0) {
597                            //remove lodaer ui
598                            $('#map-vip-box-overlay').remove();
599                            $('#map-vip-box-loder').remove();
600                        }                        
601                    },100);
602
603                    
604
605                    break;
606                }
607                case 'jobs_on_map_container': {                  
608                    
609                    //search parameters for map init by url
610                    var categories = "0";
611                    var regions = "0";
612                    var types = "0";
613                    var sorce = "0";
614                    var duration = "0";
615                    var guid = $("input[name*='hdnSessionGuid']").val();
616                    var PageName = "";
617
618                    //init search parmeters
619                    if (typeof searchEngine != "undefined") {//only where search engine exsits
620                        categories = (searchEngine.getUrlParameters().position != undefined && searchEngine.getUrlParameters().position != "") ? searchEngine.getUrlParameters().position : "0";
621
622                        if (categories == "0")
623                        {
624                            categories = jobAppCategories.getCategoriesList();
625                        }
626
627                        regions = "0";//(searchEngine.getUrlParameters().region != undefined && searchEngine.getUrlParameters().region != "") ? searchEngine.getUrlParameters().region : "0";
628                        types = (searchEngine.getUrlParameters().type != undefined && searchEngine.getUrlParameters().type != "") ? searchEngine.getUrlParameters().type : "0";
629                        sorce = (VipBoxServices.GetUserCityID() != -1) ? VipBoxServices.GetUserCityID() : "0";
630                        duration = (searchEngine.getUrlParameters().duration != undefined && searchEngine.getUrlParameters().duration != "") ? searchEngine.getUrlParameters().duration : "30";
631                        PageName = "SearchResultsGuest";
632
633                    }
634                    else {                        
635                        if (top.location.href.toLowerCase().indexOf('uploadsingle.aspx') != -1) {//get agent if page is uploadsingle.apsx
636                            categories = (VipBoxServices.GetUserAgentCategories() != "") ? VipBoxServices.GetUserAgentCategories() : "0";
637                            regions = "0";//(VipBoxServices.GetUserAgentRegions() != "") ? VipBoxServices.GetUserAgentRegions() : "0";
638                            types = (VipBoxServices.GetUesrAgentTypes() != "") ? VipBoxServices.GetUesrAgentTypes() : "0";
639                            sorce = (VipBoxServices.GetUserCityID() != -1) ? VipBoxServices.GetUserCityID() : "0";
640                            duration = "30";
641                            PageName = "UploadSingle";
642                        }
643                    }                  
644
645                    //create overlay DIV elment
646                    var overLay = $("<div id='map-vip-box-overlay'></div>");
647                    //create loder DIV elment
648                    var loder = $("<div id='map-vip-box-loder'></div>")
649                    //create blocker DIV elment
650                    var blocker = $("<div id='map-vip-box-blocker'></div>");
651                    //create mapFrame IFRAME elment
652                    var mapFrame = $("<iframe id='vip-box-frame' width='875px' height='800px' src='' allowTransparency='true' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameBorder='0' align='middle'></iframe>");                    
653
654                    //appen all HTML elment to body
655                    $(top.document.body).append(overLay);
656                    $(top.document.body).append(loder);
657                    $(blocker).append(mapFrame);
658                    $(top.document.body).append(blocker);
659                   
660                    //set iframe with the map page src url
661                    $('#vip-box-frame').attr("src", "/Search/Maps/index.html?dt=" + new Date().getTime() + "#/map/" + categories + "/" + regions + "/" + types + "/" + sorce + "/" + duration + "/" + guid + "/" + PageName + "?center=32.00")
662
663                    //bind iframe on document ready
664                    $('#vip-box-frame').on("load", function () {
665                        //add animate to frame display
666                        $('#map-vip-box-blocker').stop(true,false).animate({ opacity: 1 }, 1000, function () { });
667                    });
668                    break;
669                }
670                case 'jobs_from_social_networks_container': {
671                    //open jobs social networks
672                    break;
673                }
674                case 'reviewing_resumes_container': {
675                    //open user cv panel
676                    window.open('/User/UserCVsPanel/CVManagement.aspx', '_blank')
677                    break;
678                }
679                //case 'online_map_container': {
680                //    //open user cv panel                    
681                //    window.open('/Partners/MapPyramid/','_blank')                    
682                //    break;
683                //}
684                case 'join_Vip_container': {
685                    //open user cv panel
686                    top.location.href = '/User/Register/CreditCard.aspx?CameFrom=VipBox_Join_Vip';
687                    break;
688                }
689                default: {
690                    break;
691                }
692            }
693        } catch (e) {
694
695        }        
696    }
697
698    // update user city
699    function UpdateUserAgentAndCity() {
700
701        //create deferre object
702        var deferrer = $.Deferred();
703
704        var isOK = true;
705
706        //get user chossen cityID        
707        var CityID = $('#hdn_VipBox_CityID').val() || $('#VipBox1_hdn_VipBox_CityID').val();
708
709        //Valid CityID
710        if (CityID == "-1" && VipBoxServices.GetUserCityID() == -1) {
711            //error msg
712            $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.UpdateErrorMsg , div#map-popup-container > div > div.UpdateErrorMsg').html("<span style='color:#d53721'>לא נבחר מיקום</span>");
713            isOK = false;
714        }
715
716        //get user chosen catefories and regions
717        var ChosenCategories = "";
718        var ChosenRegions = "";
719
720        //get UserData form searchEngine and save it        
721        var Data = null;        
722        if (typeof searchEngine != "undefined") {
723            var Data = searchEngine.getUserData();
724
725            //check if visible == true
726            if ($('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.agent , div#map-popup-container > div > div.agent').is(":visible")) {
727                //check if uesr set position
728                ChosenCategories = jobAppCategories.getCategoriesList();
729                if (ChosenCategories == "") {
730                    isOK = false;
731                    $('#MsgCategories').html('שדה חובה');
732                }
733            }
734        }
735        else {//only for uploadsingle.aspx
736            if (VipBoxServices.GetUserAgentCategories() == "" && VipBoxServices.GetUserAgentCategories() == "") {//only when user don't have user agent at all                
737                ChosenCategories = jobAppCategories.getCategoriesList();
738                ChosenRegions = jobAppRegions.getRegionsList();
739
740                if (ChosenCategories == "") {
741                    isOK = false;
742                    $('#MsgCategories').html('שדה חובה');
743                }
744                
745                if (ChosenRegions == "") {
746                    isOK = false;
747                    $('#MsgRegions').html('שדה חובה');
748                }
749            }
750        }               
751              
752        if (!isOK) {
753            deferrer.resolve(true); // resolve promise
754            return deferrer.promise();            
755        }            
756
757        if (CityID != "-1" || (ChosenCategories != "" && ChosenRegions != "")) {
758            try {
759                //go and update user cityID
760                $.ajax({
761                    type: 'GET',
762                    url: '/User/WS/VipBox.ashx',
763                    dataType: "json",
764                    cache: false,
765                    data: {
766                        Method: "UpdateUserAgentAndCity",
767                        userID: UserID,
768                        cityID: CityID,
769                        agentCategories: ChosenCategories,
770                        regions: ChosenRegions
771                    },
772                    success: function (response) {
773
774                        deferrer.resolve(response); // resolve promise
775
776                        //close popup
777                        ClosePopUP();
778
779                        //change cityID in searchEngine UserData
780                        if (typeof searchEngine != "undefined") {
781                            if (CityID != "-1" && CityID != "")
782                                Data.CityID = CityID;
783
784                            searchEngine.setUserData(Data);
785                        }
786
787                        //set CityId in VipBox UserDate Object
788                        if (CityID != "-1" && CityID != "")
789                            UserData[0].CityID = CityID;
790
791                        //set user categories                                        
792                        if (UserData[0].Agent[0].categories == "" && ChosenCategories != "")
793                            UserData[0].Agent[0].categories = ChosenCategories + ",";
794
795                        //set user categories
796                        if (UserData[0].Agent[0].regions == "" && ChosenRegions != "")
797                            UserData[0].Agent[0].regions = ChosenRegions + ",";
798
799                        //goto vip mapa tool
800                        OpenVipTool('jobs_on_map_container')
801                    },
802                    error: function (request, status, error) {
803                        //error msg
804                        $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.UpdateErrorMsg').html("<span style='color:#d53721'>
804עדכון כתובת מגורים לא עבר בהצלחה</span>");
805                    }
806                });
807            } catch (e) {
808                //error msg
809                $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.UpdateErrorMsg , div#map-popup-container > div > div.UpdateErrorMsg').html("<span style='color:#d53721'>עדכון כתובת מגורים לא עבר בהצלחה</span>");
810            }
811        }
812        else {
813
814            deferrer.resolve(true); // resolve promise
815
816            //close popup
817            ClosePopUP();
818
819            //goto vip mapa tool
820            OpenVipTool('jobs_on_map_container');
821        }
822
823        return deferrer.promise();
824    }
825
826    // upload User Cv File
827    //<param index='1' name='uploadfiles'>the input type=file object</param>
828    function UploadCvFile(uploadfiles) {
829        try {
830
831            //create deferre object
832            var deferrer = $.Deferred();
833
834            if (uploadfiles.files.length > 0)//if file exsits
835            {              
836                //get input cv file name html object
837                var CvFileName = $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div > div > input[name=inp_VipBox_Cv]').val();                
838
839                //set file transfer object
840                var fromdata = new FormData();
841                fromdata.append(CvFileName, uploadfiles.files[0]);
842
843                //set response global function parameter to catch the response from the ajax action
844                var Response = {};
845
846                //upload the cv file to the server
847                try {
848                    $.ajax({
849                        type: 'POST',
850                        url: '/User/WS/VipBox.ashx?Method=UploadCvFile&fileName=' + CvFileName,
851                        contentType: false,
852                        processData: false,
853                        cache: false,
854                        data: fromdata,
855                        success: function (_response) {
856                            //get response and convert it to json object
857                            Response = JSON.parse(_response);                                                        
858
859                            // resolve promise
860                            deferrer.resolve(Response);
861
862                            if (Response.Result == '1') {//upload file action success                                                                
863                                VipBox_UserHasCvFile = true;//set user have at list one cv as true
864                                ClosePopUP();//close open popup
865                                OpenVipTool('recommended_jobs_container');//open vip jobs recommended
866                            }
867                            else {//upload file action failed
868                                //error msg
869                                $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.UploadCvErrorMsg').html('<span style="color:#d53721">' + Response.Message + '</span>');
870                            }
871                        },
872                        error: function (err) {
873                            //error msg
874                            $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.UploadCvErrorMsg').html('<span style="color:#d53721">אירעה שגיאה. קובץ לא נשמר</span>');
875                        }
876                    });
877                } catch (e) {
878                    //error msg
879                    $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.UploadCvErrorMsg').html('<span style="color:#d53721">אירעה שגיאה. קובץ לא נשמר</span>');
880                }                
881            }
882            else {
883                //error msg [no cv file found]
884                $('#popup-container > div.popup-inner-container > div.popup-content-container > div > div.UploadCvErrorMsg').html("<span style='color:#d53721'>אין קובץ להעלות</span>");
885            }
886        }
887        catch (e) {
888            deferrer.resolve(true);
889        }
890
891        return deferrer.promise();
892    }
893
894    // Get Is Paying
895    function GetIsPaying() {
896        return (typeof UserData[0] != "undefined") ? UserData[0].IsPaying : false;
897    }
898
899    // Get City ID
900    function GetUserCityID() {        
901
902        var _CityID = -1;
903
904        if (typeof searchEngine != "undefined") {
905            // get sorce from breadcrumb
906            _CityID = (searchEngine.getSourceCityData().cityID != -1) ? searchEngine.getSourceCityData().cityID : -1;            
907
908            // get sorce from url parmeters
909            if (_CityID == -1) {
910                _CityID = searchEngine.getUrlParameters().source || -1;
911            }
912
913            // get sorce from url user details
914            if (_CityID == -1)
915            {
916                _CityID = (typeof UserData[0] != "undefined") ? UserData[0].CityID : -1;                            
917            }
918        }
919        else {
920            _CityID = (typeof UserData[0] != "undefined") ? UserData[0].CityID : -1;
921        }                
922
923        return _CityID
924    }
925
926    // Get Categories
927    function GetUserAgentCategories() {
928
929        var categories = "";
930        if (typeof searchEngine != "undefined") {
931            //get position from breadcrumb child categories
932            categories = (searchEngine.getChildCategoriesIDs() != "") ? searchEngine.getChildCategoriesIDs() : "";
933
934            if (categories == "")
935                //get position from breadcrumb categories
936                categories = (searchEngine.getParentCategoryID() != "") ? searchEngine.getParentCategoryID() : "";
937
938            if(categories == "")
939                //get position from url parmeters
940                categories = ( searchEngine.getUrlParameters().position != "") ?  searchEngine.getUrlParameters().position : "";
941               
942            if (categories == "")
943                //get position from user details
944                categories = (typeof UserData[0] != "undefined") ? UserData[0].Agent[0].categories.substring(0, UserData[0].Agent[0].categories.length - 1) : "";
945        }
946        else {
947            //get position from user details
948            categories = (typeof UserData[0] != "undefined") ? UserData[0].Agent[0].categories.substring(0, UserData[0].Agent[0].categories.length - 1) : "";
949        }
950
951        return categories;
952    }
953
954    // Get Regions
955    function GetUserAgentRegions() {
956
957        var regions = "";
958        if (typeof searchEngine != "undefined") {
959            //get regions from breadcrumb
960            regions = (searchEngine.getRegionsIDs() != "") ? searchEngine.getRegionsIDs() : "";
961
962            if (regions == "")
963                //get regions from url parmeters
964                regions = (searchEngine.getUrlParameters().region != "") ? searchEngine.getUrlParameters().region : "";
965        }
966        else {
967            //get regions from user details
968            regions = (typeof UserData[0] != "undefined") ? UserData[0].Agent[0].regions.substring(0, UserData[0].Agent[0].regions.length - 1) : "";
969        }
970
971        return regions
972    }
973
974    // Get Types
975    function GetUesrAgentTypes() {
976
977        var types = "";
978        if (typeof searchEngine != "undefined") {
979            //get types from breadcrumb
980            types = (searchEngine.getTypesIDs() != "") ? searchEngine.getTypesIDs() : "";
981
982            //get types from url parmeters
983            if(types == "")
984                types = (searchEngine.getUrlParameters().type != "") ? searchEngine.getUrlParameters().type : "";
985        }
986        else {
987            //get types from user details
988            types = (typeof UserData[0] != "undefined") ? UserData[0].Agent[0].types.substring(0, UserData[0].Agent[0].types.length - 1) : "";
989        }
990
991        return types;
992    }
993
994    // Get The Current Tab Name
995    function GetCurrentTabName() {
996        return tabName;
997    }
998    
999    // Open Ticket User Press On Tab
1000    //<param index='1' name='Open Ticket Reason Name'>what tab was pressed by user</param>
1001    function OpenTicketUserPressOnTab(OpenTicketReason) {
1002
1003        var supportCategoryID = -1;
1004
1005        switch (OpenTicketReason.toLowerCase()) {
1006            case 'clicked_on_map': { supportCategoryID = (top.location.href.toLowerCase().indexOf('uploadsingle.aspx') != -1) ? $('#hdn_ClickedOnMapTabSupportCategoryID_UploadSingle').val() : $('#hdn_ClickedOnMapTabSupportCategoryID_SearchResultsGuest').val(); break; }
1007            case 'displayed_login_blocker': { supportCategoryID = (top.location.href.toLowerCase().indexOf('uploadsingle.aspx') != -1) ? $('#hdn_DisplayedLogInBlocker_UploadSingle').val() : $('#hdn_DisplayedLogInBlocker_SearchResultsGuest').val(); break; }            
1008            case 'displayed_complete_area': { supportCategoryID = (top.location.href.toLowerCase().indexOf('uploadsingle.aspx') != -1) ? $('#hdn_DisplayedCompleteArea_UploadSingle').val() : $('#hdn_DisplayedCompleteArea_SearchResultsGuest').val(); break; }
1009            case 'displayed_complete_location': { supportCategoryID = (top.location.href.toLowerCase().indexOf('uploadsingle.aspx') != -1) ? $('#hdn_DisplayedCompleteLocation_UploadSingle').val() : $('#hdn_DisplayedCompleteLocation_SearchResultsGuest').val(); break; }
1010            case 'displayed_complete_area_and_location': { supportCategoryID = (top.location.href.toLowerCase().indexOf('uploadsingle.aspx') != -1) ? $('#hdn_DisplayedCompleteAreaAndLocation_UploadSingle').val() : $('#hdn_DisplayedCompleteAreaAndLocation_SearchResultsGuest').val(); break; }
1011            default:{supportCategoryID = -1}
1012        }        
1013
1014        if(supportCategoryID == -1)
1015            return;
1016
1017        try {
1018            $.ajax({
1019                type: 'GET',
1020                url: '/User/WS/VipBox.ashx',
1021                dataType: "json",
1022                cache: false,
1023                async: true,
1024                data: {
1025                    Method: "OpenTicketUserPressOnTab",
1026                    SupportCategoryID: supportCategoryID
1027                },
1028                success: function (response) {                    
1029                },
1030                error: function (request, status, error) {
1031                    //error msg                    
1032                }
1033            });
1034        } catch (e) {
1035            //error msg            
1036        }
1037    }
1038
1039    return {
1040        GetTemplet: function () { GetTemplet.apply({}, arguments); },
1041        OpenRegistration: function () { OpenRegistration.apply({}, arguments); },
1042        ClosePopUP: function () { ClosePopUP.apply({}, arguments); },
1043        OpenVipTool: function () { OpenVipTool.apply({}, arguments); },
1044        UpdateUserAgentAndCity: function () {return UpdateUserAgentAndCity.apply({}, arguments); },
1045        UploadCvFile: function () { UploadCvFile.apply({}, arguments); },
1046        SetRegionsData: function () { SetRegionsData.apply({}, arguments); },
1047        SetPopUPLoder: function () { SetPopUPLoder.apply({}, arguments); },
1048        GetRegionsData: function () { return GetRegionsData.apply({}, arguments); },
1049        GetUserData: function () { GetUserData.apply({}, arguments); },
1050        GetIsUserHasCvFile: function () { return UserData[0].UserHasCvFile; },
1051        GetIsUserMapEnterGranted: function () { return UserData[0].UserMapEnterGranted; },
1052        GetIsRecommendedJobsEnterGranted: function () { return UserData[0].RecommendedJobsEnterGranted; },
1053        GetIsPaying: function () { return GetIsPaying.apply({}, arguments); },
1054        GetUserCityID: function () { return GetUserCityID.apply({}, arguments); },
1055        GetUserAgentCategories: function () { return GetUserAgentCategories.apply({}, arguments); },
1056        GetUserAgentRegions: function () { return GetUserAgentRegions.apply({}, arguments); },
1057        GetUesrAgentTypes: function () { return GetUesrAgentTypes.apply({}, arguments); },
1058        GetCurrentTabName: function () { return GetCurrentTabName.apply({}, arguments); },
1059        OpenTicketUserPressOnTab: function () { return OpenTicketUserPressOnTab.apply({}, arguments); }
1060    }
1061})();

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.