PageSourceSearch

https://www.alljobs.co.il/JavaScript/Users/Site/RecommendedJobs.js

js alljobs.co.il collected 2026-10-01 12:04:46 UTC 40,264 bytes, 959 lines download raw bytes

1//Global Params 
2(function(){
3    
4    window.Globals = {};
5    window.Globals.IsPreventActions = '0';
6
7})();
8
9function InitRecommendedJobs(IsUserRecommendedJobs, ShowCv)
10{
11    var deferred = $.Deferred(); // create deferred object
12
13    var step = '1';
14    var stepAjaxSuccess = '1';
15    try
16    {        
17
18        step += ' ,2';
19        // This is The First Init => Get Job's Json by the Params we Got from the Caller (window.ParamActionName, window.ParamCategoryIDs...)
20        $.ajax({
21            url: '/User/RecommendedJobs/RecommendedJobsActions.ashx',
22            data:{
23                'Action': (IsUserRecommendedJobs != 'undefined' && IsUserRecommendedJobs == true)?'':window.ParamActionName,
24                'CategoriesIDs': window.ParamCategoryIDs,
25                'RegionsIDs' : window.ParamRegionIDs,
26                'TypeIDs' : window.ParamTypeIDs,
27                'CityIDs' : window.ParamCityIDs,
28                'Source': window.Source,
29                'Duration': window.Duration,
30                'UserEmail': window.ParamUserEmail,
31                'IsParamsByUserLastAgent': window.ParamIsParamsByUserLastAgent,
32                'CompanyIDs': window.ParamCompanyIDs,
33                'JobsAmount': window.ParamJobsAmount,
34                'RevealedJobsCounter': window.ParamRevealedJobsCounter,
35                'LuceneMinScore': window.ParamLuceneMinScore,
36                'JobsCountToPromote': window.ParamJobsCountToPromote,
37                'SessionGuid': window.SessionGuid,
38                'IsRemoveSentJobs': window.IsRemoveSentJobs,
39                'IsRemoveDeletedJobs': window.IsRemoveDeletedJobs,
40                'CameFromStatus': window.CameFromStatus,
41                'UserCvID': window.UserCvID,
42                'HtmlTemplateName': window.ParamHtmlTemplate,
43                'ShowCv': ShowCv
44            },
45            dataType: 'json',
46            success: function(Res){
47                
48                stepAjaxSuccess += ', 2';
49                Globals.JobsJSON = Res;
50
51                if (window.ParamActionName == 'GetUserRecommendedJobsJson')
52                {
53                    stepAjaxSuccess += ', 3';
54                    try {
55                        var Count = (Globals.JobsJSON.Jobs.length > 20)?20:Globals.JobsJSON.Jobs.length;
56                        top.$('#liRecommendedJobs').val(Count);                                                
57
58                        if (Count == 0) {
59                            $('#divRecommandedJobsParentBlocker').remove();
60                            $('html,body').css('overflow', '');
61                            (top.CloseUserRecommendedJobs || Function)();
62                        }
63                    }
64                    catch (err) { 
65                        top.$('#liRecommendedJobs').val(0);                        
66						$('#divRecommandedJobsParentBlocker').remove();
67						$('html,body').css('overflow', '');
68						(top.CloseUserRecommendedJobs || Function)();
69					}
70
71                }
72
73                stepAjaxSuccess += ', 4';
74                //If String is Empty Or User has no Agents at all(-1)
75                if ($.param(Globals.JobsJSON) == '' || $.param(Globals.JobsJSON) == '-1' || Globals.JobsJSON.Jobs == 'undefined')
76                {
77                    stepAjaxSuccess += ', 5';
78                    if (window.IsRedirectWhenNoResult == '1')
79                        location.href = '/'; // go to HomePage
80
81                    deferred.reject(false);
82                    return deferred.promise();
83                }
84                stepAjaxSuccess += ', 5';
85                
86                //If there is an Error => No Result From Lucene
87                if(Globals.JobsJSON['ErrorGettingJobs_Status'])
88                {
89                    stepAjaxSuccess += ', 7';
90                    if (window.IsRedirectWhenNoResult == '1')
91                    {
92                        stepAjaxSuccess += ', 8';
93                        // if there was no results at all - redirect to search page
94                        if (Globals.JobsJSON['ErrorGettingJobs_Status'].indexOf('SearchResultsGuest') > -1)
95                            location.href = Globals.JobsJSON['ErrorGettingJobs_Status']; // go to Search Result Guest with Search Params
96                        else
97                            location.href = '/'; // No Search Params => go to HomePage
98                    }
99                    stepAjaxSuccess += ', 9';
100
101                    deferred.reject(false);
102                    return deferred.promise();
103                }
104                stepAjaxSuccess += ', 10';
105                
106                //if there are No Result => return
107                if (Globals.JobsJSON.Jobs.length == 0) {
108                    stepAjaxSuccess += ', 11';
109
110                    deferred.reject(false);
111                    return deferred.promise();
112                }
113                   
114                stepAjaxSuccess += ', 12';
115                $.when(
116                    //Json is Valid => Set Template Html by Json's Result
117                    TransformHtmlTemplateWithJson()
118                )
119                .then(function(html){
120                    // passing data to deferred's resolve function on successful completion
121                    deferred.resolve(html);
122
123                    stepAjaxSuccess += ', 13';
124                });
125            },
126            error: function(err)
127            {
128                var date = new Date();
129        
130                //Ajax Exception mail
131                //var Params = 'Page=/JavaScript/Users/Site/RecommendedJobs.js&Error=' + err.message + '&Method=InitRecommendedJobs_GetUserRecommendedJobsJson_OnSuccess&ExtraData=' + "stepAjaxSuccess=" + stepAjaxSuccess + '; HostUrl=' + location.pathname + '&date=' + date;
132		        //$.ajax(
133		        //{
134			    //    type: 'GET',
135			    //    url: '/Components/AjaxMailAlert.ashx',
136			    //    async: false,
137			    //    data: Params,
138			    //    success: function (res) { }
139		        //});
140            }
141
142        });
143
144        step += ' ,3';
145        $('img[id^="JobClose_"]').live('click', function() {
146            
147            var stepJobCloseClick = '1';
148            //If need to stop all Event because Adding Job to "My Job"
149            if (window.Globals.IsPreventActions == '1')
150                return false;
151                
152            stepJobCloseClick += ', 2';
153            // get job ID
154            var JobID = $(this).attr("id").split("_")[1];
155
156	        // date object for ajax
157	        var date = new Date();
158			
159            
160
161            // parameters
162            var params = 'Action=FastRemoveJob&JobID=' + JobID + '&SessionGuid=' + window.SessionGuid + '&CameFromStatus=' + window.CameFromStatus + '&date=' + date.getTime();
163            
164            stepJobCloseClick += ', 3';
165
166            $.ajax({
167                type: 'GET',
168                url: '/User/CvWizard/CVWizardAction.aspx',
169                async: false,
170                data: params,
171                success: function (response) {
172
173                    stepJobCloseClick += ', 4';
174                    // if no session - redirect to home page
175                    if (response == "redirect") {
176
177                        stepJobCloseClick += ', 5';
178                        window.location.replace("/");
179
180                    }
181                    else {
182                        stepJobCloseClick += ', 6';
183
184                        //Set Man As Smile or Sad After Sending CV
185                        SetManFace('0');
186                        stepJobCloseClick += ', 7';
187
188                        // call for animating job & update function
189                        AnimateJobAndUpdateNextRevealed(JobID, "-600px");
190
191                        stepJobCloseClick += ', 8';
192                        try {
193                            parent.RemoveOneJobFromCount();
194                            $('#divRecommandedJobsParentTitle span').html('(' + top.$('#liRecommendedJobs').val() + ')')
195                        }catch(err){}                            
196                    }                    
197                    stepJobCloseClick += ', 9';
198                    
199                },
200                error: function (request, status, error) {
201                    // getting also errors, not exceptions from the ajax call
202                    // can send Page name, Method name, Error and ExrtaData to the server
203                    //var Params = "Page=RecommendedJobs.js&Error=" + status + "," + error + "&Method=FastRemoveJob&ExtraData=" + "JobID=" + JobID + '; HostUrl=' + location.pathname + ' ; stepJobCloseClick=' + stepJobCloseClick + '&date=' + date.getTime();
204                    //$.ajax(
205	        		//	{
206	        		//	    type: 'GET',
207	        		//	    url: '/Components/AjaxMailAlert.ashx',
208	        		//	    async: true,
209	        		//	    data: Params,
210	        		//	    success: function (response) {
211	        		//	    }
212	        		//	});
213                }
214            });
215
216        });
217
218        step += ' ,4';
219        // event for fast CV sending link
220        $('img[id^="JobLink_"]').live('click', function() {
221
222            var stepJobLinkClick = '1';
223            //If need to stop all Event because Adding Job to "My Job"
224            if (window.Globals.IsPreventActions == '1')
225                return false;
226            stepJobLinkClick += ', 2';
227
228            // get job ID
229            var JobID = $(this).attr("id").split("_")[1];          
230
231            // create data object
232            var date = new Date();
233
234            // external link variable
235            var UrlExternalClick = 0;
236
237            //Params For AgentHunter
238            var CategoryIDs = '';
239            var RegionIDs = '';
240            stepJobLinkClick += ', 3';
241
242            // ajax call - send CV & update user jobs
243            try {
244
245
246                // check if there is an external link
247                if ($("#hdnExternalRJ_" + JobID).length > 0) {
248                    
249                    stepJobLinkClick += ', 4';
250                    //// open a tab with the external link
251                    var Tab = window.open($("#hdnExternalRJ_" + JobID).val());
252                    
253                    Tab.focus();
254
255                    // update the variable
256                    UrlExternalClick = 1;
257                }
258
259                //Get Category and Region Value for AgentHunter
260                //We Use try/catch because we do Not want to stop the Process just because of the AgentHunter
261                try
262                {
263                    CategoryIDs = '';
264                    RegionIDs = '';
265                    stepJobLinkClick += ', 5';
266
267                    if (window.Globals.JobsJSON.SearchResultMoreJobsLink != null && window.Globals.JobsJSON.SearchResultMoreJobsLink != '')
268                    {
269                        stepJobLinkClick += ', 6';
270                        //Get the Search Result link in order to get Cateogries and Regions
271                        var SearchResultLink = window.Globals.JobsJSON.SearchResultMoreJobsLink;
272                        CategoryIDs = GetValueFromUrlByParam(SearchResultLink,'position');
273                        RegionIDs = GetValueFromUrlByParam(SearchResultLink,'region');
274                    }
275                }
276                catch(err){}
277
278                // parameters
279                var params = 'Action=FastCVSend&JobID=' + JobID + '&SessionGuid=' + window.SessionGuid + '&CategoryIDs=' + CategoryIDs + '&RegionIDs=' + RegionIDs + '&CameFromStatus=' + window.CameFromStatus + '&date=' + date.getTime() + "&UrlExternalClick=" + UrlExternalClick;
280                stepJobLinkClick += ', 7';
281                $.ajax({
282                    type: 'GET',
283                    url: '/User/CvWizard/CVWizardAction.aspx',
284                    async: false,
285                    data: params,
286                    success: function (response) {
287
288                        stepJobLinkClick += ', 8';
289                        // if no session - redirect to home page
290                        if (response == "redirect")
291                            window.location.replace("/");
292                        stepJobLinkClick += ', 9';
293
294                        // if response true
295                        if (response == "true") {
296                            // report to GTM
297                            try {
298                                dataLayer.push({
299                                    'event': 'formSubmission',
300                                    'formType': 'Send CV'
301                                });
302                            } catch (e) { }
303                            stepJobLinkClick += ', 10';
304
305                            SetManFace('1');
306
307                            // call for animating job & update function
308                            AnimateJobAndUpdateNextRevealed(JobID, "600px");
309
310                            stepJobLinkClick += ', 11';
311                            try {
312                                parent.RemoveOneJobFromCount();
313                                $('#divRecommandedJobsParentTitle span').html('(' + top.$('#liRecommendedJobs').val() + ')');
314                            } catch (err) { }
315                            stepJobLinkClick += ', 12';
316                        }
317                        else {
318                            stepJobLinkClick += ', 13';
319                            // add error message
320                            $("#ErrorSendingMessage_" + JobID).text('אירע שגיאה בעת שליחת קו"ח, אנא נסה שוב...');
321                        }
322                    },
323                    error: function (request, status, error) {
324                        // getting also errors, not exceptions from the ajax call
325                        // can send Page name, Method name, Error and ExrtaData to the server
326                        //var Params = "Page=RecommendedJobs.js&Error=" + status + "," + error + "&Method=FastCVSend&ExtraData=" + "JobID=" + JobID + '; HostUrl:' + location.pathname + ' ; stepJobLinkClick: ' + stepJobLinkClick + '&date=' + date.getTime();
327                        //$.ajax(
328			    		//{
329			    		//    type: 'GET',
330			    		//    url: '/Components/AjaxMailAlert.ashx',
331			    		//    async: true,
332			    		//    data: Params,
333			    		//    success: function (response) {
334			    		//    }
335			    		//});
336                    }
337                });
338                stepJobLinkClick += ', 14';
339                
340
341                //If Job Exists in Parent => Mark the Job as Sent Job in the Parent Page                                
342                if ($('#JobContainer' + JobID).length > 0)
343                {
344                    stepJobLinkClick += ', 15';
345                    //We need to decide where to put the Message because the Place to Display message that Job was Sent is Diffrent between Open/Organic Board
346
347                    var ContainerID = '';
348                    //Open Board
349                    if ($('#divOpenBoardContainer').children().find('#JobContainer' + JobID).length > 0)
350                        ContainerID = 'trSentJobFromJobRecommandedOpenBoard_' + JobID;
351
352                    //Organic Board
353                    if ($('#divOrganicContainer').children().find('#JobContainer' + JobID).length > 0)
354                        ContainerID = 'trSentJobFromJobRecommanded_' + JobID;
355                    stepJobLinkClick += ', 16';
356
357                    if (ContainerID != '')
358                    {
359                        stepJobLinkClick += ', 17';
360                        //if Older Message of CV that was Sent to the Job already Exists => Hide the Older Message
361                        if ($('#spnSentCV' + JobID).parent().length > 0)
362                            $('#spnSentCV' + JobID).parent().html('');
363
364                        //Get Date of Today
365                        var d = new Date();
366                        var day = d.getDate();
367                        var month = d.getMonth()+1;
368                        var year = d.getFullYear();
369
370                        if (day.toString().length == 1)
371                            day = '0' + day;
372
373                        if (month.toString().length == 1)
374                            month = '0' + month;
375
376                        var DateToday = day + "/" + month + "/" + year;
377                        stepJobLinkClick += ', 18';
378
379                        //Set Container as Job was Sent
380                        var divJobWasSent = '<img alt="AllJobs-לוח דרושים" src="/images/SearchReaults/checkboxGreen.gif" />' +
381		                                    '<span id="spnSentCV' + JobID + '">נשלח בהצלחה ב ' + DateToday + '</span>' +
382		                                    ', לצפייה בפרטים שנשלחו ' +
383		                                    '<a href="/UserList.aspx?UserListType=2" class="Green Normal">לחץ כאן</a>';
384
385                        //Append the Container to the Right Place (Open/Organic Board)
386                        $('#' + ContainerID + ' > td').append(divJobWasSent);
387
388                        //Set Text Desgin
389                        $('#' + ContainerID + ' > td').addClass('PT6 Green B');
390
391                        //Display Container
392                        $('#' + ContainerID).show();
393                        stepJobLinkClick += ', 19';
394                    }
395                }
396
397                stepJobLinkClick += ', 20';
398            }
399            catch (err)
400            {
401                // ajax Exception mail
402                // can send Page name, Method name, Error and ExrtaData to the server
403                //var Params = "Page=/JavaScript/Users/Site/RecommendedJobs.js&Error=" + status + "," + err.message + "&Method=InitRecommendedJobs_FastCVSend&ExtraData=" + "JobID=" + JobID + '; HostUrl=' + location.pathname + ' ; stepJobLinkClick=' + stepJobLinkClick + '&date=' + date.getTime();
404                //$.ajax(
405				//    {
406				//	    type: 'GET',
407				//	    url: '/Components/AjaxMailAlert.ashx',
408				//	    async: true,
409				//	    data: Params,
410				//	    success: function (response) {
411				//	    }
412				//    }
413			    //);
414            }
415
416
417        });
418
419        step += ' ,5';
420        // event for add this job to user jobs
421        $('div[id^="JobAdd_"]').live('click', function() {
422            
423            var stepJobAddClick = '1';
424            //If need to stop all Event because Adding Job to "My Job"
425            if (window.Globals.IsPreventActions == '1')
426                return false;
427
428            stepJobAddClick += ', 2';
429
430            // get job ID
431            var JobID = $(this).attr("id").split("_")[1];           
432                      
433            stepJobAddClick += ', 3';
434
435            // create data object
436            var date = new Date();
437
438            // ajax call - add job to user jobs
439            try {
440
441                // parameters
442                var params = 'Action=FastAddJobToUserJobs&JobID=' + JobID + '&SessionGuid=' + window.SessionGuid + '&CameFromStatus=' + window.CameFromStatus + '&date=' + date.getTime();
443                $.ajax({
444                    type: 'GET',
445                    url: '/User/CvWizard/CVWizardAction.aspx',
446                    async: false,
447                    data: params,
448                    success: function (response) {
449
450                        // if no session - redirect to home page
451                        if (response == "redirect")
452                            window.location.replace("/");
453
454                        stepJobAddClick += ', 4';
455
456                        // if response is true
457                        if (response == "true") {
458                            // remove the error message
459                            $("#ErrorSendingMessage_" + JobID).text("");
460
461                            stepJobAddClick += ', 5';
462
463                            // insert succsess message
464                            $("#JobAdd_" + JobID).text("המשרה נוספה בהצלחה")
465                                                    .css("color", "green")
466                                                    .css("width", 130)
467                                                    .css("cursor", "default")
468                                                    .css("text-decoration", "none");
469
470                            //Prevent Actions Untill the Job is Moving from the page (1.5 sec)
471                            window.Globals.IsPreventActions = '1';
472                            
473                            stepJobAddClick += ', 6';
474                            // set time out (delay)
475                            setTimeout(function () {
476                                
477                                // call for animating job & update function
478                                AnimateJobAndUpdateNextRevealed(JobID, "600px");
479                                
480                            },1000);
481
482                            setTimeout(function () {
483                                
484                                //Restore all Actions After 1.5 Sec to let the Old Job to Leave the Page and the New Job to Enter.
485                                //This was Made because if we don't wait 1.5 Sec and User will Press X on the Next Job, the Job Container might Freeze.
486                                window.Globals.IsPreventActions = '0';
487                                            
488                            },1500);
489
490                            stepJobAddClick += ', 7';
491
492                            //Update Search Result Guest that the Job was Added to my Jobs
493                            //We use Try/Catch so the process won't stop just because of the message
494                            try
495                            {
496                                $('#linkAddJob' + JobID).html('משרה נוספה בהצלחה');
497                                $('#linkAddJob' + JobID).css({'font-weight' : 'bold'});
498                            }
499                            catch(err){}
500                            
501                            stepJobAddClick += ', 8';
502                            try {
503                                parent.RemoveOneJobFromCount();
504                                $('#divRecommandedJobsParentTitle span').html('(' + top.$('#liRecommendedJobs').val() + ')')
505                            } catch (err) { }
506                        }
507                        else {
508
509                            stepJobAddClick += ', 9';
510                            // insert error message
511                            $("#ErrorSendingMessage_" + JobID).text("אירע שגיאה בעת הוספת המשרה, אנא נסה שוב...");
512                            window.Globals.IsPreventActions = '0';
513                        }
514                    },
515                    error: function (request, status, error) {
516                        // getting also errors, not exceptions from the ajax call
517                        // can send Page name, Method name, Error and ExrtaData to the server
518
519                        stepJobAddClick += ', 10';
520
521                        window.Globals.IsPreventActions = '0';
522                        //var Params = "Page=RecommendedJobs.js&Error=" + status + "," + error + "&Method=FastAddJobToUserJobs_JobAdd_Click&ExtraData=" + "JobID=" + JobID + '; HostUrl=' + location.pathname + '; stepJobAddClick=' + stepJobAddClick + '&date=' + date.getTime();
523                        //$.ajax(
524			    		//{
525			    		//    type: 'GET',
526			    		//    url: '/Components/AjaxMailAlert.ashx',
527			    		//    async: true,
528			    		//    data: Params,
529			    		//    success: function (response) {
530			    		//    }
531			    		//});
532                    }
533                });
534            }
535            catch (err) {
536                // ajax Exception mail
537                // can send Page name, Method name, Error and ExrtaData to the server
538
539                //var Params = "Page=RecommendedJobs.js&Error=" + status + "," + err.message + "&Method=FastAddJobToUserJobs_FastAddJobToUserJobs&ExtraData=" + "JobID=" + JobID + '; HostUrl=' + location.pathname + '; stepJobAddClick=' + stepJobAddClick + '&date=' + date.getTime();
540                //$.ajax(
541				//    {
542				//	    type: 'GET',
543				//	    url: '/Components/AjaxMailAlert.ashx',
544				//	    async: true,
545				//	    data: Params,
546				//	    success: function (response) {
547				//	    }
548				//    }
549			    //);
550            }
551
552        });
553
554        step += ' ,6';
555        $('img[id^="JobLink_"]').live('mouseover', function() {
556            $('#' + this.id).attr('src','/images/CVWizard/BtnSendCV_Over.jpg');
557        });
558        
559        step += ' ,7';
560
561        $('img[id^="JobLink_"]').live('mouseout', function () {
562            $('#' + this.id).attr('src', '/images/CVWizard/BtnSendCV.jpg');
563        });
564
565        step += ' ,8';
566    }
567    catch(err)
568    {
569        // ajax Exception mail
570        // can send Page name, Method name, Error and ExrtaData to the server
571        var date = new Date();
572        //var Params = 'Page=/JavaScript/Users/Site/RecommendedJobs.js&Error=' + err.message + '&Method=InitRecommendedJobs_GetUserRecommendedJobsJson&ExtraData=' + "Step=" + step + '; HostUrl=' + location.pathname + '&date=' + date;
573        //$.ajax(
574		//	{
575		//		type: 'GET',
576		//		url: '/Components/AjaxMailAlert.ashx',
577		//		async: true,
578		//		data: Params,
579		//		success: function (response) {
580		//		}
581		//	}
582		//);
583    }
584    
585    // returning the promise object
586    return deferred.promise();
587}
588
589    
590function TransformHtmlTemplateWithJson()
591{
592    var deferred = $.Deferred(); // create deferred object
593
594    var step = '1';
595    try
596    {
597
598        var HtmlTemplateContent;
599        var RecommandedJobsJson;
600        var RecommandedJobsTemplateContent;
601    
602        HtmlTemplateContent = Globals.JobsJSON.HtmlTemplate;
603
604        step = '2';
605
606        // organize data for template rendering       
607        var data = {}; // data namespace
608        data.Jobs = Globals.JobsJSON.Jobs; // pass the data
609        data.RevealedJobsCounter = window.ParamRevealedJobsCounter; //3
610    
611        step = '3';
612        var templateHTML = $.tmpl(HtmlTemplateContent, data);
613    
614        step = '4';
615        templateHTML = SetCurrentXImage(templateHTML);   
616        deferred.resolve(templateHTML); // passing data to deferred's resolve function on successful completion
617    }
618    catch(err)
619    {
620        // ajax Exception mail
621        // can send Page name, Method name, Error and ExrtaData to the server
622        var date = new Date();
623        //var Params = 'Page=/JavaScript/Users/Site/RecommendedJobs.js&Error=' + err.message + '&Method=TransformHtmlTemplateWithJson_TransformHtmlTemplateWithJson&ExtraData=' + "Step:" + step + '; HostUrl=' + location.pathname + '&date=' + date;
624        //$.ajax(
625		//	{
626		//		type: 'GET',
627		//		url: '/Components/AjaxMailAlert.ashx',
628		//		async: true,
629		//		data: Params,
630		//		success: function (response) {
631		//		}
632		//	}
633		//);
634    }
635
636    return deferred.promise(); // returning the promise object
637}
638
639function JobMoreOrLess(JobID) 
640{
641    window['JobRequirementsFullInterval' + JobID] = setInterval(function () {
642        if (!$('#divJobRequirementsFullRJ' + JobID + '  div').is(':hidden')) {
643            if ($('#divJobRequirementsFullRJ' + JobID + ' div').height() > 47) {
644                $('#divJobRequirementsFullRJ' + JobID).height(47);
645                $('#lnkContinueRJ' + JobID).show();
646            }
647            else
648                $('#divJobRequirementsFullRJ' + JobID).height($('#divJobRequirementsFullRJ' + JobID + ' div').height());
649
650            clearInterval(window['JobRequirementsFullInterval' + JobID]);
651        }
652    }, 200);
653}
654
655    
656function ShowFullJobRequirements(JobID) 
657{
658    $('#lnkContinueRJ' + JobID).hide();
659    $('#lnkCloseFullRJ' + JobID).show();
660
661    var ParentContainerHeight = ($('#' + window.divRecommandedJobsParentLayoutID).height() + $('#divJobRequirementsFullRJ' + JobID + ' div').height());
662    $('#divJobRequirementsFullRJ' + JobID).animate({ "height": $('#divJobRequirementsFullRJ' + JobID + ' div').height() }, 500);
663    $('#' + window.divRecommandedJobsParentLayoutID).animate({ "height": ParentContainerHeight }, 500,
664            function () {
665                if (window.ResetNanoScroller != '')
666                    $('#' + window.ResetNanoScroller).mCustomScrollbar();
667            }
668    );
669}
670
671function ShowLessJobRequirements(JobID) 
672{
673    $('#lnkContinueRJ' + JobID).show();
674    $('#lnkCloseFullRJ' + JobID).hide();
675
676    $('#divJobRequirementsFullRJ' + JobID).animate({ "height": 47 }, 500);
677    $('#' + window.divRecommandedJobsParentLayoutID).animate({ "height": $('#' + window.divRecommandedJobsParentContainerID).height() }, 500,
678            function () {
679                if (window.ResetNanoScroller != '')
680                    $("#divMainNanoScrollerContainer .content").mCustomScrollbar();
681            }
682    );
683
684}
685
686// animating cuurent job and updates next revealed job in DB
687function AnimateJobAndUpdateNextRevealed(JobID, direction) 
688{   
689    // clone the current container
690    var ContainerClone = $("#Job_" + JobID).clone().css("opacity", 0);
691    
692    // get current job container position
693    var ThisContainerPosition = $("#Job_" + JobID).prevAll().find("img[id^='JobLink_']").length;
694    
695    // next job object variable
696    var NextContainerToReveal = -1;
697
698    // get next container object to reveal
699    switch (ThisContainerPosition) 
700    {
701        case 0:
702            NextContainerToReveal = $("#Job_" + JobID).next().next().next();
703            break;
704        case 1:
705            NextContainerToReveal = $("#Job_" + JobID).next().next();
706            break;
707        case 2:
708            NextContainerToReveal = $("#Job_" + JobID).next();
709            break;
710    }
711
712    // if object exists
713    if (NextContainerToReveal.length > 0)
714    // show the next job container object
715        NextContainerToReveal.css({ "display": "block" });
716
717    // get current container position
718    var ContainerPosition = $("#Job_" + JobID).position();
719
720    //if we use the Nano Scroller we need to Update the position of the Clone Animated Job the Leaving the Screen.
721    if (window.ResetNanoScroller != '')
722        ContainerPosition.top += $('.content').scrollTop();
723    
724    // clone the current container object for animation
725    var CloneForAnimation = $("#Job_" + JobID).clone().css({ "padding" : "0px", "margin" : "0px;", "position": "absolute", "top": ContainerPosition.top, /*"left": ContainerPosition.left,*/ "right": "160px", "bottom" : "0px", "z-index": "10" }).attr("id", "CloneForAnimation");
726
727    // give current container transparency and insert the animation clone
728    $("#Job_" + JobID).css({ "opacity": "0" }).before(CloneForAnimation);
729    
730    
731
732    // animate the height of current container
733    $("#Job_" + JobID).animate({
734        "height": "0px"
735    }, 400);
736
737    
738    // animate container
739    $("#CloneForAnimation").animate({
740        "right": direction,
741        "opacity": 0
742    },
743    400,
744    function () {
745
746        // remove
747        $("#CloneForAnimation").remove();
748        $("#Job_" + JobID).remove();
749        
750        //fix bug when there is job to display but it does not
751        var DisplayJobsCount = $('#divRecommandedJobsConatiner .JobContainer:visible').length;
752        var TotalJobsCountLeft = $('#divRecommandedJobsConatiner .JobContainer').length;
753        if (DisplayJobsCount < 3 && TotalJobsCountLeft >= 3) {
754            $('#divRecommandedJobsConatiner .JobContainer:nth-child(1)').show();
755            $('#divRecommandedJobsConatiner .JobContainer:nth-child(2)').show();
756            $('#divRecommandedJobsConatiner .JobContainer:nth-child(3)').show();
757        }
758        // if object exists and the object is job
759        if (NextContainerToReveal.length > 0 && NextContainerToReveal.attr("class").indexOf("JobContainer") != -1) {
760
761            // find new revealed job details(score & promoted)
762            var JobScore = null;
763            var Promoted = null;
764            JobID = NextContainerToReveal.attr("id").split("_")[1];
765
766            var JobsCount = Globals.JobsJSON.Jobs.length;
767            for (var i = 0 ; i < JobsCount ; i++)
768            {
769                //If this is the Current Job
770                if(JobID == Globals.JobsJSON.Jobs[i].JobID)
771                {
772                    //Get Extra Details to Update them and Quit this Loop
773                    JobScore = Globals.JobsJSON.Jobs[i].JobScore;
774                    Promoted = Globals.JobsJSON.Jobs[i].IsRecommandedJob;
775                    break;
776                }
777            }
778
779            // create data object
780            var date = new Date();
781
782            if (window.ResetNanoScroller != '')
783                $("#divMainNanoScrollerContainer .content").mCustomScrollbar();
784
785            if (JobID == 'undefined')
786                return;
787            // ajax call - update job as revealed
788            try {
789
790                // parameters
791                
792                var params = 'Action=FastUpdateRevealedJob&JobID=' + JobID + '&Score=' + JobScore + '&Promoted=' + Promoted + '&SessionGuid=' + window.SessionGuid + '&JobsCollectionCount=' + JobsCount.toString() + '&CameFromStatus=' + window.CameFromStatus + '&date=' + date.getTime();
793                
794                $.ajax({
795                    type: 'GET',
796                    url: '/User/CvWizard/CVWizardAction.aspx',
797                    async: false,
798                    data: params,
799                    success: function (response) {
800
801                        // if no session - redirect to home page
802                        if (response == "redirect")
803                            window.location.replace("/");
804                        
805                        IfNoJobWasLeftCloseBlocker();
806                    },
807                    error: function (request, status, error) {
808                        // getting also errors, not exceptions from the ajax call
809                        // can send Page name, Method name, Error and ExrtaData to the server
810                        //var Params = "Page=/JavaScript/Users/Site/RecommendedJobs.js&Error=" + status + "," + error + "&Method=FastUpdateRevealedJob_FastUpdateRevealedJob_OnError&ExtraData=" + "JobID=" + JobID + '; Score=' + JobScore + '; Promoted=' + Promoted + '; SessionGuid=' + window.SessionGuid + '; HostUrl=' + location.pathname + '&date=' + date.getTime();
811                        //$.ajax({
812                        //    type: 'GET',
813                        //    url: '/Components/AjaxMailAlert.ashx',
814                        //    async: true,
815                        //    data: Params,
816                        //    success: function (response) {
817                        //    }
818                        //});
819                    }
820                });
821            }
822            catch (err) {
823                // ajax Exception mail
824                // can send Page name, Method name, Error and ExrtaData to the server
825                //var Params = "Page=/JavaScript/Users/Site/RecommendedJobs.js&Error=" + status + "," + err.message + "&Method=FastUpdateRevealedJob_FastUpdateRevealedJob&ExtraData=" + "JobID=" + JobID + '; Score=' + JobScore + ';Promoted=' + Promoted + '; SessionGuid=' + window.SessionGuid + '; HostUrl=' + location.pathname + '&date=' + date.getTime();
826                //$.ajax(
827				//{
828				//	type: 'GET',
829				//	url: '/Components/AjaxMailAlert.ashx',
830				//	async: true,
831				//	data: Params,
832				//	success: function (response) {
833				//	}
834				//});
835            }
836            
837            return false;
838
839        }
840        else
841            IfNoJobWasLeftCloseBlocker();
842
843    });
844}
845
846function SubstringText(text,indexFrom,indexTo)
847{   
848    return text.substring(indexFrom,indexTo);
849}
850
851function OpenOrCloseCompanyMoreDetails(JobID)
852{
853    //If Company More Details is Open
854    if ($('#divCompanyDetailsRJ' + JobID).is(":visible"))
855    {
856        var JobContainerHeight = $('#' + window.divRecommandedJobsParentLayoutID).height() - ($('#divCompanyDetailsRJ' + JobID).height() + $('#divCompanyDetailsHRRJ_' + JobID).height());
857        if (window.IsResetNanoScroller == '1')
858        $('#' + window.divRecommandedJobsParentLayoutID).animate({ "height": JobContainerHeight }, 500,
859            function () {    
860                if (window.ResetNanoScroller != '')
861                    $("#divNanoScroller").nanoScroller();
862            }
863        );
864        
865        
866        else
867            $('#' + window.divRecommandedJobsParentLayoutID).animate({ "height": JobContainerHeight }, 500,
868                function () {
869                    if (window.ResetNanoScroller != '')
870                        $("#divNanoScroller").nanoScroller();
871                }
872            );
873        
874        $('#divCompanyDetailsRJ' + JobID).hide('slow');
875        $('#divCompanyDetailsHRRJ_' + JobID).hide('slow');
876    }
877    else
878    {
879        var JobContainerHeight = $('#' + window.divRecommandedJobsParentLayoutID).height() + $('#divCompanyDetailsRJ' + JobID).height() + $('#divCompanyDetailsHRRJ_' + JobID).height();
880        $('#' + window.divRecommandedJobsParentLayoutID).animate({ "height": JobContainerHeight }, 500,
881            function () {
882                if (window.ResetNanoScroller != '')
883                    $("#divMainNanoScrollerContainer .content").mCustomScrollbar();
884            }
885        );
886        
887        $('#divCompanyDetailsRJ' + JobID).show('slow');
888        $('#divCompanyDetailsHRRJ_' + JobID).show('slow');        
889    }
890}
891
892function SetCurrentXImage(element)
893{
894   
895    var Position = 0;
896    var CurrentJobID = '';
897
898    var $html = $(element);
899      
900    $html.find('[id^="JobClose_"]').each(function(){
901        
902        CurrentJobID = $(this).attr("id").split("_")[1];
903       
904        switch(Position)
905        {
906            case 0:
907                $html.find('#JobClose_' + CurrentJobID).attr('src','/images/CVWizard/X-Purple.jpg');                             
908                Position++;
909                break;
910            case 1:
911                $html.find('#JobClose_' + CurrentJobID).attr('src','/images/CVWizard/X-Green.jpg');
912                Position++;
913                break;
914            default:
915                $html.find('#JobClose_' + CurrentJobID).attr('src','/images/CVWizard/X-Turquoise.jpg');
916                Position = 0;
917                break;
918        }
919    });
920   
921    return $html;
922}
923
924function SetManFace(IsManSmile)
925{
926    $('div#divManStatus').removeClass('PicManSmile').removeClass('PicMenSad')
927
928    if (IsManSmile == '1')
929        $('div#divManStatus').addClass('PicManSmile');
930    else
931        $('div#divManStatus').addClass('PicMenSad');
932
933    setTimeout(function(){
934        $('div#divManStatus').removeClass('PicManSmile').removeClass('PicMenSad')
935        $('div#divManStatus').addClass('PicMan');
936    },1000);
937}
938
939function IfNoJobWasLeftCloseBlocker()
940{
941    //If no Job was left => Close Blocker
942    //We use timeout just to make this action as out of the Process so the flow Won't be Delayed
943    setTimeout(function(){
944        if($('div [id^="Job_"]').length <= 0)
945        {
946            $('#divManStatus').hide();
947            $('#divRecommandedJobsParentBlocker').fadeOut(800, function(){ $(this).remove();});
948            $('html,body').css('overflow', '');
949
950            (top.CloseUserRecommendedJobs || Function)();
951        }
952    },1);
953}
954
955function GetValueFromUrlByParam(Url, Param) 
956{
957    var match = RegExp('[?&]' + Param + '=([^&]*)').exec(Url);
958    return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
959}

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.