PageSourceSearch

https://aeroscreen.ru/bitrix/templates/concept_phoenix_s1/js/forms.js

js aeroscreen.ru collected 2026-10-08 23:50:10 UTC 33,771 bytes, 1,064 lines download raw bytes

1$(document).ready(function(){
2        
3    $("input[type='email'], input[type='text'], input[type='password'], textarea", "form").focus(function()
4    {
5        $(this).parent().removeClass("has-error");
6    });
7});
8
9$(window).on("load", function() {
10    cur_pos = $(document).scrollTop();
11    $("input.urlpage").val(location.href);
12});
13
14
15$(document).on('change', "form input[type='file'].flat",
16    function()
17    {
18        var inp = $(this);
19        var btn = inp.parent();
20        var lbl = btn.find("span.ex-file");
21        var file_api = (window.File && window.FileReader && window.FileList && window.Blob) ? true : false;
22    
23        if (file_api && inp[0].files[0])
24            file_name = inp[0].files[0].name;
25        else{
26            file_name = inp.val().replace("C:\\fakepath\\", '');
27        }
28
29        if (!file_name.length)
30            return;
31
32        if (lbl.is(":visible")) {
33            lbl.text(file_name);
34
35        }
36        else{
37            btn.text(file_name);
38        }
39
40        inp.parents(".clearfile-parent").find('input.phoenix_file_del').val('');
41
42        
43        btn.addClass('focus-anim for-download');
44        inp.parents(".clearfile-parent").find(".clearfile").addClass('on');
45    }
46);
47
48$(document).on('change', ".form.send input[type='file']",
49    function(){
50
51        var inp = $(this);
52        var file_list_name = "";
53
54        $(inp[0].files).each(
55            function(key){
56                file_list_name += "<span>"+inp[0].files[key].name+"</span><br/>";
57            }
58        );
59
60
61        if(!file_list_name.length)
62            return;
63
64        inp.parents('form.send').addClass('file-download');
65        inp.parents('label').find('.area-files-name').html(file_list_name);
66        inp.parents('label').removeClass("area-file");
67        inp.closest('.load-file').removeClass("has-error");
68
69    }
70);
71
72$(document).on("click", "div.wrap-agree input[type='checkbox']", function() {
73    $(this).parents("div.wrap-agree").removeClass("has-error");
74});
75
76function validGroupCheckbox(arParams){
77
78    var error = 0;
79
80    for (key in arParams){
81
82        var cheked = false;
83
84        for (var i = 0; i < arParams[key].length; i++){
85
86            if(arParams[key][i].checked)
87                cheked = true;
88        }
89
90        if(!cheked)
91        {
92            if(error == 0)
93                error = 1;
94
95            for (var i = 0; i < arParams[key].length; i++){
96
97                $(arParams[key][i]).addClass('has-error');
98            }
99        }
100    }
101
102    return error;
103}
104
105function validGroupSelect(arParams){
106    var error = 0;
107
108    for (key in arParams){
109
110        var cheked = false;
111
112        for (var i = 0; i < arParams[key].length; i++){
113
114            if(arParams[key][i].checked)
115                cheked = true;
116        }
117
118        if(!cheked)
119        {
120            if(error == 0)
121                error = 1;
122
123            $(arParams[key][0]).parents(".form-select").addClass('has-error');
124        }
125    }
126    return error;
127}
128
129function sendForm(arParams)
130{
131    var error = 0,
132        formSendAll = new FormData();
133
134
135    formSendAll.append("send", "Y");
136    formSendAll.append("element", arParams.form_block.attr("id").replace("form-", ""));
137    formSendAll.append("tmpl_path", $("input.tmpl_path").val());
138    formSendAll.append("typeForm", arParams.typeForm);
139    formSendAll.append("fromBasket", arParams.fromBasket);
140    formSendAll.append("site_id", $("input.site_id").val());
141    formSendAll.append("url", location.href);
142
143    
144
145    for (var i = 1; i <= 10; i++) {
146        if($("input#custom-input-"+i).val().length>0)
147            formSendAll.append("custom-input-"+i, $("input#custom-input-"+i).val());
148    }
149
150    for (var i = 1; i <= 3; i++) {
151        if($("input#custom-dynamic-input-"+i).val().length>0)
152            formSendAll.append("custom-dynamic-input-"+i, $("input#custom-dynamic-input-"+i).val());
153    }
154
155
156    if (typeof(arParams.agreecheck.val()) != "undefined") {
157        if (!arParams.agreecheck.prop("checked")) {
158            arParams.agreecheck.parents("div.wrap-agree").addClass("has-error");
159            error = 1;
160        }
161    }
162
163    $("input[type='email'], input[type='text'], input[type='password'], textarea", arParams.form_block).each(
164        function(key, value)
165        {
166            if ($(this).hasClass("email") && $(this).val().length > 0) {
167                if (!(
168                        /^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,15}$/i
169                    ).test($(this).val())) {
170                    $(this).parent("div.input").addClass("has-error");
171                    error = 1;
172                }
173            }
174            if ($(this).hasClass("require")) {
175                if ($(this).val().trim().length <= 0){
176                    $(this).val("");
177                    $(this).parent("div.input").addClass("has-error");
178                    error = 1;
179                }
180            }
181        }
182    );
183
184    $("input[type='file']", arParams.form_block).each(function(key, value)
185    {
186
187        if ($(this).hasClass("require"))
188        {
189
190            if ($(this).closest('.load-file').find('.area-file').length>0) {
191                $(this).closest('.load-file').addClass("has-error");
192                error = 1;
193            }
194        }
195    });
196
197    if (!$('.phoenix-modal').hasClass('form-modal'))
198    {
199        var otherHeight = 0;
200        if ($('header').hasClass('fixed')) 
201            otherHeight = $('.fix-board').outerHeight(
202            true);
203    }
204
205
206    var arChecbox = {}, newKey = null;
207
208    $("input.check-require[type='checkbox']", arParams.form_block).each(
209        function(key, value)
210        {
211            newKey = $(this).attr('name').replace("[]", "");
212
213            if(typeof arChecbox[newKey] == "undefined")
214                arChecbox[newKey] = [];
215            
216            arChecbox[newKey].push(this);
217        }
218    );
219
220    if(newKey && !error)
221        error = validGroupCheckbox(arChecbox);
222
223    delete arChecbox;
224    newKey = null;
225
226    var arRadio = {};
227    $(".select-require input.opinion[type='radio']", arParams.form_block).each(
228        function(key, value)
229        {
230            newKey = $(this).attr('name');
231
232            if(typeof arRadio[newKey] == "undefined")
233                arRadio[newKey] = [];
234            
235            arRadio[newKey].push(this);
236        }
237    );
238
239    if(newKey && !error)
240        error = validGroupSelect(arRadio);
241
242    delete arRadio;
243    newKey = null;
244
245    
246    if (error == 1)
247    {
248
249        if ($('.phoenix-modal').hasClass('form-modal'))
250        {
251            formAttentionScroll(
252                arParams.form_block.find('.has-error:first').offset().top - arParam
252s.form_block.parents('.phoenix-modal-dialog').offset().top, 
253                ".phoenix-modal");
254        } 
255        else if (arParams.form_block.hasClass('form-cart'))
256        {
257            formAttentionScroll(
258                arParams.form_block.find('.has-error:first').offset().top - arParams.form_block.find(".body").offset().top, 
259                ".cart-parent");
260        }
261        else
262        {
263            formAttentionScroll(arParams.form_block.find('.has-error:first').offset().top - otherHeight, 
264            "html:not(:animated), body:not(:animated)");
265
266        }
267    }
268
269    if (error == 0)
270    {
271        
272
273        arParams.form_block.css({
274            "height": arParams.form_block.outerHeight() + "px"
275        });
276
277        if ($("body").hasClass('yandex-captcha')) {
278            if (!arParams.captchaToken || arParams.captchaToken.length === 0) {
279                var $cap = arParams.form_block.find('#captcha-container, .smart-captcha').first();
280                if ($cap.length) $cap.addClass('has-error');
281                arParams.button.addClass("active");
282                arParams.load.removeClass("active");
283                return; 
284            } else {
285                arParams.form_block.find('#captcha-container, .smart-captcha').first().removeClass('has-error');
286            }
287        }
288        var form_arr = arParams.form_block.find(':input,select,textarea').serializeArray();
289
290        for (var i = 0; i < form_arr.length; i++)
291        {
292            if (form_arr[i].value.length > 0)
293            { 
294                formSendAll.append(form_arr[i].name, form_arr[i].value);
295            }
296        };
297
298        if (arParams.form_block.hasClass('file-download'))
299        {
300            arParams.form_block.find('input[type=file]').each(function(key)
301            {
302
303                var inp = $(this);
304                var file_list_name = "";
305
306                $(inp[0].files).each(
307                    function(k){
308                        formSendAll.append(inp.attr('name'), inp[0].files[k], inp[0].files[k].name);
309                    }
310                );
311
312            });
313        }
314
315        if(arParams.captchaToken.length>0)
316            formSendAll.append("captchaToken", arParams.captchaToken);
317
318
319        arParams.button.removeClass("active");
320        arParams.load.addClass("active");
321
322        setTimeout(function()
323        {
324            $.ajax({
325                url: arParams.path,
326                method: 'POST',
327                contentType: false,
328                processData: false,
329                data: formSendAll,
330                dataType: 'json',
331                success: function(json)
332                {
333                    if(typeof (json.OK) != "undefined" )
334                    {
335                         
336                        if(json.OK == "N")
337                        {
338                            arParams.button.addClass("active");
339                            arParams.load.removeClass("active");
340                        }
341
342                        if (json.OK == "Y")
343                        {
344
345                            if(arParams.typeForm != "fast_order")
346                            {
347                                arParams.questions.removeClass("active");
348                                arParams.thank.addClass("active");
349
350                                if(typeof(arParams.linkHREF) != "undefined")
351                                {
352                                    if(typeof(arParams.linkHREFNew) != "undefined")
353                                    {
354                                        if(arParams.linkHREFNew == "Y")
355                                        {
356                                            setTimeout(function() {
357                                                window.open(arParams.linkHREF, '_blank');
358                                            }, 1000);      
359                                        }
360                                    }
361                                    else
362                                    {
363                                        setTimeout(function() {
364                                            window.location.href = arParam
364s.linkHREF;
365                                        }, 3300);
366                                    }
367                                    
368                                }
369                            }
370                            $.ajax({
371                                url: "/bitrix/tools/concept.phoenix/ajax/ajax_hit_page.php",
372                                method: 'POST',
373                                success: function(json) {}
374                            });
375                            
376
377                            setTimeout(function()
378                            {
379                                if ($('.phoenix-modal').hasClass('form-modal'))
380                                    formAttentionScroll(arParams.form_block.find('.thank').offset().top - arParams.form_block.parents(
381                                        '.phoenix-modal-dialog').offset().top, ".phoenix-modal");
382                                else if (arParams.form_block.hasClass('form-cart')) {
383                                    formAttentionScroll(arParams.form_block.find('.thank').offset().top - arParams.form_block.find(
384                                        ".body").offset().top, ".cart-parent");
385                                } else {
386                                    formAttentionScroll(arParams.form_block.find('.thank').offset().top -
387                                        otherHeight, "html:not(:animated),body:not(:animated)");
388                                }
389                            }, 300);
390                            
391
392                            if(typeof(json.SCRIPTS) != "undefined")
393                            {
394                                if (json.SCRIPTS.length > 0)
395                                {
396                                    $('body').append("<script>"+json.SCRIPTS+"</script>");
397                                }
398                            }
399
400                            resetCustomDynamicInputs();
401                            
402                        }
403
404                        if(arParams.typeForm == "fast_order")
405                        {
406                            if (arParams.fromBasket == "Y")
407                            {
408
409                                if (typeof(json.CUR_PAGE) != "undefined")
410                                {
411                                    if(json.CUR_PAGE.length>0)
412                                    {
413                                        window.location.href = json.CUR_PAGE;
414                                    }
415                                }
416                            }
417                            else
418                            {
419
420                                if (typeof(json.TEXT_THANK) != "undefined")
421                                {
422                                    if(json.TEXT_THANK.length>0)
423                                    {
424                                        arParams.questions.removeClass("active");
425                                        arParams.thank.html(json.TEXT_THANK);
426                                        arParams.thank.addClass("active");
427                                    }
428                                }
429                            }
430                        }
431
432
433                    }
434                }
435            });
436
437        }, 1000);
438    }
439
440}
441
442$(document).on("click", ".btn-submit", function()
443{
444    var form = $(this).parents("form.send"),
445        typeForm = "",
446        fromBasket = "",
447        paramsForm = {};
448
449    if(form.length>0)
450    {
451        
452        if($(this).hasClass('fast-order'))
453            typeForm = "fast_order";
454
455        if($(this).hasClass('fast-order-basket'))
456        {
457            fromBasket = "Y";
458            typeForm = "fast_order";
459        }
460
461
462        paramsForm = 
463            {
464                form_block: form,
465                typeForm: typeForm,
466                fromBasket: fromBasket,
467                path: "/bitrix/tools/concept.phoenix/ajax/form_send.php",
468                button: $(this),
469                linkHREF: $(this).attr("data-link"),
470                linkHREFNew: $(this).attr("data-link-new"),
471                header: $("input[name='header']", form),
472                agreecheck: $("input.agreecheck", form),
473                questions: $("div.questions", form),
474                load: $("div.load", form),
475                thank: $("div.thank", form),
476                captchaToken: ""
477            };
478
479
480        if($("body").hasClass('captcha')) 
481        {
482            grecaptcha.execute($(".captcha-site-key").val(), {action: 'homepage'}).then(function(token) {
483                paramsForm.captchaToken = token;
484                sendForm(paramsForm);
485            });
486        }
487        else if($("body").hasClass('yandex-captcha'))
488        {
489            var tokenInput = form.find('input[name="smart-token"]');
490            paramsForm.captchaToken = tokenInput.length ? $.trim(tokenInput.val()) : "";
491            sendForm(paramsForm);
492        }
493        else{
494            sendForm(paramsForm);
495        }
496    }
497
498
499    
500});
501
502
503
504$(document).on("focus", "input[type='email'], input[type='text'], input[type='password'], textarea", function() {
505    $(this).parent("div.input").removeClass("has-error");
506    if ($(this).val().length <= 0 && !$(this).hasClass("phone")) {
507        $(this).attr("data-placeholder", $(this).attr("placeholder"));
508        $(this).attr("placeholder", "");
509    }
510});
511$(document).on("blur", "input[type='email'], input[type='text'], input[type='password'], textarea", function() {
512    if ($(this).val().length <= 0 && !$(this).hasClass("phone")) $(this).attr(
513        "placeholder", $(this).attr("data-placeholder"));
514});
515$(document).on("keypress", "form.form div.count input", function(e) {
516    e = e || event;
517    if (e.ctrlKey || e.altKey || e.metaKey) return;
518    var chr = getChar(e);
519    if (chr == null) return;
520    if (chr < '0' || chr > '9') {
521        return false;
522    }
523});
524$(document).on("keyup", "form.form div.count input", function(e) {
525    var value = $(this).val().toString();
526    var newVal = "";
527    for (var i = 0; i < value.length; i++) {
528        if (value[i] == "0" || value[i] == "1" || value[i] == "2" || value[i] ==
529            "3" || value[i] == "4" || value[i] == "5" || value[i] == "6" || value[i] ==
530            "7" || value[i] == "8" || value[i] == "9") newVal += value[i];
531    }
532    if (newVal == 0) newVal = 1;
533    $(this).val(newVal);
534    if ($(this).val() == "") $(this).parent().addClass('in-focus');
535});
536$(document).on("click", "form.form div.count span.plus", function(e) {
537    var input = $(this).parent("div.count").find("input");
538    var value = parseFloat(input.val());
539    if (isNaN(value)) value = 0;
540    value += 1;
541    input.val(value);
542    if ($(this).val() == "") $(this).parent().addClass('in-focus');
543});
544$(document).on("click", "form.form div.count span.minus", function(e) {
545    var input = $(this).parent("div.count").find("input");
546    var value = parseFloat(input.val());
547    if (isNaN(value)) value = 0;
548    value -= 1;
549    if (value < 0) value = '';
550    if (value == 0) value = 1;
551    input.val(value);
552});
553$(document).on("keypress", ".only-num", function(e) {
554    e = e || event;
555    if (e.ctrlKey || e.altKey || e.metaKey) return;
556    var chr = getChar(e);
557    if (chr == null) return;
558    if (chr < '0' || chr > '9') {
559        return false;
560    }
561});
562$(document).on("focus", "input.focus-anim, textarea.focus-anim", function() {
563    if ($(this).val() == "") $(this).parent().addClass('in-focus');
564});
565$(document).on("blur", "input.focus-anim, textarea.focus-anim", function() {
566    element = $(this);
567    setTimeout(function() {
568        if (element.val() == "") element.parent().removeClass('in-focus');
569    }, 200);
570});
571
572function showModalDialog(target){
573    startBlurWrapperContainer();
574    $(".phx-modal-dialog[data-target='"+target+"']").addClass('active');
575    var timer = setTimeout(function() {
576        $(".phx-modal-dialog[data-target='"+target+"']").addClass('show');
577        clearTimeout(timer);
578    }, 300);
579}
580function closeModalDialog(target){
581
582    $(".phx-modal-dialog[data-target='"+target+"']").removeClass('show');
583    var timer = setTimeout(function() {
584        $(".phx-modal-dialog[data-target='"+target+"']").removeClass('active');
585        stopBlurWrapperContainer();
586        clearTimeout(timer);
587    }, 300);
588}
589
590$(document).on("click", ".show-phx-modal-dialog", function()
591{
592    showModalDialog($(this).attr("data-target"));
593});
594$(document).on("click", ".close-phx-modal-dialog", function()
595{
596    closeModalDialog($(this).attr("data-target"));
597});
598
599
600
601$(document).on("click", ".auth-submit", function()
602{
603    var form = $(this).parents("form.auth"),
604        er_block = $("div.errors", form),
605        login = $("input[name='auth-login']", form),
606        password = $("input[name='auth-password']", form),
607        error = 0,
608        count = 0,
609        button = $("button", form),
610        load = $("div.load", form);
611    
612    $("input[type='text'], input[type='password']", form).each(
613        function()
614        {
615            
616            if($(this).hasClass("email") && $(this).val().length > 0)
617            {
618                if(!(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,15}$/i).test($(this).val()))
619                {
620                    $(this).parent("div.input").addClass("has-error");
621                    error = 1;
622                    
623                    count++;
624                    
625                    if(count == 1)
626                    {
627                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
628                    }
629                }
630            }
631           
632            
633            if($(this).hasClass("require"))
634            {
635                if($(this).val().length <= 0)
636                {
637                    $(this).parent("div.input").addClass("has-error");
638                    error = 1;
639                    
640                    count++;
641                    
642                    if(count == 1)
643                    {
644                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
645                    }
646                }
647            }
648        }
649        
650    );
651    
652    
653    if(error == 0)
654    {
655        button.removeClass('active');
656        load.addClass('active');
657
658        $.post(
659            "/bitrix/tools/concept.phoenix/ajax/personal/auth.php",
660            {
661                "send": "Y",
662                "login": login.val(),
663                "password": password.val(),
664                "site_id": $("input.site_id").val(),
665                "sessid": (typeof BX !== "undefined" && typeof BX.bitrix_sessid === "function") ? BX.bitrix_sessid() : ""
666            },
667            function(data)
668            {
669                if(data.OK == "N")
670                {
671                    er_block.html(data.ERROR);
672                    button.addClass('active');
673                    load.removeClass('active');
674                }
675                
676                if(data.OK == "Y")
677                {
678                    location.href = location.href;
679                }
680            },
681            "json"
682        ); 
683    }
684    
685    return false;
686});
687
688$(document).on("click", ".register-submit", function()
689{
690    var form = $(this).parents("form.reg-form"),
691        wr_form = form.parents("div.reg-page"),
692        er_block = $("div.errors", wr_form),
693        name = $("input[name='bx-name']", form),
694        password = $("input[name='bx-password']", form),
695        email = $("input[name='bx-email']", form),
696        error = 0,
697        count = 0,
698        button = $("button", form),
699        load = $("div.load", form);
700
701
702
703    if($("input.agreecheck", form).length>0)
704    {
705        agreecheck = $("input.agreecheck", form);
706
707        if (!agreecheck.prop("checked")) {
708            agreecheck.parents("div.wrap-agree").addClass("has-error");
709            error = 1;
710        }
711    }
712    if ($("body").hasClass('yandex-captcha')) {
713        var $cap = form.find('#captcha-container, .smart-captcha').first();
714        var tokenVal = $.trim(($cap.find('input[name="smart-token"]').first().val() || ''));
715    
716        if (!tokenVal) {
717            $cap.addClass('has-error');
718            button.addClass('active');
719            load.removeClass('active');
720            if ($cap.length) $('html,body').animate({ scrollTop: $cap.offset().top - 120 }, 300);
721            return false;
722        } else {
723            $cap.removeClass('has-error');
724        }
725    }
726
727    $("input[type='email'], input[type='text'], input[type='password']", form).each(
728        function()
729        {
730            
731            if($(this).hasClass("email") && $(this).val().length > 0)
732            {
733                if(!(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,15}$/i).test($(this).val()))
734                {
735                    $(this).parent("div.input").addClass("has-error");
736                    error = 1;
737                    
738                    count++;
739                    
740                    if(count == 1)
741                    {
742                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
743                    }
744                }
745            }
746           
747            
748            if($(this).hasClass("require"))
749            {
750                if($(this).val().length <= 0)
751                {
752                    $(this).parent("div.input").addClass("has-error");
753                    error = 1;
754                    
755                    count++;
756                    
757                    if(count == 1)
758                    {
759                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
760                    }
761                }
762            }
763        }
764    );
765
766    var captchaToken = "";
767    if(error == 0)
768    {
769        
770        button.removeClass("active");
771        load.addClass('active');
772
773        if($("body").hasClass('captcha'))
774        {
775            grecaptcha.execute($(".captcha-site-key").val(), {action: 'homepage'}).then(function(token) {
776                captchaToken = token;
777
778                $.post(
779                    "/bitrix/tools/concept.phoenix/ajax/personal/reg.php",
780                    {
781                        "send": "Y",
782                        "bx-name": name.val(),
783                        "bx-email": email.val(),
784                        "bx-password": password.val(),
785                        "site_id": $("input.site_id").val(),
786                        "captchaToken": captchaToken
787                    },
788                    function(data)
789                    {
790                        if(data.OK == "N")
791                        {
792                            er_block.html(data.ERROR);
793                            $('html, body').animate({ scrollTop: er_block.offset().top - 100 }, 500);
794                            button.addClass("active");
795                            load.removeClass('active');
796                        }
797                        
798                        if(data.OK == "Y")
799                        {
800                            location.href = data.HREF;
801                        }
802                           
803                    },
804                    "json"
805                );
806            });
807        }
808        else if ($("body").hasClass('yandex-captcha')) 
809        {
810            var tokenInput = form.find('input[name="smart-token"]');
811            captchaToken = tokenInput.length ? $.trim(tokenInput.val()) : "";
812
813            $.post(
814                "/bitrix/tools/concept.phoenix/ajax/personal/reg.php",
815                {
816                    "send": "Y",
817                    "bx-name": name.val(),
818                    "bx-email": email.val(),
819                    "bx-password": password.val(),
820                    "site_id": $("input.site_id").val(),
821                    "captchaToken": captchaToken
822                },
823                function(data)
824                {
825                    if(data.OK == "N")
826                    {
827                        er_block.html(data.ERROR);
828                        $('html, body').animate({ scrollTop: er_block.offset().top - 100 }, 500);
829                        button.addClass("active");
830                        load.removeClass('active');
831                    }
832
833                    if(data.OK == "Y")
834                    {
835                        location.href = data.HREF;
836                    }
837
838                },
839                "json"
840            );
841        }
842        else
843        {
844            $.post(
845                "/bitrix/tools/concept.phoenix/ajax/personal/reg.php",
846                {
847                    "send": "Y",
848                    "bx-name": n
848ame.val(),
849                    "bx-email": email.val(),
850                    "bx-password": password.val(),
851                    "site_id": $("input.site_id").val()
852                },
853                function(data)
854                {
855                    if(data.OK == "N")
856                    {
857                        er_block.html(data.ERROR);
858                        $('html, body').animate({ scrollTop: er_block.offset().top - 100 }, 500);
859                        button.addClass("active");
860                        load.removeClass('active');
861                    }
862                    
863                    if(data.OK == "Y")
864                    {
865                        location.href = data.HREF;
866                    }
867                       
868                },
869                "json"
870            );
871        }
872
873        
874        
875    }
876    
877    return false;
878
879});
880
881
882
883$(document).on("click", ".changepassword-submit", function()
884{
885    var form = $(this).parents("form.changepassword"),
886        wr_form = form.parents("div.changepassword"),
887        er_block = $("div.errors", wr_form),
888        suc_block = $("div.success", wr_form),
889        login = $("input[name='USER_LOGIN']", form),
890        checkword = $("input[name='USER_CHECKWORD']", form),
891        password = $("input[name='USER_PASSWORD']", form),
892        password_confirm = $("input[name='USER_CONFIRM_PASSWORD']", form),
893        error = 0,
894        count = 0,
895        button = $("button", form),
896        load = $("div.load", form);
897
898
899    $("input[type='password']", form).each(
900        function()
901        {     
902            if($(this).hasClass("require"))
903            {
904                if($(this).val().length <= 0)
905                {
906                    $(this).parent("div.input").addClass("has-error");
907                    error = 1;
908                    
909                    count++;
910                    
911                    if(count == 1)
912                    {
913                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
914                    }
915                }
916            }
917        }
918    );
919
920
921
922    if(error == 0)
923    {
924        
925        button.removeClass("active");
926        load.addClass('active');
927        
928        $.post(
929            "/bitrix/tools/concept.phoenix/ajax/personal/changepassword.php",
930            {
931                "send": "Y",
932                "login": login.val(),
933                "password": password.val(),
934                "password_confirm": password_confirm.val(),
935                "checkword": checkword.val(),
936                "site_id": $("input.site_id").val(),
937                "sessid": (typeof BX !== "undefined" && typeof BX.bitrix_sessid === "function") ? BX.bitrix_sessid() : ""
938            },
939            function(data)
940            {
941                if(data.OK == "N")
942                {
943                    if(data.ERRORS)
944                    {
945                        var errors_html = "";
946                        
947                        for( var i in data.ERRORS )
948                        {
949                            errors_html += "<div class='er-policy-item'>"+data.ERRORS[i]+"</div>";
950                        }
951
952                        er_block.show().html('<div class="er-policy">'+errors_html+"</div>");
953
954                        $('html, body').animate({ scrollTop: er_block.offset().top - 100 }, 500);
955                    }
956
957
958                    suc_block.hide();
959                    form.show();
960                    button.addClass("active");
961                    load.removeClass('active');
962                }
963                
964                if(data.OK == "Y")
965                {
966                    er_block.hide();
967                    form.hide();
968                    suc_block.show().html(data.SUCCESS);
969
970                    $.ajax({
971                        url: "/bitrix/tools/concept.phoenix/ajax/ajax_hit_page.php",
972                        method: 'POST',
973                        success: function(json) {}
974                    });
975                }
976                   
977            },
978            "json"
979        ); 
980    }
981    
982    return false;
983
984});
985
986
987$(document).on("click", ".forgotpassword-submit", function()
988{
989    var form = $(this).parents("form.forgotpassword"),
990        wr_form = form.parents("div.forgetpass"),
991        er_block = $("div.errors", wr_form),
992        suc_block = $("div.success", wr_form),
993        desc_block = $(".description-change-form", wr_form),
994        login = $("input[name='USER_LOGIN']", form),
995        error = 0,
996        count = 0,
997        button = $("button", form),
998        load = $("div.load", form);
999
1000
1001    $("input[type='text']", form).each(
1002        function()
1003        {     
1004            if($(this).hasClass("require"))
1005            {
1006                if($(this).val().length <= 0)
1007                {
1008                    $(this).parent("div.input").addClass("has-error");
1009                    error = 1;
1010                    
1011                    count++;
1012                    
1013                    if(count == 1)
1014                    {
1015                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
1016                    }
1017                }
1018            }
1019        }
1020    );
1021
1022    if(error == 0)
1023    {
1024        
1025        button.removeClass("active");
1026        load.addClass('active');
1027        
1028        $.post(
1029            "/bitrix/tools/concept.phoenix/ajax/personal/forgotpassword.php",
1030            {
1031                "send": "Y",
1032                "login": login.val(),
1033                "site_id": $("input.site_id").val(),
1034                "sessid": (typeof BX !== "undefined" && typeof BX.bitrix_sessid === "function") ? BX.bitrix_sessid() : ""
1035            },
1036            function(data)
1037            {
1038                
1039                if(data.OK == "N")
1040                {
1041                    er_block.show().html(data.ERRORS);
1042                    suc_block.hide();
1043                    desc_block.show();
1044                    form.show();
1045                    button.addClass("active");
1046                    load.removeClass('active');
1047                }
1048                
1049                if(data.OK == "Y")
1050                {
1051                    desc_block.hide();
1052                    er_block.hide();
1053                    form.hide();
1054                    suc_block.show().html(data.SUCCESS);
1055                }
1056                   
1057            },
1058            "json"
1059        ); 
1060    }
1061    
1062    return false;
1063
1064});

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.