PageSourceSearch

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

js biomedtorg.ru collected 2026-10-08 01:17:42 UTC 29,565 bytes, 972 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
151    if (typeof(arParams.agreecheck.val()) != "undefined") {
152        if (!arParams.agreecheck.prop("checked")) {
153            arParams.agreecheck.parents("div.wrap-agree").addClass("has-error");
154            error = 1;
155        }
156    }
157
158    $("input[type='email'], input[type='text'], input[type='password'], textarea", arParams.form_block).each(
159        function(key, value)
160        {
161            if ($(this).hasClass("email") && $(this).val().length > 0) {
162                if (!(
163                        /^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,15}$/i
164                    ).test($(this).val())) {
165                    $(this).parent("div.input").addClass("has-error");
166                    error = 1;
167                }
168            }
169            if ($(this).hasClass("require")) {
170                if ($(this).val().trim().length <= 0){
171                    $(this).val("");
172                    $(this).parent("div.input").addClass("has-error");
173                    error = 1;
174                }
175            }
176        }
177    );
178
179    $("input[type='file']", arParams.form_block).each(function(key, value)
180    {
181        if ($(this).hasClass("require"))
182        {
183            if ($(this).closest('.load-file').find('span.area-file').hasClass(
184                    'area-file')) {
185                $(this).closest('.load-file').addClass("has-error");
186                error = 1;
187            }
188        }
189    });
190
191    if (!$('.phoenix-modal').hasClass('form-modal'))
192    {
193        var otherHeight = 0;
194        if ($('header').hasClass('fixed')) 
195            otherHeight = $('.fix-board').outerHeight(
196            true);
197    }
198
199
200    var arChecbox = {}, newKey = null;
201
202    $("input.check-require[type='checkbox']", arParams.form_block).each(
203        function(key, value)
204        {
205            newKey = $(this).attr('name').replace("[]", "");
206
207            if(typeof arChecbox[newKey] == "undefined")
208                arChecbox[newKey] = [];
209            
210            arChecbox[newKey].push(this);
211        }
212    );
213
214    if(newKey)
215        error = validGroupCheckbox(arChecbox);
216
217    delete arChecbox;
218    newKey = null;
219
220    var arRadio = {};
221    $(".select-require input.opinion[type='radio']", arParams.form_block).each(
222        function(key, value)
223        {
224            newKey = $(this).attr('name');
225
226            if(typeof arRadio[newKey] == "undefined")
227                arRadio[newKey] = [];
228            
229            arRadio[newKey].push(this);
230        }
231    );
232
233    if(newKey)
234        error = validGroupSelect(arRadio);
235
236    delete arChecbox;
237    newKey = null;
238
239    
240    if (error == 1)
241    {
242
243        if ($('.phoenix-modal').hasClass('form-modal'))
244        {
245            formAttentionScroll(
246                arParams.form_block.find('.has-error:first').offset().top - arParam
246s.form_block.parents('.phoenix-modal-dialog').offset().top, 
247                ".phoenix-modal");
248        } 
249        else if (arParams.form_block.hasClass('form-cart'))
250        {
251            formAttentionScroll(
252                arParams.form_block.find('.has-error:first').offset().top - arParams.form_block.find(".body").offset().top, 
253                ".cart-parent");
254        }
255        else
256        {
257            formAttentionScroll(arParams.form_block.find('.has-error:first').offset().top - otherHeight, 
258            "html:not(:animated), body:not(:animated)");
259
260        }
261    }
262
263    if (error == 0)
264    {
265        
266
267        arParams.form_block.css({
268            "height": arParams.form_block.outerHeight() + "px"
269        });
270
271
272        var form_arr = arParams.form_block.find(':input,select,textarea').serializeArray();
273
274        for (var i = 0; i < form_arr.length; i++)
275        {
276            if (form_arr[i].value.length > 0)
277            { 
278                formSendAll.append(form_arr[i].name, form_arr[i].value);
279            }
280        };
281
282        if (arParams.form_block.hasClass('file-download'))
283        {
284            arParams.form_block.find('input[type=file]').each(function(key)
285            {
286
287                var inp = $(this);
288                var file_list_name = "";
289
290                $(inp[0].files).each(
291                    function(k){
292                        formSendAll.append(inp.attr('name'), inp[0].files[k], inp[0].files[k].name);
293                    }
294                );
295
296            });
297        }
298
299        if(arParams.captchaToken.length>0)
300            formSendAll.append("captchaToken", arParams.captchaToken);
301
302
303        arParams.button.removeClass("active");
304        arParams.load.addClass("active");
305
306        setTimeout(function()
307        {
308            $.ajax({
309                url: arParams.path,
310                type: "post",
311                contentType: false,
312                processData: false,
313                data: formSendAll,
314                dataType: 'json',
315                success: function(json)
316                {
317
318                    if(typeof (json.OK) != "undefined" )
319                    {
320                        if(json.OK == "N")
321                        {
322                            arParams.button.addClass("active");
323                            arParams.load.removeClass("active");
324                        }
325
326                        if (json.OK == "Y")
327                        {
328
329                            if(arParams.typeForm != "fast_order")
330                            {
331                                arParams.questions.removeClass("active");
332                                arParams.thank.addClass("active");
333
334                                if (typeof(arParams.linkHREF) != "undefined")
335                                {
336                                    setTimeout(function() {
337                                        window.location.href = arParam
337s.linkHREF;
338                                    }, 3300);
339                                }
340                            }
341
342                            $.ajax({
343                                url: "/",
344                                type: "post",
345                                success: function(json) {}
346                            });
347                            
348
349                            setTimeout(function()
350                            {
351                                if ($('.phoenix-modal').hasClass('form-modal'))
352                                    formAttentionScroll(arParams.form_block.find('.thank').offset().top - arParams.form_block.parents(
353                                        '.phoenix-modal-dialog').offset().top, ".phoenix-modal");
354                                else if (arParams.form_block.hasClass('form-cart')) {
355                                    formAttentionScroll(arParams.form_block.find('.thank').offset().top - arParams.form_block.find(
356                                        ".body").offset().top, ".cart-parent");
357                                } else {
358                                    formAttentionScroll(arParams.form_block.find('.thank').offset().top -
359                                        otherHeight, "html:not(:animated),body:not(:animated)");
360                                }
361                            }, 300);
362                            
363
364                            if(typeof(json.SCRIPTS) != "undefined")
365                            {
366                                if (json.SCRIPTS.length > 0)
367                                {
368                                    $('body').append("<script>"+json.SCRIPTS+"</script>");
369                                }
370                            }
371
372                            if(arParams.typeForm == "fast_order")
373                            {
374                                if (arParams.fromBasket == "Y")
375                                {
376
377                                    if (typeof(json.CUR_PAGE) != "undefined")
378                                    {
379                                        if(json.CUR_PAGE.length>0)
380                                        {
381                                            window.location.href = json.CUR_PAGE;
382                                        }
383                                    }
384                                }
385                                else
386                                {
387                                    arParams.questions.removeClass("active");
388
389                                    if (typeof(json.TEXT_THANK) != "undefined")
390                                    {
391                                        if(json.TEXT_THANK.length>0)
392                                        {
393                                            arParams.thank.html(json.TEXT_THANK);
394                                            arParams.thank.addClass("active");
395                                        }
396                                    }
397                                }
398                            }
399                        }
400                    }
401                }
402            });
403
404        }, 1000);
405    }
406
407}
408
409$(document).on("click", ".btn-submit", function()
410{
411    var form = $(this).parents("form.send"),
412        typeForm = "",
413        fromBasket = "",
414        paramsForm = {};
415
416        if($(this).hasClass('fast-order'))
417            typeForm = "fast_order";
418
419        if($(this).hasClass('fast-order-basket'))
420        {
421            fromBasket = "Y";
422            typeForm = "fast_order";
423        }
424
425
426    paramsForm = 
427        {
428            form_block: form,
429            typeForm: typeForm,
430            fromBasket: fromBasket,
431            path: "/bitrix/tools/concept.phoenix/ajax/form_send.php",
432            button: $(this),
433            linkHREF: $(this).attr("data-link"),
434            header: $("input[name='header']", form),
435            agreecheck: $("input.agreecheck", form),
436            questions: $("div.questions", form),
437            load: $("div.load", form),
438            thank: $("div.thank", form),
439            captchaToken: ""
440        };
441
442
443    if($("body").hasClass('captcha'))
444    {
445        grecaptcha.execute($(".captcha-site-key").val(), {action: 'homepage'}).then(function(token) {
446
447            paramsForm.captchaToken = token;
448            sendForm(paramsForm);
449        });
450    }
451    else{
452        sendForm(paramsForm);
453    }
454    
455
456    
457});
458
459
460
461$(document).on("focus", "input[type='email'], input[type='text'], input[type='password'], textarea", function() {
462    $(this).parent("div.input").removeClass("has-error");
463    if ($(this).val().length <= 0 && !$(this).hasClass("phone")) {
464        $(this).attr("data-placeholder", $(this).attr("placeholder"));
465        $(this).attr("placeholder", "");
466    }
467});
468$(document).on("blur", "input[type='email'], input[type='text'], input[type='password'], textarea", function() {
469    if ($(this).val().length <= 0 && !$(this).hasClass("phone")) $(this).attr(
470        "placeholder", $(this).attr("data-placeholder"));
471});
472$(document).on("keypress", "form.form div.count input", function(e) {
473    e = e || event;
474    if (e.ctrlKey || e.altKey || e.metaKey) return;
475    var chr = getChar(e);
476    if (chr == null) return;
477    if (chr < '0' || chr > '9') {
478        return false;
479    }
480});
481$(document).on("keyup", "form.form div.count input", function(e) {
482    var value = $(this).val().toString();
483    var newVal = "";
484    for (var i = 0; i < value.length; i++) {
485        if (value[i] == "0" || value[i] == "1" || value[i] == "2" || value[i] ==
486            "3" || value[i] == "4" || value[i] == "5" || value[i] == "6" || value[i] ==
487            "7" || value[i] == "8" || value[i] == "9") newVal += value[i];
488    }
489    if (newVal == 0) newVal = 1;
490    $(this).val(newVal);
491    if ($(this).val() == "") $(this).parent().addClass('in-focus');
492});
493$(document).on("click", "form.form div.count span.plus", function(e) {
494    var input = $(this).parent("div.count").find("input");
495    var value = parseFloat(input.val());
496    if (isNaN(value)) value = 0;
497    value += 1;
498    input.val(value);
499    if ($(this).val() == "") $(this).parent().addClass('in-focus');
500});
501$(document).on("click", "form.form div.count span.minus", function(e) {
502    var input = $(this).parent("div.count").find("input");
503    var value = parseFloat(input.val());
504    if (isNaN(value)) value = 0;
505    value -= 1;
506    if (value < 0) value = '';
507    if (value == 0) value = 1;
508    input.val(value);
509});
510$(document).on("keypress", ".only-num", function(e) {
511    e = e || event;
512    if (e.ctrlKey || e.altKey || e.metaKey) return;
513    var chr = getChar(e);
514    if (chr == null) return;
515    if (chr < '0' || chr > '9') {
516        return false;
517    }
518});
519$(document).on("focus", "input.focus-anim, textarea.focus-anim", function() {
520    if ($(this).val() == "") $(this).parent().addClass('in-focus');
521});
522$(document).on("blur", "input.focus-anim, textarea.focus-anim", function() {
523    element = $(this);
524    setTimeout(function() {
525        if (element.val() == "") element.parent().removeClass('in-focus');
526    }, 200);
527});
528
529function showModalDialog(target){
530    startBlurWrapperContainer();
531    $(".phx-modal-dialog[data-target='"+target+"']").addClass('active');
532    var timer = setTimeout(function() {
533        $(".phx-modal-dialog[data-target='"+target+"']").addClass('show');
534        clearTimeout(timer);
535    }, 300);
536}
537function closeModalDialog(target){
538
539    $(".phx-modal-dialog[data-target='"+target+"']").removeClass('show');
540    var timer = setTimeout(function() {
541        $(".phx-modal-dialog[data-target='"+target+"']").removeClass('active');
542        stopBlurWrapperContainer();
543        clearTimeout(timer);
544    }, 300);
545}
546
547$(document).on("click", ".show-phx-modal-dialog", function()
548{
549    showModalDialog($(this).attr("data-target"));
550});
551$(document).on("click", ".close-phx-modal-dialog", function()
552{
553    closeModalDialog($(this).attr("data-target"));
554});
555
556
557
558$(document).on("click", ".auth-submit", function()
559{
560    var form = $(this).parents("form.auth"),
561        er_block = $("div.errors", form),
562        login = $("input[name='auth-login']", form),
563        password = $("input[name='auth-password']", form),
564        error = 0,
565        count = 0,
566        button = $("button", form),
567        load = $("div.load", form);
568    
569    $("input[type='text'], input[type='password']", form).each(
570        function()
571        {
572            
573            if($(this).hasClass("email") && $(this).val().length > 0)
574            {
575                if(!(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,15}$/i).test($(this).val()))
576                {
577                    $(this).parent("div.input").addClass("has-error");
578                    error = 1;
579                    
580                    count++;
581                    
582                    if(count == 1)
583                    {
584                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
585                    }
586                }
587            }
588           
589            
590            if($(this).hasClass("require"))
591            {
592                if($(this).val().length <= 0)
593                {
594                    $(this).parent("div.input").addClass("has-error");
595                    error = 1;
596                    
597                    count++;
598                    
599                    if(count == 1)
600                    {
601                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
602                    }
603                }
604            }
605        }
606    );
607    
608    
609    if(error == 0)
610    {
611        button.removeClass('active');
612        load.addClass('active');
613
614        $.post(
615            "/bitrix/tools/concept.phoenix/ajax/personal/auth.php",
616            {
617                "send": "Y",
618                "login": login.val(),
619                "password": password.val(),
620                "site_id": $("input.site_id").val()
621            },
622            function(data)
623            {
624                if(data.OK == "N")
625                {
626                    er_block.html(data.ERROR);
627                    button.addClass('active');
628                    load.removeClass('active');
629                }
630                
631                if(data.OK == "Y")
632                {
633                    location.href = location.href;
634                }
635            },
636            "json"
637        ); 
638    }
639    
640    return false;
641});
642
643$(document).on("click", ".register-submit", function()
644{
645    var form = $(this).parents("form.reg-form"),
646        wr_form = form.parents("div.reg-page"),
647        er_block = $("div.errors", wr_form),
648        name = $("input[name='bx-name']", form),
649        password = $("input[name='bx-password']", form),
650        email = $("input[name='bx-email']", form),
651        error = 0,
652        count = 0,
653        button = $("button", form),
654        load = $("div.load", form);
655
656
657
658    if($("input.agreecheck", form).length>0)
659    {
660        agreecheck = $("input.agreecheck", form);
661
662        if (!agreecheck.prop("checked")) {
663            agreecheck.parents("div.wrap-agree").addClass("has-error");
664            error = 1;
665        }
666    }
667
668
669    $("input[type='email'], input[type='text'], input[type='password']", form).each(
670        function()
671        {
672            
673            if($(this).hasClass("email") && $(this).val().length > 0)
674            {
675                if(!(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,15}$/i).test($(this).val()))
676                {
677                    $(this).parent("div.input").addClass("has-error");
678                    error = 1;
679                    
680                    count++;
681                    
682                    if(count == 1)
683                    {
684                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
685                    }
686                }
687            }
688           
689            
690            if($(this).hasClass("require"))
691            {
692                if($(this).val().length <= 0)
693                {
694                    $(this).parent("div.input").addClass("has-error");
695                    error = 1;
696                    
697                    count++;
698                    
699                    if(count == 1)
700                    {
701                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
702                    }
703                }
704            }
705        }
706    );
707
708    var captchaToken = "";
709
710    if(error == 0)
711    {
712        
713        button.removeClass("active");
714        load.addClass('active');
715
716        if($("body").hasClass('captcha'))
717        {
718            grecaptcha.execute($(".captcha-site-key").val(), {action: 'homepage'}).then(function(token) {
719                captchaToken = token;
720
721                $.post(
722                    "/bitrix/tools/concept.phoenix/ajax/personal/reg.php",
723                    {
724                        "send": "Y",
725                        "bx-name": name.val(),
726                        "bx-email": email.val(),
727                        "bx-password": password.val(),
728                        "site_id": $("input.site_id").val(),
729                        "captchaToken": captchaToken
730                    },
731                    function(data)
732                    {
733                        if(data.OK == "N")
734                        {
735                            er_block.html(data.ERROR);
736                            $('html, body').animate({ scrollTop: er_block.offset().top - 100 }, 500);
737                            button.addClass("active");
738                            load.removeClass('active');
739                        }
740                        
741                        if(data.OK == "Y")
742                        {
743                            location.href = data.HREF;
744                        }
745                           
746                    },
747                    "json"
748                );
749            });
750        }
751
752        else
753        {
754            $.post(
755                "/bitrix/tools/concept.phoenix/ajax/personal/reg.php",
756                {
757                    "send": "Y",
758                    "bx-name": name.val(),
759                    "bx-email": email.val(),
760                    "bx-password": password.val(),
761                    "site_id": $("input.site_id").val()
762                },
763                function(data)
764                {
765                    if(data.OK == "N")
766                    {
767                        er_block.html(data.ERROR);
768                        $('html, body').animate({ scrollTop: er_block.offset().top - 100 }, 500);
769                        button.addClass("active");
770                        load.removeClass('active');
771                    }
772                    
773                    if(data.OK == "Y")
774                    {
775                        location.href = data.HREF;
776                    }
777                       
778                },
779                "json"
780            );
781        }
782
783        
784        
785    }
786    
787    return false;
788
789});
790
791
792
793$(document).on("click", ".changepassword-submit", function()
794{
795    var form = $(this).parents("form.changepassword"),
796        wr_form = form.parents("div.changepassword"),
797        er_block = $("div.errors", wr_form),
798        suc_block = $("div.success", wr_form),
799        login = $("input[name='USER_LOGIN']", form),
800        checkword = $("input[name='USER_CHECKWORD']", form),
801        password = $("input[name='USER_PASSWORD']", form),
802        password_confirm = $("input[name='USER_CONFIRM_PASSWORD']", form),
803        error = 0,
804        count = 0,
805        button = $("button", form),
806        load = $("div.load", form);
807
808
809    $("input[type='password']", form).each(
810        function()
811        {     
812            if($(this).hasClass("require"))
813            {
814                if($(this).val().length <= 0)
815                {
816                    $(this).parent("div.input").addClass("has-error");
817                    error = 1;
818                    
819                    count++;
820                    
821                    if(count == 1)
822                    {
823                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
824                    }
825                }
826            }
827        }
828    );
829
830
831
832    if(error == 0)
833    {
834        
835        button.removeClass("active");
836        load.addClass('active');
837        
838        $.post(
839            "/bitrix/tools/concept.phoenix/ajax/personal/changepassword.php",
840            {
841                "send": "Y",
842                "login": login.val(),
843                "password": password.val(),
844                "password_confirm": password_confirm.val(),
845                "checkword": checkword.val(),
846                "site_id": $("input.site_id").val()
847            },
848            function(data)
849            {
850                if(data.OK == "N")
851                {
852                    if(data.ERRORS)
853                    {
854                        var errors_html = "";
855                        
856                        for( var i in data.ERRORS )
857                        {
858                            errors_html += "<div class='er-policy-item'>"+data.ERRORS[i]+"</div>";
859                        }
860
861                        er_block.show().html('<div class="er-policy">'+errors_html+"</div>");
862
863                        $('html, body').animate({ scrollTop: er_block.offset().top - 100 }, 500);
864                    }
865
866
867                    suc_block.hide();
868                    form.show();
869                    button.addClass("active");
870                    load.removeClass('active');
871                }
872                
873                if(data.OK == "Y")
874                {
875                    er_block.hide();
876                    form.hide();
877                    suc_block.show().html(data.SUCCESS);
878
879                    $.ajax({
880                        url: "/",
881                        type: "post",
882                        success: function(json) {}
883                    });
884                }
885                   
886            },
887            "json"
888        ); 
889    }
890    
891    return false;
892
893});
894
895
896$(document).on("click", ".forgotpassword-submit", function()
897{
898    var form = $(this).parents("form.forgotpassword"),
899        wr_form = form.parents("div.forgetpass"),
900        er_block = $("div.errors", wr_form),
901        suc_block = $("div.success", wr_form),
902        desc_block = $(".description-change-form", wr_form),
903        login = $("input[name='USER_LOGIN']", form),
904        error = 0,
905        count = 0,
906        button = $("button", form),
907        load = $("div.load", form);
908
909
910    $("input[type='text']", form).each(
911        function()
912        {     
913            if($(this).hasClass("require"))
914            {
915                if($(this).val().length <= 0)
916                {
917                    $(this).parent("div.input").addClass("has-error");
918                    error = 1;
919                    
920                    count++;
921                    
922                    if(count == 1)
923                    {
924                        $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500);
925                    }
926                }
927            }
928        }
929    );
930
931    if(error == 0)
932    {
933        
934        button.removeClass("active");
935        load.addClass('active');
936        
937        $.post(
938            "/bitrix/tools/concept.phoenix/ajax/personal/forgotpassword.php",
939            {
940                "send": "Y",
941                "login": login.val(),
942                "site_id": $("input.site_id").val()
943            },
944            function(data)
945            {
946                
947                if(data.OK == "N")
948                {
949                    er_block.show().html(data.ERRORS);
950                    suc_block.hide();
951                    desc_block.show();
952                    form.show();
953                    button.addClass("active");
954                    load.removeClass('active');
955                }
956                
957                if(data.OK == "Y")
958                {
959                    desc_block.hide();
960                    er_block.hide();
961                    form.hide();
962                    suc_block.show().html(data.SUCCESS);
963                }
964                   
965            },
966            "json"
967        ); 
968    }
969    
970    return false;
971
972});

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.