PageSourceSearch

https://designthefuture.pt/js/app/inclusivefuture.js?UID=bfa7b

js designthefuture.pt collected 2026-09-24 10:06:18 UTC 49,049 bytes, 1,404 lines download raw bytes

1var userlogged = '<%= HttpContext.Current.Session["userType"] %>';
2var filtroVoc = false;
3
4$('#acess_1').addClass('active');
5$('#acess_1').click(function () {
6    if (!$('#acess_1').hasClass('active')) {
7        $('#acess_1').addClass('active').siblings().removeClass('active');
8        $('.boxHomeGridHeader').removeClass('acess3');
9        $('.boxHomeGridHeader').removeClass('acess2');
10        $('.boxHomeGridBody').removeClass('acess2');
11        $('.boxHomeGridBody').removeClass('acess3');
12        $('.overlayImage').removeClass('acess3');
13        $('.overlayImage').removeClass('acess2');
14    }
15
16}).keypress(function (e) {
17    var key = e.which;
18    if (key == 13)  // the enter key code
19    {
20        $('#acess_1').click();
21    }
22});
23
24
25$('#acess_2').click(function () {
26    if (!$('#acess_2').hasClass('active')) {
27        $('#acess_2').addClass('active').siblings().removeClass('active');
28        $('.boxHomeGridHeader').addClass('acess2');
29        $('.boxHomeGridHeader').removeClass('acess3');
30        $('.boxHomeGridBody').addClass('acess2');
31        $('.boxHomeGridBody').removeClass('acess3');
32        $('.overlayImage').addClass('acess2');
33        $('.overlayImage').removeClass('acess3');
34    }
35}).keypress(function (e) {
36    var key = e.which;
37    if (key == 13)  // the enter key code
38    {
39        $('#acess_2').click();
40    }
41});
42
43$('#acess_3').click(function () {
44    if (!$('#acess_3').hasClass('active')) {
45        $('#acess_3').addClass('active').siblings().removeClass('active');
46        $('.boxHomeGridHeader').addClass('acess3');
47        $('.boxHomeGridHeader').removeClass('acess2');
48        $('.boxHomeGridBody').addClass('acess3');
49        $('.boxHomeGridBody').removeClass('acess2');
50        $('.overlayImage').addClass('acess3');
51        $('.overlayImage').removeClass('acess2');
52    }
53}).keypress(function (e) {
54    var key = e.which;
55    if (key == 13)  // the enter key code
56    {
57        $('#acess_3').click();
58    }
59});
60
61var tagsList = new Object();
62
63var filtroPesquisa = "";
64
65var rowsPerPage = 6;
66var items = 0;
67
68function checkPageURL(hash) {
69    if (!hash) {
70        hash = window.location.search.substring(1);
71
72    }
73
74    var hashAux = decodeURI(hash);
75    var vars = hashAux.split("&");
76    tagsList = new Object();
77    tagsList.str = "";
78    tagsList.fil = 0;
79    tagsList.areaID = 0;
80    tagsList.profID = 0;
81    tagsList.espID = 0;
82    tagsList.domainID = 0;
83    tagsList.areaVocID = 0;
84    tagsList.charactID = 0;
85
86    var tagsProf = false;
87    var tagsVoc = false;
88
89    if ($('#filter_search').val().length > 2) {
90        filtroPesquisa = $('#filter_search').val();
91    }
92
93    $('#tagVocDiv').hide();
94    $('#tagProfDiv').hide();
95
96    $('#nav8').addClass('active');
97
98    //getURLParam()
99
100    //var filID = getURLParam('fil');
101
102    //if (filID == 4) {
103    //    filtroVoc = true;
104    //    $('#nav8').addClass('active');
105    //    tagsList.fil = 4;
106
107    //    $("#select_filter").val(2);
108    //    $('#tagProfDiv').hide();
109    //    $('#tagVocDiv').show();
110    //    tagsVoc = true;
111    //    $.each(vars, function (i, item) {
112    //        var varsAux = item.split("=");
113    //        if (varsAux[0] == "dmn") {
114    //            tagsList.domainID = varsAux[1];
115    //            tagsVoc = true;
116    //        }
117    //        if (varsAux[0] == "avc") {
118    //            tagsList.areaVocID = varsAux[1];
119    //            tagsVoc = true;
120    //        }
121    //        if (varsAux[0] == "ctr") {
122    //            tagsList.charactID = varsAux[1];
123    //            tagsVoc = true;
124    //        }
125    //        if (varsAux[0] == "str") {
126    //            tagsList.str = varsAux[1];
127    //            tagsVoc = true;
128    //            $('#filter_search').val(varsAux[1]);
129    //            if ($('#filter_search').val().length > 2) {
130    //                filtroPesquisa = $('#filter_search').val();
131    //            }
132    //        }
133    //    });
134
135    //} else {
136    //    $('#nav8').addClass('active');
137    //    tagsList.fil = 3;
138    //    $("#select_filter").val(1);
139    //    $('#tagVocDiv').hide();
140    //    $('#tagProfDiv').show();
141    //    $.each(vars, function (i, item) {
142    //        var varsAux = item.split("=");
143    //        tagsProf = true;
144    //        if (varsAux[0] == "area") {
145    //            tagsProf = true;
146    //            tagsList.areaID = varsAux[1];
147    //        }
148    //        if (varsAux[0] == "prof") {
149    //            tagsList.profID = varsAux[1];
150    //            tagsProf = true;
151    //        }
152    //        if (varsAux[0] == "esp") {
153    //            tagsList.espID = varsAux[1];
154    //            tagsProf = true;
155    //        }
156    //        if (varsAux[0] == "str") {
157    //            tagsList.str = varsAux[1];
158    //            tagsVoc = true;
159
160    //            $('#filter_search').val(varsAux[1]);
161    //            if ($('#filter_search').val().length > 2) {
162    //                filtroPesquisa = $('#filter_search').val();
163    //            }
164    //        }
165    //    });
166    //}
167
168    //updateArea(getTag_ProfissionalNoFilter(1).d);
169    //updateDomain(getTag_VocNoFilter(1).d);
170
171    //if (typeof (Storage) !== "undefined") {
172    //    // PROFISSOES
173    //    if (sessionStorage.filtroTag && !filtroVoc) {
174    //        for (i = 0; i < JSON.parse(sessionStorage.filtroTag).Area.length; i++) {
175    //            $("#checkBoxArea_" + JSON.parse(sessionStorage.filtroTag).Area[i]).prop("checked", true);
176    //        }
177    //    }
178    //    // EXPLORACAO VOCACIONAL
179    //    if (sessionStorage.filtroTagVoc && filtroVoc) {
180    //        for (i = 0; i < JSON.parse(sessionStorage.filtroTagVoc).Domain.length; i++) {
181    //            $("#checkBoxDomain_" + JSON.parse(sessionStorage.filtroTagVoc).Domain[i]).prop("checked", true);
182    //        }
183    //    }
184    //}
185
186    //initControls();
187
188    //if (typeof (Storage) !== "undefined") {
189    //    // PROFISSOES
190    //    if (sessionStorage.filtroTag && !filtroVoc) {
191    //        if (JSON.parse(sessionStorage.filtroTag).Area.length > 0) {
192    //            $('#areaBox').click();
193    //            updateJob(getTag_Profissional(2).d);
194    //            if (JSON.parse(sessionStorage.filtroTag).Job.length > 0) {
195    //                $('#jobBox').click();
196    //                for (i = 0; i < JSON.parse(sessionStorage.filtroTag).Job.length; i++) {
197    //                    $("#checkBoxJob_" + JSON.parse(sessionStorage.filtroTag).Job[i]).prop("checked", true);
198    //                }
199    //                updateSpeciality(getTag_Profissional(3).d);
200    //                if (JSON.parse(sessionStorage.filtroTag).Speciality.length > 0) {
201    //                    $('#specialityBox').click();
202    //                    for (i = 0; i < JSON.parse(sessionStorage.filtroTag).Speciality.length; i++) {
203    //                        $("#checkBoxSpeciality_" + JSON.parse(sessionStorage.filtroTag).Speciality[i]).prop("checked", true);
204    //                    }
205    //                }
206    //            }
207    //            updateHeadersCount(false);
208    //        }
209    //    }
210    //    // EXPLORACAO VOCACIONAL
211    //    if (sessionStorage.filtroTagVoc && filtroVoc) {
212    //        if (JSON.parse(sessionStorage.filtroTagVoc).Domain.length > 0) {
213    //            $('#domainBox').click();
214    //            updateAreaVoc(getTag_Voc(2).d);
215    //            if (JSON.parse(sessionStorage.filtroTagVoc).AreaVoc.length > 0) {
216    //                $('#areaVocBox').click();
217    //                for (i = 0; i < JSON.parse(sessionStorage.filtroTagVoc).AreaVoc.length; i++) {
218    //                    $("#checkBoxAreaVoc_" + JSON.parse(sessionStorage.filtroTagVoc).AreaVoc[i]).prop("checked", true);
219    //                }
220    //                updateCharact(getTag_Voc(3).d);
221    //                if (JSON.parse(sessionStorage.filtroTagVoc).Charact.length > 0) {
222    //                    $('#charactBox').click();
223    //                    for (i = 0; i < JSON.parse(sessionStorage.filtroTagVoc).Charact.length; i++) {
224    //                        $("#checkBoxCharact_" + JSON.parse(sessionStorage.filtroTagVoc).Charact[i]).prop("checked", true);
225    //                    }
226    //                }
227    //            }
228    //            updateHeadersCount(true);
229    //        }
230    //    }
231    //}
232
233    getProfissao(0, 0);
234    tagsList.fil = 0;
235    tagsList.str = "";
236    //tagsList.areaID = 0;
237    //tagsList.profID = 0;
238    //tagsList.espID = 0;
239    //tagsList.domainID = 0;
240    //tagsList.areaVocID = 0;
241    //tagsList.charactID = 0;
242
243    $(document).scroll(function (e) {
244        if (processing)
245            return false;
246        if ($(window).scrollTop() >= ($(document).height() - $(window).height()) * 0.7) {
247            processing = true;
248            getProfissao(0, pageprofs);
249        }
250    });
251
252    applyAjudaText();
253}
254
255function goTo(id) {
256    location.href = "discover_job.aspx?e=" + id + "";
257}
258
259function buildCheckboxItem(prefix, item) {
260
261    prefixCamelCase = prefix.replace(/\b[A-Z]/g, function (letter) {
262        return letter.toLowerCase();
263    });
264
265    $('<div aria-checked="false" tabindex=0 role="checkbox" aria-label="Checbox ' + item.Nome + '" class="checkBox">' +
266        '  <div style="width=100%">' +
267        '  <input type= "checkbox" value= "' + item.ID + '" id= "checkBox' + prefix + '_' + item.ID + '" name= "' + prefixCamelCase + 'Option" /><label for="checkBox' + prefix + '_' + item.ID + '"></label> <span class="checkboxTitle">' + item.Nome + '</span>' +
268        ((item.Tooltip !== undefined && item.Tooltip !== "") ? '  <img class="tooltip" title="' + item.Tooltip.replace(/[\n\r]/g, '<br>') + '" src="/images/info_login_2.png" width="15px" height="15px" style="float: right; margin-right: 13px; margin-top: 2px;">' : '') +
269        '  </div>' +
270        '</div > ').appendTo('#Filter_' + prefix);
271
272    initTooltip();
273}
274
275function buildRadioButtonItem(prefix, item) {
276
277    prefixCamelCase = prefix.replace(/\b[A-Z]/g, function (letter) {
278        return letter.toLowerCase();
279    });
280
281    $('<div aria-checked="false" tabindex=0 role="radio" aria-label="Checbox ' + item.Nome + '" class="radio">' +
282        '  <div style="width=100%">' +
283        '  <input type= "radio" value= "' + item.ID + '" id= "checkBox' + prefix + '_' + item.ID + '" name= "' + prefixCamelCase + 'Option" /><label for="checkBox' + prefix + '_' + item.ID + '"></label> <span class="checkboxTitle">' + item.Nome + '</span>' +
284        ((item.Tooltip !== undefined && item.Tooltip !== "") ? '  <img class="tooltip" title="' + item.Tooltip.replace(/[\n\r]/g, '<br>') + '" src="/images/info_login_2.png" width="15px" height="15px" style="float: right; margin-right: 13px; margin-top: 2px;">' : '') +
285        '  </div>' +
286        '</div > ').appendTo('#Filter_' + prefix);
287
288    initTooltip();
289}
290
291//function updateArea(result) {
292//    var data = result;
293//    $('#Filter_Area').html('');
294//    $.each(data, function (i, item) {
295
296//        buildCheckboxItem('Area', item);
297
298//        if (i != data.length - 1)
299//            $('<hr />').appendTo('#Filter_Area');
300//        if (tagsList.areaID == item.ID) {
301//            $("#checkBoxArea_" + item.ID + "").prop('checked', true);
302//            $("#checkBoxArea_" + item.ID + "").attr('aria-checked', true);
303//        }
304
305//        $('#checkBoxArea_' + item.ID).parent().keypress(function (e) {
306//            e.preventDefault();
307//            var key = e.which;
308//            if (key == 32)  // the enter key code
309//            {
310//                if ($('#checkBoxArea_' + item.ID).is(":checked")) {
311//                    $('#checkBoxArea_' + item.ID).prop("checked", false);
312//                    $('#checkBoxArea_' + item.ID).parent().attr('aria-checked', false);
313//                }
314//                else {
315//                    $('#checkBoxArea_' + item.ID).prop("checked", true);
316//                    $('#checkBoxArea_' + item.ID).parent().attr('aria-checked', true);
317//                    alert('#checkBox_' + item.ID + ': CHECKED');
318//                }
319//                getProfissao(0, 0);
320//            } else if (key == 13)  // the enter key code
321//            {
322//                $("#areaBox").click();
323//                $("#areaBox").focus();
324//            }
325//        });
326
327//    });
328//    $('#Filter_Area').val('');
329
330//    if ($('input[name="areaOption"]:checked').length > 0) {
331//        $('#areaNumber').html('(' + $('input[name="areaOption"]:checked').length + ')');
332//        updateJob(getTag_Profissional(2).d);
333//    } else {
334//        $('#areaNumber').html('');
335//    }
336
337//}
338
339//function updateJob(result) {
340//    var data = result;
341//    $('#Filter_Job').html('');
342
343//    $('#jobNumber').html('');
344
345//    if (data.length == 0) {
346//        $('#jobBox').parent().hide();
347//        return;
348//    } else {
349//        $('#jobBox').parent().show();
350//    }
351
352//    $.each(data, function (i, item) {
353
354//        buildCheckboxItem('Job', item);
355
356//        if (i != data.length - 1)
357//            $('<hr />').appendTo('#Filter_Job');
358//        if (tagsList.profID == item.ID) {
359//            $("#checkBoxJob_" + item.ID + "").prop('checked', true);
360//            $('#checkBoxJob_' + item.ID).parent().attr('aria-checked', true);
361//        }
362
363//        $('#checkBoxJob_' + item.ID).parent().keypress(function (e) {
364//            e.preventDefault();
365//            var key = e.which;
366//            if (key == 32)  // the enter key code
367//            {
368//                if ($('#checkBoxJob_' + item.ID).is(":checked")) {
369//                    $('#checkBoxJob_' + item.ID).prop("checked", false);
370//                    $('#checkBoxJob_' + item.ID).parent().attr('aria-checked', false);
371//                }
372//                else {
373//                    $('#checkBoxJob_' + item.ID).prop("checked", true);
374//                    $('#checkBoxJob_' + item.ID).parent().attr('aria-checked', true);
375//                }
376//                getProfissao(0, 0);
377//            } else if (key == 13)  // the enter key code
378//            {
379//                $("#jobBox").click();
380//                $("#jobBox").focus();
381//            }
382//        });
383//    });
384
385//    $('#Filter_Job').val('');
386
387//    $('input[name=jobOption]').click(
388//        _.debounce(
389//            function (e) {
390//                var checkedItems = $('input[name="jobOption"]:checked').length;
391//                if (checkedItems > 0) {
392//                    $('#jobNumber').html('(' + checkedItems + ')');
393//                    updateSpeciality(getTag_Profissional(3).d);
394//                } else {
395//                    $('#jobNumber').html('');
396//                    updateSpeciality([]);
397//                }
398//                $(this).parent().attr('aria-checked', $(this).prop('checked'));
399
400//                // Retrieve previous checked items from session storage, to prevent them to be unselected
401//                if (($(this).prop('checked') || checkedItems > 0) && typeof (Storage) !== "undefined" && sessionStorage.filtroTag && !filtroVoc) {
402//                    if (JSON.parse(sessionStorage.filtroTag).Speciality.length > 0) {
403//                        for (i = 0; i < JSON.parse(sessionStorage.filtroTag).Speciality.length; i++) {
404//                            $("#checkBoxSpeciality_" + JSON.parse(sessionStorage.filtroTag).Speciality[i]).prop("checked", true);
405//                        }
406//                    }
407//                    updateHeadersCount(false);
408//                }
409
410//                getProfissao(0, 0);
411//            }, 500
412//        )
413//    );
414
415//    if ($('input[name="jobOption"]:checked').length > 0) {
416//        $('#jobNumber').html('(' + $('input[name="jobOption"]:checked').length + ')');
417//        updateSpeciality(getTag_Profissional(3).d);
418//        getProfissao(0, 0);
419//    } else {
420//        $('#jobNumber').html('');
421//        updateSpeciality([]);
422//    }
423
424//}
425
426//function updateSpeciality(result) {
427//    var data = result;
428//    $('#Filter_Speciality').html('');
429//    $('#specialityNumber').html('');
430
431//    if (data.length == 0) {
432//        $('#specialityBox').parent().hide();
433//        return;
434//    } else {
435//        $('#specialityBox').parent().show();
436//    }
437//    $.each(data, function (i, item) {
438
439//        buildCheckboxItem('Speciality', item);
440
441//        if (i != data.length - 1)
442//            $('<hr />').appendTo('#Filter_Speciality');
443//        if (tagsList.espID == item.ID) {
444//            $("#checkBoxSpeciality_" + item.ID + "").prop('checked', true);
445//            $('#checkBoxSpeciality_' + item.ID).parent().attr('aria-checked', true);
446//        }
447//        $('#checkBoxSpeciality_' + item.ID).parent().keypress(function (e) {
448//            e.preventDefault();
449//            var key = e.which;
450//            if (key == 32)  // the enter key code
451//            {
452//                if ($('#checkBoxSpeciality_' + item.ID).is(":checked")) {
453//                    $('#checkBoxSpeciality_' + item.ID).prop("checked", false);
454//                    $('#checkBoxSpeciality_' + item.ID).parent().attr('aria-checked', false);
455//                }
456//                else {
457//                    $('#checkBoxSpeciality_' + item.ID).prop("checked", true);
458//                    $('#checkBoxSpeciality_' + item.ID).parent().attr('aria-checked', true);
459//                }
460//                getProfissao(0, 0);
461//            } else if (key == 13)  // the enter key code
462//            {
463//                $("#specialityBox").click();
464//                $("#specialityBox").focus();
465//            }
466//        });
467//    });
468//    $('#Filter_Speciality').val('');
469
470//    $('input[name=specialityOption]').click(
471//        _.debounce(
472//            function (e) {
473//                if ($('input[name="specialityOption"]:checked').length > 0) {
474//                    $('#specialityNumber').html('(' + $('input[name="specialityOption"]:checked').length + ')');
475//                } else {
476//                    $('#specialityNumber').html('');
477//                }
478//                $(this).parent().attr('aria-checked', $(this).prop('checked'));
479//                getProfissao(0, 0);
480//            }, 500
481//        )
482//    );
483
484//    if ($('input[name="specialityOption"]:checked').length > 0) {
485//        $('#specialityNumber').html('(' + $('input[name="specialityOption"]:checked').length + ')');
486//    } else {
487//        $('#specialityNumber').html('');
488//    }
489//}
490
491//function initControls() {
492//    if ($('input[name="areaOption"]:checked').length > 0) {
493//        $('#areaNumber').html('(' + $('input[name="areaOption"]:checked').length + ')');
494//    } else {
495//        $('#areaNumber').html('');
496//    }
497//    $("#areaBox").click(function () {
498//        if ($("#tabArea").attr("class") == "openTextWhite") {
499//            $("#tabArea").attr("class", "closeTextWhite");
500//            $("#Filter_Area").parent().show('fast');
501//        }
502//        else {
503//            $("#Filter_Area").parent().hide('fast');
504//            $("#tabArea").attr("class", "openTextWhite");
505//        }
506//    }).keypress(function (e) {
507//        var key = e.which;
508//        if (key == 13)  // the enter key code
509//        {
510//            $("#areaBox").click();
511//        }
512//    });
513//    $('input[name=areaOption]').click(
514//        _.debounce(
515//            function (e) {
516//                var checkedItems = $('input[name="areaOption"]:checked').length;
517//                if (checkedItems > 0) {
518//                    $('#areaNumber').html('(' + checkedItems + ')');
519//                    updateJob(getTag_Profissional(2).d);
520//                    updateSpeciality([]);
521//                } else {
522//                    $('#areaNumber').html('');
523//                    updateJob([]);
524//                    updateSpeciality([]);
525//                }
526//                $(this).parent().attr('aria-checked', $(this).prop('checked'));
527
528//                // Retrieve previous checked items from session storage, to prevent them to be unselected
529//                if (($(this).prop('checked') || checkedItems > 0) && typeof (Storage) !== "undefined" && sessionStorage.filtroTag && !filtroVoc) {
530//                    if (JSON.parse(sessionStorage.filtroTag).Job.length > 0) {
531//                        for (i = 0; i < JSON.parse(sessionStorage.filtroTag).Job.length; i++) {
532//                            $("#checkBoxJob_" + JSON.parse(sessionStorage.filtroTag).Job[i]).prop("checked", true);
533//                        }
534//                        updateSpeciality(getTag_Profissional(3).d);
535//                        if (JSON.parse(sessionStorage.filtroTag).Speciality.length > 0) {
536//                            for (i = 0; i < JSON.parse(sessionStorage.filtroTag).Speciality.length; i++) {
537//                                $("#checkBoxSpeciality_" + JSON.parse(sessionStorage.filtroTag).Speciality[i]).prop("checked", true);
538//                            }
539//                        }
540//                    }
541//                    updateHeadersCount(false);
542//                }
543
544//                getProfissao(0, 0);
545//            }, 500
546//        )
547//    );
548
549//    $("#jobBox").click(function () {
550//        if ($("#tabJob").attr("class") == "openTextWhite") {
551//            $("#tabJob").attr("class", "closeTextWhite");
552//            $("#Filter_Job").parent().show('fast');
553
554//        }
555//        else {
556//            $("#Filter_Job").parent().hide('fast');
557//            $("#tabJob").attr("class", "openTextWhite");
558//        }
559//    }).keypress(function (e) {
560//        var key = e.which;
561//        if (key == 13)  // the enter key code
562//        {
563//            $("#jobBox").click();
564//        }
565//    });
566
567//    $("#specialityBox").click(function () {
568//        if ($("#tabSpeciality").attr("class") == "openTextWhite") {
569//            $("#tabSpeciality").attr("class", "closeTextWhite");
570//            $("#Filter_Speciality").parent().show('fast');
571//        }
572//        else {
573//            $("#Filter_Speciality").parent().hide('fast');
574//            $("#tabSpeciality").attr("class", "openTextWhite");
575//        }
576//    }).keypress(function (e) {
577//        var key = e.which;
578//        if (key == 13)  // the enter key code
579//        {
580//            $("#specialityBox").click();
581//        }
582//    });
583
584//    //Filtros Vocacionais
585//    //Dominios
586//    if ($('input[name="domainOption"]:checked').length > 0) {
587//        $('#domainNumber').html('(' + $('input[name="domainOption"]:checked').length + ')');
588//    } else {
589//        $('#domainNumber').html('');
590//    }
591//    $("#domainBox").click(function () {
592//        if ($("#tabDomain").attr("class") == "openTextWhite") {
593//            $("#tabDomain").attr("class", "closeTextWhite");
594//            $("#Filter_Domain").parent().show('fast');
595//        }
596//        else {
597//            $("#Filter_Domain").parent().hide('fast');
598//            $("#tabDomain").attr("class", "openTextWhite");
599//        }
600//    }).keypress(function (e) {
601//        var key = e.which;
602//        if (key == 13)  // the enter key code
603//        {
604//            $("#domainBox").click();
605//        }
606//    });
607//    $('input[name=domainOption]').click(
608//        _.debounce(
609//            function (e) {
610//                var checkedItems = $('input[name="domainOption"]:checked').length;
611//                if (checkedItems > 0) {
612//                    $('#domainNumber').html('(' + checkedItems + ')');
613//                    updateAreaVoc(getTag_Voc(2).d);
614//                    updateCharact([]);
615//                } else {
616//                    $('#domainNumber').html('');
617//                    updateAreaVoc([]);
618//                    updateCharact([]);
619//                }
620//                $(this).parent().attr('aria-checked', $(this).prop('checked'));
621
622//                getProfissao(0, 0);
623//            }, 500
624//        )
625//    );
626
627//    //AreaVoc
628//    $("#areaVocBox").click(function () {
629//        if ($("#tabAreaVoc").attr("class") == "openTextWhite") {
630//            $("#tabAreaVoc").attr("class", "closeTextWhite");
631//            $("#Filter_AreaVoc").parent().show('fast');
632//        }
633//        else {
634//            $("#Filter_AreaVoc").parent().hide('fast');
635//            $("#tabAreaVoc").attr("class", "openTextWhite");
636//        }
637//    }).keypress(function (e) {
638//        var key = e.which;
639//        if (key == 13)  // the enter key code
640//        {
641//            $("#areaVocBox").click();
642//        }
643//    });
644//    //Caracteristicas
645//    $("#charactBox").click(function () {
646//        if ($("#tabCharact").attr("class") == "openTextWhite") {
647//            $("#tabCharact").attr("class", "closeTextWhite");
648//            $("#Filter_Charact").parent().show('fast');
649//        }
650//        else {
651//            $("#Filter_Charact").parent().hide('fast');
652//            $("#tabCharact").attr("class", "openTextWhite");
653//        }
654//    }).keypress(function (e) {
655//        var key = e.which;
656//        if (key == 13)  // the enter key code
657//        {
658//            $("#charactBox").click();
659//        }
660//    });
661
662//    $('#limparFiltros').click(function () {
663//        sessionStorage.removeItem("filtroTag" + (filtroVoc?"Voc":"") );
664//        location.reload();
665//    });
666//    $('#limparFiltros').hide();
667//    if (typeof (Storage) !== "undefined") {
668//        if (sessionStorage.filtroTag && !filtroVoc ||
669//            sessionStorage.filtroTagVoc && filtroVoc) {
670//            $('#limparFiltros').show();
671//        }
672//    }
673//}
674
675var processing = false;
676var pageprofs = 0;
677var countProfs = 0;
678function getProfissao(itemID, page) {
679
680    var filterVal = $("#select_filter").val();
681
682    if (page == 0) {
683        $('#demo1').html('');
684        pageprofs = 0;
685        countProfs = 0;
686    }
687
688    if (page > countProfs) {
689        return false;
690    }
691
692    var filtroTag = new Object();
693    var filtroTagVoc = new Object();
694
695    filtroTag.Texto = filtroPesquisa.toString();
696    filtroTagVoc.Texto = filtroPesquisa.toString();
697
698    var vec = new Array();
699
700    filtroTag.Area = vec;
701    filtroTag.Job = vec;
702    filtroTag.Speciality = vec;
703    filtroTag.Empresa = vec;
704
705    filtroTagVoc.Domain = vec;
706    filtroTagVoc.AreaVoc = vec;
707    filtroTagVoc.Charact = vec;
708    filtroTagVoc.Empresa = vec;
709    //if (filterVal == 1) {
710    //    vec = new Array();
711    //    $('input[name=areaOption]:checked').each(function () {
712    //        vec.push($(this).val());
713    //    });
714    //    filtroTag.Area = vec;
715
716    //    vec = new Array();
717    //    $('input[name=jobOption]:checked').each(function () {
718    //        vec.push($(this).val());
719    //    });
720    //    filtroTag.Job = vec;
721
722    //    vec = new Array();
723    //    $('input[name=specialityOption]:checked').each(function () {
724    //        vec.push($(this).val());
725    //    });
726    //    filtroTag.Speciality = vec;
727
728    //    if (typeof (Storage) !== "undefined" && filtroTag.Area.length > 0) {
729    //        sessionStorage.filtroTag = JSON.stringify(filtroTag);
730    //        $('#limparFiltros').show();
731    //    }
732    //    else {
733    //        sessionStorage.filtroTag = '';
734    //        $('#limparFiltros').hide();
735    //    }
736    //} else {
737    //    vec = new Array();
738    //    $('input[name=domainOption]:checked').each(function () {
739    //        vec.push($(this).val());
740    //    });
741    //    filtroTagVoc.Domain = vec;
742
743    //    vec = new Array();
744    //    $('input[name=areaVocOption]:checked').each(function () {
745    //        vec.push($(this).val());
746    //    });
747    //    filtroTagVoc.AreaVoc = vec;
748
749    //    vec = new Array();
750    //    $('input[name=charactOption]:checked').each(function () {
751    //        vec.push($(this).val());
752    //    });
753    //    filtroTagVoc.Charact = vec;
754
755    //    if (typeof (Storage) !== "undefined" && filtroTagVoc.Domain.length > 0) {
756    //        sessionStorage.filtroTagVoc = JSON.stringify(filtroTagVoc);
757    //        $('#limparFiltros').show();
758    //    }
759    //    else {
760    //        sessionStorage.filtroTagVoc = '';
761    //        $('#limparFiltros').hide();
762    //    }
763    //}
764
765    var ordem = $('#select_ordem').val();
766    $('#noResults').hide();
767    $.ajax({
768        type: "POST",
769        url: "inclusivefuture.aspx/GetProfissao_filter",
770        data: JSON.stringify({ "id": itemID, "ordem": ordem, "filtroTag": filtroTag, "filtroTagVoc": filtroTagVoc, "page": page, "rows": rowsPerPage }),
771        contentType: "application/json; charset=utf-8",
772        dataType: "json",
773        async: true,
774        beforeSend: function () {
775            $('#gridLoading').fadeIn();
776        }
777    })
778        .done(function (data) {
779            if (page == 0) {
780                $('#demo1').html('');
781            }
782            updateProfissão(data)
783        })
784        .fail(function () {
785            alert("error");
786        })
787        .always(function () {
788            $('#gridLoading').fadeOut();
789            // alert("complete");
790        });
791
792}
793
794function updateProfissão(result) {
795
796    var data = result.d;
797    var sAux = '';
798    var sAux2 = '';
799
800    if (result == false) {
801        return false;
802    }
803
804    if (data.length == 0 && pageprofs == 0) {
805        $('#noResults').show();
806        return false;
807    }
808    $.each(data, function (i, item) {
809
810        countProfs = item.Count;
811
812        sAux2 += '<div aria-label="Profissão ' + item.Nome + '. Descrição: ' + item.Descricao + ' Clique para saber mais na página da Profissão." tabindex=0 role="img" id="prof_' + item.ID + '" class="item standard" data-w="475" data-h="268" onclick="goTo(\'' + item.NomeUrl + '\')" style="cursor:pointer;"><img src="images/empty.png" data-src="' + imageFolder + '/Thumbnails/' + item.ImageID + '" style="width:100%;"/>';
813
814        if (userlogged != 0) {
815            sAux2 += '<div class="favoriteSign favResp"></div>';
816        }
817
818        sAux2 += '<div class="overlayImage">';
819        sAux2 += '<div  class="boxHomeGridHeader" >';
820        sAux2 += '<p>' + item.Nome + '</p>';
821        sAux2 += '</div>';
822        sAux2 += '<div class="boxHomeGridBody">';
823        sAux2 += '<p>' + item.Descricao + '</p>';
824        sAux2 += '</div>';
825
826        sAux2 += '</div>';
827        sAux2 += '</div>';
828
829        $('#demo1').append(sAux2);
830        sAux2 = '';
831
832        sAux = '';
833
834
835        $('div#prof_' + item.ID + '').mouseenter(function () {
836            $(this).find('.overlayImage').show("slide", { direction: "down" }, 250);
837            $(this).find('.favoriteSign').show();
838        })
839            .mouseleave(function () {
840                if ($('.acessibility').is(':visible')) {
841                    $(this).find('.overlayImage').stop(true, true).hide("slide", { direction: "down" }, 250);
842                    $(this).find('.favoriteSign').hide();
843                }
844            }).focus(function () {
845                $(this).mouseenter();
846            })
847            .focusout(function () {
848                $(this).mouseleave();
849            }).keypress(function (e) {
850                var key = e.which;
851                if (key == 13)  // the enter key code
852                {
853                    onclick = goTo(item.NomeUrl);
854                }
855                else if (key == 108)  // the L key code
856                {
857                    if ($("#prof_" + item.ID + " .favoriteSign").hasClass('active')) {
858                        deleteFavs(item.ID);
859                    } else {
860                        insertFavs(item.ID);
861                    }
862                }
863            });
864
865        $("#prof_" + item.ID + " .favoriteSign").click(function (e) {
866            if ($(this).hasClass('active')) {
867                deleteFavs(item.ID);
868            } else {
869                insertFavs(item.ID);
870            }
871            e.stopPropagation();
872        });
873
874
875    });
876
877
878    if ($('#acess_2').hasClass('active')) {
879        $('.boxHomeGridHeader').addClass('acess2');
880        $('.boxHomeGridHeader').removeClass('acess3');
881        $('.boxHomeGridBody').addClass('acess2');
882        $('.boxHomeGridBody').removeClass('acess3');
883        $('.overlayImage').addClass('acess2');
884        $('.overlayImage').removeClass('acess3');
885    } else if ($('#acess_3').hasClass('active')) {
886        $('.boxHomeGridHeader').addClass('acess3');
887        $('.boxHomeGridHeader').removeClass('acess2');
888        $('.boxHomeGridBody').addClass('acess2');
889        $('.boxHomeGridBody').removeClass('acess3');
890
891        $('.overlayImage').addClass('acess3');
892        $('.overlayImage').removeClass('acess2');
893    }
894
895
896    $('#demo1').flexImages({ rowHeight: 268 });
897
898    pageprofs = pageprofs + 6;
899    processing = false;
900    updateFavoritos(getFavoritos());
901}
902
903$(document).ready(function () {
904    $("#select_filter").change(function () {
905        if ($("#select_filter").val() == 1) {
906            window.location.href = 'inclusivefuture.aspx';
907        } else {
908            window.location.href = 'inclusivefuture.aspx?fil=4';
909        }
910        getProfissao(0, 0);
911    });
912    checkPageURL();
913    initTooltip();
914});
915
916function initTooltip() {
917    $('.tooltip').tooltipster({
918        animation: 'fade',
919        delay: 20,
920        theme: ['tooltipster-noir', 'tooltipster-noir-customized'],
921        side: 'right',
922        interactive: true,
923        contentAsHTML: true,
924        maxWidth: 500,
925        debug: false
926    });
927}
928
929function getTag_Profissional(tagTipo) {
930    var filtroTag = new Object();
931    var vec = new Array();
932
933    filtroTag.Area = vec;
934    filtroTag.Job = vec;
935    filtroTag.Speciality = vec;
936
937    vec = new Array();
938    $('input[name=areaOption]:checked').each(function () {
939        vec.push($(this).val());
940    });
941    filtroTag.Area = vec;
942
943    vec = new Array();
944    $('input[name=jobOption]:checked').each(function () {
945        vec.push($(this).val());
946    });
947    filtroTag.Job = vec;
948
949    vec = new Array();
950    $('input[name=specialityOption]:checked').each(function () {
951        vec.push($(this).val());
952    });
953    filtroTag.Speciality = vec;
954
955    var data = $.ajax({
956        type: "POST",
957        url: "inclusivefuture.aspx/GetTag_Prof_tagTipo",
958        data: JSON.stringify({ "tagTipo": tagTipo, 'filtroTag': filtroTag }),
959        contentType: "application/json; charset=utf-8",
960        dataType: "json",
961        async: false
962    }).responseText;
963    data = JSON.parse(data);
964    return data;
965}
966
967function getTag_ProfissionalNoFilter(tagTipo) {
968
969    var data = $.ajax({
970        type: "POST",
971        url: "inclusivefuture.aspx/GetTag_Prof_tagTipoNoFilter",
972        data: JSON.stringify({ "tagTipo": tagTipo }),
973        contentType: "application/json; charset=utf-8",
974        dataType: "json",
975        async: false
976    }).responseText;
977    data = JSON.parse(data);
978    return data;
979}
980
981function getTag_Voc(tagTipo) {
982    var filtroTag = new Object();
983    var vec = new Array();
984
985    filtroTag.Domain = vec;
986    filtroTag.AreaVoc = vec;
987    filtroTag.Charact = vec;
988
989    vec = new Array();
990    $('input[name=domainOption]:checked').each(function () {
991        vec.push($(this).val());
992    });
993    filtroTag.Domain = vec;
994
995    vec = new Array();
996    $('input[name=areaVocOption]:checked').each(function () {
997        vec.push($(this).val());
998    });
999    filtroTag.AreaVoc = vec;
1000
1001    vec = new Array();
1002    $('input[name=charactOption]:checked').each(function () {
1003        vec.push($(this).val());
1004    });
1005    filtroTag.Charact = vec;
1006
1007    var data = $.ajax({
1008        type: "POST",
1009        url: "inclusivefuture.aspx/GetTag_Voc_tagTipo",
1010        data: JSON.stringify({ "tagTipo": tagTipo, 'filtroTag': filtroTag }),
1011        contentType: "application/json; charset=utf-8",
1012        dataType: "json",
1013        async: false
1014    }).responseText;
1015    data = JSON.parse(data);
1016    return data;
1017}
1018
1019function getTag_VocNoFilter(tagTipo) {
1020
1021    var data = $.ajax({
1022        type: "POST",
1023        url: "inclusivefuture.aspx/GetTag_Voc_tagTipoNoFilter",
1024        data: JSON.stringify({ "tagTipo": tagTipo }),
1025        contentType: "application/json; charset=utf-8",
1026        dataType: "json",
1027        async: false
1028    }).responseText;
1029    data = JSON.parse(data);
1030    return data;
1031}
1032
1033
1034
1035
1036
1037$('#filter_search').keyup(_.debounce(function (e) {
1038
1039    var key = e.which;
1040    if (key != 13)  // the enter key code
1041    {
1042        if ($('#filter_search').val().length > 2) {
1043            filtroPesquisa = $('#filter_search').val();
1044            getProfissao(0, 0);
1045        } else if (filtroPesquisa != "") {
1046            filtroPesquisa = "";
1047            getProfissao(0, 0);
1048        }
1049    } else {
1050        if ($('#filter_search').val() != "") {
1051            $('#filter_search').blur();
1052            setTimeout(function () {
1053                filtroPesquisa = $('#filter_search').val();
1054                getProfissao(0, 0);
1055            }, 300);
1056        }
1057    }
1058}, 500));
1059
1060$("#select_ordem").change(function () {
1061    getProfissao(0, 0);
1062});
1063
1064function getFavoritos() {
1065    var data = $.ajax({
1066        type: "POST",
1067        url: "inclusivefuture.aspx/GetFavoritos",
1068        contentType: "application/json; charset=utf-8",
1069        dataType: "json",
1070        async: false
1071    }).responseText;
1072    data = JSON.parse(data);
1073    return data;
1074}
1075
1076function updateFavoritos(result) {
1077
1078    var data = result.d;
1079
1080    $.each(data, function (i, item) {
1081
1082        $("#profImg" + item.ID + "").find(".favoriteSign").addClass('active');
1083        $('div#prof_' + item.ID + '').find(".favoriteSign").addClass('active');
1084
1085    });
1086
1087}
1088
1089function insertFavs(prof) {
1090    var data = $.ajax({
1091        type: "POST",
1092        url: "inclusivefuture.aspx/InsertFavs",
1093        data: JSON.stringify({ 'prof': prof }),
1094        contentType: "application/json; charset=utf-8",
1095        dataType: "json",
1096        async: false
1097    }).responseText;
1098    data = JSON.parse(data);
1099    if (data.d == 'OK') {
1100        $("#profImg" + prof).find(".favoriteSign").addClass('active');
1101        $('div#prof_' + prof).find(".favoriteSign").addClass('active');
1102        return true;
1103    } else {
1104        //alert(data.d); //Erro!
1105    }
1106    return false;
1107}
1108
1109
1110function deleteFavs(prof) {
1111    var data = $.ajax({
1112        type: "POST",
1113        url: "inclusivefuture.aspx/DeleteFavs",
1114        data: JSON.stringify({ 'prof': prof }),
1115        contentType: "application/json; charset=utf-8",
1116        dataType: "json",
1117        async: false
1118    }).responseText;
1119    data = JSON.parse(data);
1120    if (data.d == 'OK') {
1121        $("#profImg" + prof + "").find(".favoriteSign").removeClass('active');
1122        $('div#prof_' + prof + '').find(".favoriteSign").removeClass('active');
1123        return true;
1124    } else {
1125        //alert(data.d); //Erro!!                
1126    }
1127    return false;
1128}
1129
1130function updateDomain(result) {
1131    var data = result;
1132    $('#Filter_Domain').html('');
1133    $.each(data, function (i, item) {
1134
1135        buildRadioButtonItem('Domain', item);
1136
1137        if (i != data.length - 1)
1138            $('<hr />').appendTo('#Filter_Domain');
1139        if (tagsList.domainID == item.ID) {
1140            $("#checkBoxDomain_" + item.ID + "").prop('checked', true);
1141            $("#checkBoxDomain_" + item.ID + "").attr('aria-checked', true);
1142        }
1143
1144        $('#checkBoxDomain_' + item.ID).parent().keypress(function (e) {
1145            e.preventDefault();
1146            var key = e.which;
1147            if (key == 32)  // the enter key code
1148            {
1149                if ($('#checkBoxDomain_' + item.ID).is(":checked")) {
1150                    $('#checkBoxDomain_' + item.ID).prop("checked", false);
1151                    $('#checkBoxDomain_' + item.ID).parent().attr('aria-checked', false);
1152                }
1153                else {
1154                    $('#checkBoxDomain_' + item.ID).prop("checked", true);
1155                    $('#checkBoxDomain_' + item.ID).parent().attr('aria-checked', true);
1156                }
1157                getProfissao(0, 0);
1158            } else if (key == 13)  // the enter key code
1159            {
1160                $("#domainBox").click();
1161                $("#domainBox").focus();
1162            }
1163        });
1164
1165    });
1166    $('#Filter_Domain').val('');
1167
1168    if ($('input[name="domainOption"]:checked').length > 0) {
1169        $('#domainNumber').html('(' + $('input[name="domainOption"]:checked').length + ')');
1170        updateAreaVoc(getTag_Voc(2).d);
1171    } else {
1172        $('#domainNumber').html('');
1173    }
1174}
1175
1176function updateAreaVoc(result) {
1177    var data = result;
1178    $('#Filter_AreaVoc').html('');
1179
1180    $('#areaVocNumber').html('');
1181
1182    if (data.length == 0) {
1183        $('#areaVocBox').parent().hide();
1184        return;
1185    } else {
1186        $('#areaVocBox').parent().show();
1187    }
1188
1189    $.each(data, function (i, item) {
1190
1191        buildRadioButtonItem('AreaVoc', item);
1192
1193        if (i != data.length - 1)
1194            $('<hr />').appendTo('#Filter_AreaVoc');
1195        if (tagsList.areaVocID == item.ID) {
1196            $("#checkBoxAreaVoc_" + item.ID + "").prop('checked', true);
1197            $('#checkBoxAreaVoc_' + item.ID).parent().attr('aria-checked', true);
1198        }
1199
1200        $('#checkBoxAreaVoc_' + item.ID).parent().keypress(function (e) {
1201            e.preventDefault();
1202            var key = e.which;
1203            if (key == 32)  // the enter key code
1204            {
1205                if ($('#checkBoxAreaVoc_' + item.ID).is(":checked")) {
1206                    $('#checkBoxAreaVoc_' + item.ID).prop("checked", false);
1207                    $('#checkBoxAreaVoc_' + item.ID).parent().attr('aria-checked', false);
1208                }
1209                else {
1210                    $('#checkBoxAreaVoc_' + item.ID).prop("checked", true);
1211                    $('#checkBoxAreaVoc_' + item.ID).parent().attr('aria-checked', true);
1212                }
1213                getProfissao(0, 0);
1214            } else if (key == 13)  // the enter key code
1215            {
1216                $("#areaVocBox").click();
1217                $("#areaVocBox").focus();
1218            }
1219        });
1220    });
1221
1222    $('#Filter_AreaVoc').val('');
1223
1224    $('input[name=areaVocOption]').click(
1225        _.debounce(
1226            function (e) {
1227                var checkedItems = $('input[name="areaVocOption"]:checked').length;
1228                if (checkedItems > 0) {
1229                    $('#areaVocNumber').html('(' + checkedItems + ')');
1230                    updateCharact(getTag_Voc(3).d);
1231                } else {
1232                    $('#areaVocNumber').html('');
1233                    updateCharact([]);
1234                }
1235                $(this).parent().attr('aria-checked', $(this).prop('checked'));
1236
1237                // Retrieve previous checked items from session storage, to prevent them to be unselected
1238                if (($(this).prop('checked') || checkedItems > 0) && typeof (Storage) !== "undefined" && sessionStorage.filtroTagVoc && filtroVoc) {
1239                    if (JSON.parse(sessionStorage.filtroTagVoc).Charact.length > 0) {
1240                        for (i = 0; i < JSON.parse(sessionStorage.filtroTagVoc).Charact.length; i++) {
1241                            $("#checkBoxCharact_" + JSON.parse(sessionStorage.filtroTagVoc).Charact[i]).prop("checked", true);
1242                        }
1243                    }
1244                    updateHeadersCount(true);
1245                }
1246
1247                getProfissao(0, 0);
1248            }, 500
1249        )
1250    );
1251
1252    if ($('input[name="areaVocOption"]:checked').length > 0) {
1253        $('#areaVocNumber').html('(' + $('input[name="areaVocOption"]:checked').length + ')');
1254        updateCharact(getTag_Voc(3).d);
1255        getProfissao(0, 0);
1256    } else {
1257        $('#areaVocNumber').html('');
1258        updateCharact([]);
1259    }
1260}
1261
1262function updateCharact(result) {
1263    var data = result;
1264    $('#Filter_Charact').html('');
1265    $('#charactNumber').html('');
1266
1267    if (data.length == 0) {
1268        $('#charactBox').parent().hide();
1269        return;
1270    } else {
1271        $('#charactBox').parent().show();
1272    }
1273    $.each(data, function (i, item) {
1274
1275        buildCheckboxItem('Charact', item);
1276
1277        if (i != data.length - 1)
1278            $('<hr />').appendTo('#Filter_Charact');
1279        if (tagsList.charactID == item.ID) {
1280            $("#checkBoxCharact_" + item.ID + "").prop('checked', true);
1281            $('#checkBoxCharact_' + item.ID).parent().attr('aria-checked', true);
1282        }
1283        $('#checkBoxCharact_' + item.ID).parent().keypress(function (e) {
1284            e.preventDefault();
1285            var key = e.which;
1286            if (key == 32)  // the enter key code
1287            {
1288                if ($('#checkBoxCharact_' + item.ID).is(":checked")) {
1289                    $('#checkBoxCharact_' + item.ID).prop("checked", false);
1290                    $('#checkBoxCharact_' + item.ID).parent().attr('aria-checked', false);
1291                }
1292                else {
1293                    $('#checkBoxCharact_' + item.ID).prop("checked", true);
1294                    $('#checkBoxCharact_' + item.ID).parent().attr('aria-checked', true);
1295                }
1296                getProfissao(0, 0);
1297            } else if (key == 13)  // the enter key code
1298            {
1299                $("#charactBox").click();
1300                $("#charactBox").focus();
1301            }
1302        });
1303    });
1304    $('#Filter_Charact').val('');
1305
1306
1307    $('input[name=charactOption]').click(
1308        _.debounce(
1309            function (e) {
1310                if ($('input[name="charactOption"]:checked').length > 0) {
1311                    $('#charactNumber').html('(' + $('input[name="charactOption"]:checked').length + ')');
1312                } else {
1313                    $('#charactNumber').html('');
1314                }
1315                $(this).parent().attr('aria-checked', $(this).prop('checked'));
1316                getProfissao(0, 0);
1317            }, 500
1318        )
1319    );
1320
1321    if ($('input[name="charactOption"]:checked').length > 0) {
1322        $('#charactNumber').html('(' + $('input[name="charactOption"]:checked').length + ')');
1323    } else {
1324        $('#charactNumber').html('');
1325    }
1326}
1327
1328function updateHeadersCount(filtroVoc) {
1329    if (!filtroVoc) {
1330        if ($('input[name="jobOption"]:checked').length > 0) {
1331            $('#jobNumber').html('(' + $('input[name="jobOption"]:checked').length + ')');
1332        } else {
1333            $('#jobNumber').html('');
1334        }
1335        if ($('input[name="specialityOption"]:checked').length > 0) {
1336            $('#specialityNumber').html('(' + $('input[name="specialityOption"]:checked').length + ')');
1337        } else {
1338            $('#specialityNumber').html('');
1339        }
1340    } else {
1341        if ($('input[name="areaVocOption"]:checked').length > 0) {
1342            $('#areaVocNumber').html('(' + $('input[name="areaVocOption"]:checked').length + ')');
1343        } else {
1344            $('#areaVocNumber').html('');
1345        }
1346        if ($('input[name="charactOption"]:checked').length > 0) {
1347            $('#charactNumber').html('(' + $('input[name="charactOption"]:checked').length + ')');
1348        } else {
1349            $('#charactNumber').html('');
1350        }
1351    }
1352}
1353
1354function getURLParam(key, target) {
1355    var values = [];
1356    if (!target) {
1357        target = location.href;
1358    }
1359
1360    key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
1361
1362    var pattern = key + '=([^&#]+)';
1363    var o_reg = new RegExp(pattern, 'ig');
1364    while (true) {
1365        var matches = o_reg.exec(target);
1366        if (matches && matches[1]) {
1367            values.push(matches[1]);
1368        }
1369        else {
1370            break;
1371        }
1372    }
1373
1374    if (!values.length) {
1375        return null;
1376    }
1377    else {
1378        return values.length == 1 ? values[0] : values;
1379    }
1380
1381}
1382
1383function applyAjudaText() {
1384
1385    $.ajax({
1386        type: "POST",
1387        url: "discover.aspx/GetAjudaText",
1388        data: JSON.stringify({ "Cod": "INCLUSIVE_FUTURE" }),
1389        contentType: "application/json; charset=utf-8",
1390        dataType: "json",
1391        async: true
1392    })
1393        .done(function (data) {
1394            var ajuda = data.d;
1395            var p = $("#ajudaText");
1396            if (p.length && ajuda.Conteudo) {
1397                p.append(ajuda.Conteudo).show();
1398            }
1399        })
1400        .fail(function () {
1401            alert("error");
1402        });
1403
1404}

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.