PageSourceSearch

https://tasamayashaurma.ru/components/com_jshopping/js/functions.js

js tasamayashaurma.ru collected 2026-10-04 09:11:37 UTC 45,888 bytes, 1,557 lines download raw bytes

1function $_(idElement) {
2    return document.getElementById(idElement);
3}
4
5function $F_(idElement) {
6    var element = $_(idElement);
7    switch (element.type) {
8        case 'select-one':
9            return element.options[element.selectedIndex].value;
10            break;
11        case 'radio':
12        case 'checkbox':
13            return element.checked;
14            break;
15        case 'text':
16        case 'password':
17        case 'textarea':
18        case 'hidden':
19            return element.value;
20            break;
21        default:
22            return element.innerHTML;
23    }
24}
25
26function killEvent(elm, evType, fn, useCapture) {
27    if (elm.removeEventListener) {
28        elm.removeEventListener(evType, fn, useCapture);
29        return true;
30    } else if (elm.detachEvent) {
31        var r = elm.detachEvent('on' + evType, fn);
32        return r;
33    } else {
34        elm['on' + evType] = null;
35    }
36}
37
38function addEventMy(elm, evType, fn, useCapture) {
39    if (elm.addEventListener) {
40        elm.addEventListener(evType, fn, useCapture);
41        return true;
42    } else if (elm.attachEvent) {
43        var r = elm.attachEvent('on' + evType, fn);
44        return r;
45    } else {
46        elm['on' + evType] = fn;
47    }
48}
49
50function highlightField(field) {
51    jQuery('#' + field).addClass('fielderror');
52}
53
54function unhighlightField(formName) {
55    var form = document.forms[formName];
56    var countElements = form.length;
57    for (i = 0; i < countElements; i++) {
58        if (form.elements[i].type == 'button' || form.elements[i].type == 'submit' || form.elements[i].type == 'radio' || form.elements[i].type == 'hidden') continue;
59        jQuery(form.elements[i]).removeClass('fielderror');
60    }
61}
62
63function isEmpty(value) {
64    var pattern = /\S/;
65    return ret = (pattern.test(value)) ? (0) : (1);
66}
67
68function checkMail(value) {
69    var pattern = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
70    return ret = (pattern.test(value)) ? (1) : (0);
71}
72
73function Equal(value1, value2) {
74    return (value1 == value2);
75}
76
77function validateRegistrationForm(urlcheckdata, formName) {
78
79    var arrayId = new Array();
80    var arrayType = new Array();
81    var arrayParams = new Array();
82    var arrayErrorMessages = new Array();
83
84    var i = 0;
85
86    if (register_field_require.title) {
87        arrayId[i] = 'title';
88        arrayType[i] = 'notn';
89        arrayParams[i] = '';
90        arrayErrorMessages[i] = '';
91        i++;
92    }
93
94    if (register_field_require.f_name) {
95        arrayId[i] = 'f_name';
96        arrayType[i] = 'nem';
97        arrayParams[i] = '';
98        arrayErrorMessages[i] = '';
99        i++;
100    }
101
102    if (register_field_require.l_name) {
103        arrayId[i] = 'l_name';
104        arrayType[i] = 'nem';
105        arrayParams[i] = '';
106        arrayErrorMessages[i] = '';
107        i++;
108    }
109
110    if (register_field_require.m_name) {
111        arrayId[i] = 'm_name';
112        arrayType[i] = 'nem';
113        arrayParams[i] = '';
114        arrayErrorMessages[i] = '';
115        i++;
116    }
117
118    if (register_field_require.firma_name) {
119        arrayId[i] = 'firma_name';
120        arrayType[i] = 'nem';
121        arrayParams[i] = '';
122        arrayErrorMessages[i] = '';
123        i++;
124    }
125
126    if (register_field_require.client_type) {
127        arrayId[i] = 'client_type';
128        arrayType[i] = 'notn';
129        arrayParams[i] = '';
130        arrayErrorMessages[i] = '';
131        i++;
132    }
133
134    if ((document.forms[formName].client_type && document.forms[formName].client_type.value == "2") || !document.forms[formName].client_type) {
135        if (register_field_require.firma_code) {
136            arrayId[i] = 'firma_code';
137            arrayType[i] = 'nem';
138            arrayParams[i] = '';
139            arrayErrorMessages[i] = '';
140            i++;
141        }
142
143        if (register_field_require.tax_number) {
144            arrayId[i] = 'tax_number';
145            arrayType[i] = 'nem';
146            arrayParams[i] = '';
147            arrayErrorMessages[i] = '';
148            i++;
149        }
150    }
151
152    if (register_field_require.email) {
153        arrayId[i] = 'email';
154        arrayType[i] = 'em';
155        arrayParams[i] = '';
156        arrayErrorMessages[i] = '';
157        i++;
158    }
159
160    if (register_field_require.email2) {
161        arrayId[i] = 'email';
162        arrayType[i] = 'eqne';
163        arrayParams[i] = 'email2';
164        arrayErrorMessages[i] = '';
165        i++;
166    }
167
168    if (register_field_require.birthday) {
169        arrayId[i] = 'birthday';
170        arrayType[i] = 'nem';
171        arrayParams[i] = '';
172        arrayErrorMessages[i] = '';
173        i++;
174    }
175
176    if (register_field_require.home) {
177        arrayId[i] = 'home';
178        arrayType[i] = 'nem';
179        arrayParams[i] = '';
180        arrayErrorMessages[i] = '';
181        i++;
182    }
183
184    if (register_field_require.apartment) {
185        arrayId[i] = 'apartment';
186        arrayType[i] = 'nem';
187        arrayParams[i] = '';
188        arrayErrorMessages[i] = '';
189        i++;
190    }
191
192    if (register_field_require.street) {
193        arrayId[i] = 'street';
194        arrayType[i] = 'nem';
195        arrayParams[i] = '';
196        arrayErrorMessages[i] = '';
197        i++;
198    }
199
200    if (register_field_require.street_nr) {
201        arrayId[i] = 'street_nr';
202        arrayType[i] = 'nem';
203        arrayParams[i] = '';
204        arrayErrorMessages[i] = '';
205        i++;
206    }
207
208    if (register_field_require.zip) {
209        arrayId[i] = 'zip';
210        arrayType[i] = 'zip';
211        arrayParams[i] = '';
212        arrayErrorMessages[i] = '';
213        i++;
214    }
215
216    if (register_field_require.city) {
217        arrayId[i] = 'city';
218        arrayType[i] = 'nem';
219        arrayParams[i] = '';
220        arrayErrorMessages[i] = '';
221        i++;
222    }
223
224    if (register_field_require.state) {
225        arrayId[i] = 'state';
226        arrayType[i] = 'nem';
227        arrayParams[i] = '';
228        arrayErrorMessages[i] = '';
229        i++;
230    }
231
232    if (register_field_require.country) {
233        arrayId[i] = 'country';
234        arrayType[i] = 'notn';
235        arrayParams[i] = '';
236        arrayErrorMessages[i] = '';
237        i++;
238    }
239
240    if (register_field_require.phone) {
241        arrayId[i] = 'phone';
242        arrayType[i] = 'nem';
243        arrayParams[i] = '';
244        arrayErrorMessages[i] = '';
245        i++;
246    }
247
248    if (register_field_require.mobil_phone) {
249        arrayId[i] = 'mobil_phone';
250        arrayType[i] = 'nem';
251        arrayParams[i] = '';
252        arrayErrorMessages[i] = '';
253        i++;
254    }
255
256    if (register_field_require.fax) {
257        arrayId[i] = 'fax';
258        arrayType[i] = 'nem';
259        arrayParams[i] = '';
260        arrayErrorMessages[i] = '';
261        i++;
262    }
263
264    if (register_field_require.ext_field_1) {
265        arrayId[i] = 'ext_field_1';
266        arrayType[i] = 'nem';
267        arrayParams[i] = '';
268        arrayErrorMessages[i] = '';
269        i++;
270    }
271
272    if (register_field_require.ext_field_2) {
273        arrayId[i] = 'ext_field_2';
274        arrayType[i] = 'nem';
275        arrayParams[i] = '';
276        arrayErrorMessages[i] = '';
277        i++;
278    }
279
280    if (register_field_require.ext_field_3) {
281        arrayId[i] = 'ext_field_3';
282        arrayType[i] = 'nem';
283        arrayParams[i] = '';
284        arrayErrorMessages[i] = '';
285        i++;
286    }
287
288    if (register_field_require.u_name) {
289        arrayId[i] = 'u_name';
290        arrayType[i] = 'nem';
291        arrayParams[i] = '';
292        arrayErrorMessages[i] = '';
293        i++;
294    }
295
296    if (register_field_require.password && register_field_require.password_2) {
297        arrayId[i] = 'password';
298        arrayType[i] = 'eqne';
299        arrayParams[i] = 'password_2';
300        arrayErrorMessages[i] = '';
301        i++;
302    } else if (register_field_require.password) {
303        arrayId[i] = 'password';
304        arrayType[i] = 'nem';
305        arrayParams[i] = '';
306        arrayErrorMessages[i] = '';
307        i++;
308    }
309
310    if (register_field_require.privacy_statement) {
311        arrayId[i] = 'privacy_statement';
312        arrayType[i] = 'chk';
313        arrayParams[i] = '';
314        arrayErrorMessages[i] = '';
315        i++;
316    }
317
318    var myForm = new validateForm(formName, arrayId, arrayType, arrayParams, arrayErrorMessages, 2);
319    var error = (myForm.validate()) ? (1) : (0);
320    if (!error) {
321        return false;
322    } else {
323        function showResponse(originalRequest) {
324            if (originalRequest != 1) {
325                alert(originalRequest);
326                return false;
327            } else {
328                document.forms[formName].submit();
329            }
330        }
331        var udata = { "username": jQuery('#u_name').val(), "email": jQuery('#email').val() };
332        jQuery.get(urlcheckdata, udata, showResponse);
333        return false;
334    }
335}
336
337function validateCheckoutAdressForm(livepath, formName) {
338
339    var typeShowError = 2;
340    var arrayId = new Array();
341    var arrayType = new Array();
342    var arrayParams = new Array();
343    var arrayErrorMessages = new Array();
344
345    var i = 0;
346
347    if (register_field_require.title) {
348        arrayId[i] = 'title';
349        arrayType[i] = 'notn';
350        arrayParams[i] = '';
351        arrayErrorMessages[i] = '';
352        i++;
353    }
354
355    if (register_field_require.f_name) {
356        arrayId[i] = 'f_name';
357        arrayType[i] = 'nem';
358        arrayParams[i] = '';
359        arrayErrorMessages[i] = '';
360        i++;
361    }
362
363    if (register_field_require.l_name) {
364        arrayId[i] = 'l_name';
365        arrayType[i] = 'nem';
366        arrayParams[i] = '';
367        arrayErrorMessages[i] = '';
368        i++;
369    }
370
371    if (register_field_require.m_name) {
372        arrayId[i] = 'm_name';
373        arrayType[i] = 'nem';
374        arrayParams[i] = '';
375        arrayErrorMessages[i] = '';
376        i++;
377    }
378
379    if (register_field_require.firma_name) {
380        arrayId[i] = 'firma_name';
381        arrayType[i] = 'nem';
382        arrayParams[i] = '';
383        arrayErrorMessages[i] = '';
384        i++;
385    }
386
387    if (register_field_require.client_type) {
388        arrayId[i] = 'client_type';
389        arrayType[i] = 'notn';
390        arrayParams[i] = '';
391        arrayErrorMessages[i] = '';
392        i++;
393    }
394
395    if ((document.forms[formName].client_type && document.forms[formName].client_type.value == "2") || !document.forms[formName].client_type) {
396        if (register_field_require.firma_code) {
397            arrayId[i] = 'firma_code';
398            arrayType[i] = 'nem';
399            arrayParams[i] = '';
400            arrayErrorMessages[i] = '';
401            i++;
402        }
403
404        if (register_field_require.tax_number) {
405            arrayId[i] = 'tax_number';
406            arrayType[i] = 'nem';
407            arrayParams[i] = '';
408            arrayErrorMessages[i] = '';
409            i++;
410        }
411    }
412
413    if (register_field_require.email) {
414        arrayId[i] = 'email';
415        arrayType[i] = 'em';
416        arrayParams[i] = '';
417        arrayErrorMessages[i] = '';
418        i++;
419    }
420
421    if (register_field_require.email2) {
422        arrayId[i] = 'email';
423        arrayType[i] = 'eqne';
424        arrayParams[i] = 'email2';
425        arrayErrorMessages[i] = '';
426        i++;
427    }
428
429    if (register_field_require.birthday) {
430        arrayId[i] = 'birthday';
431        arrayType[i] = 'nem';
432        arrayParams[i] = '';
433        arrayErrorMessages[i] = '';
434        i++;
435    }
436
437    if (register_field_require.home) {
438        arrayId[i] = 'home';
439        arrayType[i] = 'nem';
440        arrayParams[i] = '';
441        arrayErrorMessages[i] = '';
442        i++;
443    }
444
445    if (register_field_require.apartment) {
446        arrayId[i] = 'apartment';
447        arrayType[i] = 'nem';
448        arrayParams[i] = '';
449        arrayErrorMessages[i] = '';
450        i++;
451    }
452
453    if (register_field_require.street) {
454        arrayId[i] = 'street';
455        arrayType[i] = 'nem';
456        arrayParams[i] = '';
457        arrayErrorMessages[i] = '';
458        i++;
459    }
460
461    if (register_field_require.street_nr) {
462        arrayId[i] = 'street_nr';
463        arrayType[i] = 'nem';
464        arrayParams[i] = '';
465        arrayErrorMessages[i] = '';
466        i++;
467    }
468
469    if (register_field_require.zip) {
470        arrayId[i] = 'zip';
471        arrayType[i] = 'zip';
472        arrayParams[i] = '';
473        arrayErrorMessages[i] = '';
474        i++;
475    }
476
477    if (register_field_require.city) {
478        arrayId[i] = 'city';
479        arrayType[i] = 'nem';
480        arrayParams[i] = '';
481        arrayErrorMessages[i] = '';
482        i++;
483    }
484
485    if (register_field_require.state) {
486        arrayId[i] = 'state';
487        arrayType[i] = 'nem';
488        arrayParams[i] = '';
489        arrayErrorMessages[i] = '';
490        i++;
491    }
492
493    if (register_field_require.country) {
494        arrayId[i] = 'country';
495        arrayType[i] = 'notn';
496        arrayParams[i] = '';
497        arrayErrorMessages[i] = '';
498        i++;
499    }
500
501    if (register_field_require.phone) {
502        arrayId[i] = 'phone';
503        arrayType[i] = 'nem';
504        arrayParams[i] = '';
505        arrayErrorMessages[i] = '';
506        i++;
507    }
508
509    if (register_field_require.mobil_phone) {
510        arrayId[i] = 'mobil_phone';
511        arrayType[i] = 'nem';
512        arrayParams[i] = '';
513        arrayErrorMessages[i] = '';
514        i++;
515    }
516
517    if (register_field_require.fax) {
518        arrayId[i] = 'fax';
519        arrayType[i] = 'nem';
520        arrayParams[i] = '';
521        arrayErrorMessages[i] = '';
522        i++;
523    }
524
525    if (register_field_require.ext_field_1) {
526        arrayId[i] = 'ext_field_1';
527        arrayType[i] = 'nem';
528        arrayParams[i] = '';
529        arrayErrorMessages[i] = '';
530        i++;
531    }
532
533    if (register_field_require.ext_field_2) {
534        arrayId[i] = 'ext_field_2';
535        arrayType[i] = 'nem';
536        arrayParams[i] = '';
537        arrayErrorMessages[i] = '';
538        i++;
539    }
540
541    if (register_field_require.ext_field_3) {
542        arrayId[i] = 'ext_field_3';
543        arrayType[i] = 'nem';
544        arrayParams[i] = '';
545        arrayErrorMessages[i] = '';
546        i++;
547    }
548
549    if (register_field_require.privacy_statement) {
550        arrayId[i] = 'privacy_statement';
551        arrayType[i] = 'chk';
552        arrayParams[i] = '';
553        arrayErrorMessages[i] = '';
554        i++;
555    }
556
557    if ($_('delivery_adress_2')) {
558        if ($F_('delivery_adress_2')) {
559
560            if (register_field_require.d_title) {
561                arrayId[i] = 'd_title';
562                arrayType[i] = 'notn';
563                arrayParams[i] = '';
564                arrayErrorMessages[i] = '';
565                i++;
566            }
567
568            if (register_field_require.d_f_name) {
569                arrayId[i] = 'd_f_name';
570                arrayType[i] = 'nem';
571                arrayParams[i] = '';
572                arrayErrorMessages[i] = '';
573                i++;
574            }
575
576            if (register_field_require.d_l_name) {
577                arrayId[i] = 'd_l_name';
578                arrayType[i] = 'nem';
579                arrayParams[i] = '';
580                arrayErrorMessages[i] = '';
581                i++;
582            }
583
584            if (register_field_require.d_m_name) {
585                arrayId[i] = 'd_m_name';
586                arrayType[i] = 'nem';
587                arrayParams[i] = '';
588                arrayErrorMessages[i] = '';
589                i++;
590            }
591
592            if (register_field_require.d_firma_name) {
593                arrayId[i] = 'd_firma_name';
594                arrayType[i] = 'nem';
595                arrayParams[i] = '';
596                arrayErrorMessages[i] = '';
597                i++;
598            }
599
600            if (register_field_require.d_email) {
601                arrayId[i] = 'd_email';
602                arrayType[i] = 'em';
603                arrayParams[i] = '';
604                arrayErrorMessages[i] = '';
605                i++;
606            }
607
608            if (register_field_require.d_birthday) {
609                arrayId[i] = 'd_birthday';
610                arrayType[i] = 'nem';
611                arrayParams[i] = '';
612                arrayErrorMessages[i] = '';
613                i++;
614            }
615
616            if (register_field_require.d_home) {
617                arrayId[i] = 'd_home';
618                arrayType[i] = 'nem';
619                arrayParams[i] = '';
620                arrayErrorMessages[i] = '';
621                i++;
622            }
623
624            if (register_field_require.d_apartment) {
625                arrayId[i] = 'd_apartment';
626                arrayType[i] = 'nem';
627                arrayParams[i] = '';
628                arrayErrorMessages[i] = '';
629                i++;
630            }
631
632            if (register_field_require.d_street) {
633                arrayId[i] = 'd_street';
634                arrayType[i] = 'nem';
635                arrayParams[i] = '';
636                arrayErrorMessages[i] = '';
637                i++;
638            }
639
640            if (register_field_require.d_street_nr) {
641                arrayId[i] = 'd_street_nr';
642                arrayType[i] = 'nem';
643                arrayParams[i] = '';
644                arrayErrorMessages[i] = '';
645                i++;
646            }
647
648            if (register_field_require.d_zip) {
649                arrayId[i] = 'd_zip';
650                arrayType[i] = 'zip';
651                arrayParams[i] = '';
652                arrayErrorMessages[i] = '';
653                i++;
654            }
655
656            if (register_field_require.d_city) {
657                arrayId[i] = 'd_city';
658                arrayType[i] = 'nem';
659                arrayParams[i] = '';
660                arrayErrorMessages[i] = '';
661                i++;
662            }
663
664            if (register_field_require.d_state) {
665                arrayId[i] = 'd_state';
666                arrayType[i] = 'nem';
667                arrayParams[i] = '';
668                arrayErrorMessages[i] = '';
669                i++;
670            }
671
672            if (register_field_require.d_country) {
673                arrayId[i] = 'd_country';
674                arrayType[i] = 'notn';
675                arrayParams[i] = '';
676                arrayErrorMessages[i] = '';
677                i++;
678            }
679
680            if (register_field_require.d_phone) {
681                arrayId[i] = 'd_phone';
682                arrayType[i] = 'nem';
683                arrayParams[i] = '';
684                arrayErrorMessages[i] = '';
685                i++;
686            }
687
688            if (register_field_require.d_mobil_phone) {
689                arrayId[i] = 'd_mobil_phone';
690                arrayType[i] = 'nem';
691                arrayParams[i] = '';
692                arrayErrorMessages[i] = '';
693                i++;
694            }
695
696            if (register_field_require.d_fax) {
697                arrayId[i] = 'd_fax';
698                arrayType[i] = 'nem';
699                arrayParams[i] = '';
700                arrayErrorMessages[i] = '';
701                i++;
702            }
703
704            if (register_field_require.d_ext_field_1) {
705                arrayId[i] = 'd_ext_field_1';
706                arrayType[i] = 'nem';
707                arrayParams[i] = '';
708                arrayErrorMessages[i] = '';
709                i++;
710            }
711
712            if (register_field_require.d_ext_field_2) {
713                arrayId[i] = 'd_ext_field_2';
714                arrayType[i] = 'nem';
715                arrayParams[i] = '';
716                arrayErrorMessages[i] = '';
717                i++;
718            }
719
720            if (register_field_require.d_ext_field_3) {
721                arrayId[i] = 'd_ext_field_3';
722                arrayType[i] = 'nem';
723                arrayParams[i] = '';
724                arrayErrorMessages[i] = '';
725                i++;
726            }
727
728        }
729    }
730    var myForm = new validateForm(formName, arrayId, arrayType, arrayParams, arrayErrorMessages, typeShowError);
731    return error = myForm.validate();
732}
733
734function validateEditAccountForm(livepath, formName) {
735    var typeShowError = 2;
736    var arrayId = new Array();
737    var arrayType = new Array();
738    var arrayParams = new Array();
739    var arrayErrorMessages = new Array();
740
741    var i = 0;
742
743    if (register_field_require.title) {
744        arrayId[i] = 'title';
745        arrayType[i] = 'notn';
746        arrayParams[i] = '';
747        arrayErrorMessages[i] = '';
748        i++;
749    }
750
751    if (register_field_require.f_name) {
752        arrayId[i] = 'f_name';
753        arrayType[i] = 'nem';
754        arrayParams[i] = '';
755        arrayErrorMessages[i] = '';
756        i++;
757    }
758
759    if (register_field_require.l_name) {
760        arrayId[i] = 'l_name';
761        arrayType[i] = 'nem';
762        arrayParams[i] = '';
763        arrayErrorMessages[i] = '';
764        i++;
765    }
766
767    if (register_field_require.m_name) {
768        arrayId[i] = 'm_name';
769        arrayType[i] = 'nem';
770        arrayParams[i] = '';
771        arrayErrorMessages[i] = '';
772        i++;
773    }
774
775    if (register_field_require.firma_name) {
776        arrayId[i] = 'firma_name';
777        arrayType[i] = 'nem';
778        arrayParams[i] = '';
779        arrayErrorMessages[i] = '';
780        i++;
781    }
782
783    if (register_field_require.client_type) {
784        arrayId[i] = 'client_type';
785        arrayType[i] = 'notn';
786        arrayParams[i] = '';
787        arrayErrorMessages[i] = '';
788        i++;
789    }
790
791    if ((document.forms[formName].client_type && document.forms[formName].client_type.value == "2") || !document.forms[formName].client_type) {
792        if (register_field_require.firma_code) {
793            arrayId[i] = 'firma_code';
794            arrayType[i] = 'nem';
795            arrayParams[i] = '';
796            arrayErrorMessages[i] = '';
797            i++;
798        }
799
800        if (register_field_require.tax_number) {
801            arrayId[i] = 'tax_number';
802            arrayType[i] = 'nem';
803            arrayParams[i] = '';
804            arrayErrorMessages[i] = '';
805            i++;
806        }
807    }
808
809    if (register_field_require.email) {
810        arrayId[i] = 'email';
811        arrayType[i] = 'em';
812        arrayParams[i] = '';
813        arrayErrorMessages[i] = '';
814        i++;
815    }
816
817    if (register_field_require.birthday) {
818        arrayId[i] = 'birthday';
819        arrayType[i] = 'nem';
820        arrayParams[i] = '';
821        arrayErrorMessages[i] = '';
822        i++;
823    }
824
825    if (register_field_require.home) {
826        arrayId[i] = 'home';
827        arrayType[i] = 'nem';
828        arrayParams[i] = '';
829        arrayErrorMessages[i] = '';
830        i++;
831    }
832
833    if (register_field_require.apartment) {
834        arrayId[i] = 'apartment';
835        arrayType[i] = 'nem';
836        arrayParams[i] = '';
837        arrayErrorMessages[i] = '';
838        i++;
839    }
840
841    if (register_field_require.street) {
842        arrayId[i] = 'street';
843        arrayType[i] = 'nem';
844        arrayParams[i] = '';
845        arrayErrorMessages[i] = '';
846        i++;
847    }
848
849    if (register_field_require.street_nr) {
850        arrayId[i] = 'street_nr';
851        arrayType[i] = 'nem';
852        arrayParams[i] = '';
853        arrayErrorMessages[i] = '';
854        i++;
855    }
856
857    if (register_field_require.zip) {
858        arrayId[i] = 'zip';
859        arrayType[i] = 'zip';
860        arrayParams[i] = '';
861        arrayErrorMessages[i] = '';
862        i++;
863    }
864
865    if (register_field_require.city) {
866        arrayId[i] = 'city';
867        arrayType[i] = 'nem';
868        arrayParams[i] = '';
869        arrayErrorMessages[i] = '';
870        i++;
871    }
872
873    if (register_field_require.state) {
874        arrayId[i] = 'state';
875        arrayType[i] = 'nem';
876        arrayParams[i] = '';
877        arrayErrorMessages[i] = '';
878        i++;
879    }
880
881    if (register_field_require.country) {
882        arrayId[i] = 'country';
883        arrayType[i] = 'notn';
884        arrayParams[i] = '';
885        arrayErrorMessages[i] = '';
886        i++;
887    }
888
889    if (register_field_require.phone) {
890        arrayId[i] = 'phone';
891        arrayType[i] = 'nem';
892        arrayParams[i] = '';
893        arrayErrorMessages[i] = '';
894        i++;
895    }
896
897    if (register_field_require.mobil_phone) {
898        arrayId[i] = 'mobil_phone';
899        arrayType[i] = 'nem';
900        arrayParams[i] = '';
901        arrayErrorMessages[i] = '';
902        i++;
903    }
904
905    if (register_field_require.fax) {
906        arrayId[i] = 'fax';
907        arrayType[i] = 'nem';
908        arrayParams[i] = '';
909        arrayErrorMessages[i] = '';
910        i++;
911    }
912
913    if (register_field_require.ext_field_1) {
914        arrayId[i] = 'ext_field_1';
915        arrayType[i] = 'nem';
916        arrayParams[i] = '';
917        arrayErrorMessages[i] = '';
918        i++;
919    }
920
921    if (register_field_require.ext_field_2) {
922        arrayId[i] = 'ext_field_2';
923        arrayType[i] = 'nem';
924        arrayParams[i] = '';
925        arrayErrorMessages[i] = '';
926        i++;
927    }
928
929    if (register_field_require.ext_field_3) {
930        arrayId[i] = 'ext_field_3';
931        arrayType[i] = 'nem';
932        arrayParams[i] = '';
933        arrayErrorMessages[i] = '';
934        i++;
935    }
936
937    if (register_field_require.password) {
938        arrayId[i] = 'password';
939        arrayType[i] = 'nem';
940        arrayParams[i] = '';
941        arrayErrorMessages[i] = '';
942        i++;
943    }
944    if (register_field_require.password_2) {
945        arrayId[i] = 'password_2';
946        arrayType[i] = 'eqne';
947        arrayParams[i] = 'password';
948        arrayErrorMessages[i] = '';
949        i++;
950    }
951
952    if (register_field_require.privacy_statement) {
953        arrayId[i] = 'privacy_statement';
954        arrayType[i] = 'chk';
955        arrayParams[i] = '';
956        arrayErrorMessages[i] = '';
957        i++;
958    }
959
960    if ($_('delivery_adress_2')) {
961        if ($F_('delivery_adress_2')) {
962
963            if (register_field_require.d_title) {
964                arrayId[i] = 'd_title';
965                arrayType[i] = 'notn';
966                arrayParams[i] = '';
967                arrayErrorMessages[i] = '';
968                i++;
969            }
970
971            if (register_field_require.d_f_name) {
972                arrayId[i] = 'd_f_name';
973                arrayType[i] = 'nem';
974                arrayParams[i] = '';
975                arrayErrorMessages[i] = '';
976                i++;
977            }
978
979            if (register_field_require.d_l_name) {
980                arrayId[i] = 'd_l_name';
981                arrayType[i] = 'nem';
982                arrayParams[i] = '';
983                arrayErrorMessages[i] = '';
984                i++;
985            }
986
987            if (register_field_require.d_m_name) {
988                arrayId[i] = 'd_m_name';
989                arrayType[i] = 'nem';
990                arrayParams[i] = '';
991                arrayErrorMessages[i] = '';
992                i++;
993            }
994
995            if (register_field_require.d_firma_name) {
996                arrayId[i] = 'd_firma_name';
997                arrayType[i] = 'nem';
998                arrayParams[i] = '';
999                arrayErrorMessages[i] = '';
1000                i++;
1001            }
1002
1003            if (register_field_require.d_email) {
1004                arrayId[i] = 'd_email';
1005                arrayType[i] = 'em';
1006                arrayParams[i] = '';
1007                arrayErrorMessages[i] = '';
1008                i++;
1009            }
1010
1011            if (register_field_require.d_birthday) {
1012                arrayId[i] = 'd_birthday';
1013                arrayType[i] = 'nem';
1014                arrayParams[i] = '';
1015                arrayErrorMessages[i] = '';
1016                i++;
1017            }
1018
1019            if (register_field_require.d_home) {
1020                arrayId[i] = 'd_home';
1021                arrayType[i] = 'nem';
1022                arrayParams[i] = '';
1023                arrayErrorMessages[i] = '';
1024                i++;
1025            }
1026
1027            if (register_field_require.d_apartment) {
1028                arrayId[i] = 'd_apartment';
1029                arrayType[i] = 'nem';
1030                arrayParams[i] = '';
1031                arrayErrorMessages[i] = '';
1032                i++;
1033            }
1034
1035            if (register_field_require.d_street) {
1036                arrayId[i] = 'd_street';
1037                arrayType[i] = 'nem';
1038                arrayParams[i] = '';
1039                arrayErrorMessages[i] = '';
1040                i++;
1041            }
1042
1043            if (register_field_require.d_street_nr) {
1044                arrayId[i] = 'd_street_nr';
1045                arrayType[i] = 'nem';
1046                arrayParams[i] = '';
1047                arrayErrorMessages[i] = '';
1048                i++;
1049            }
1050
1051            if (register_field_require.d_zip) {
1052                arrayId[i] = 'd_zip';
1053                arrayType[i] = 'zip';
1054                arrayParams[i] = '';
1055                arrayErrorMessages[i] = '';
1056                i++;
1057            }
1058
1059            if (register_field_require.d_city) {
1060                arrayId[i] = 'd_city';
1061                arrayType[i] = 'nem';
1062                arrayParams[i] = '';
1063                arrayErrorMessages[i] = '';
1064                i++;
1065            }
1066
1067            if (register_field_require.d_state) {
1068                arrayId[i] = 'd_state';
1069                arrayType[i] = 'nem';
1070                arrayParams[i] = '';
1071                arrayErrorMessages[i] = '';
1072                i++;
1073            }
1074
1075            if (register_field_require.d_country) {
1076                arrayId[i] = 'd_country';
1077                arrayType[i] = 'notn';
1078                arrayParams[i] = '';
1079                arrayErrorMessages[i] = '';
1080                i++;
1081            }
1082
1083            if (register_field_require.d_phone) {
1084                arrayId[i] = 'd_phone';
1085                arrayType[i] = 'nem';
1086                arrayParams[i] = '';
1087                arrayErrorMessages[i] = '';
1088                i++;
1089            }
1090
1091            if (register_field_require.d_mobil_phone) {
1092                arrayId[i] = 'd_mobil_phone';
1093                arrayType[i] = 'nem';
1094                arrayParams[i] = '';
1095                arrayErrorMessages[i] = '';
1096                i++;
1097            }
1098
1099            if (register_field_require.d_fax) {
1100                arrayId[i] = 'd_fax';
1101                arrayType[i] = 'nem';
1102                arrayParams[i] = '';
1103                arrayErrorMessages[i] = '';
1104                i++;
1105            }
1106
1107            if (register_field_require.d_ext_field_1) {
1108                arrayId[i] = 'd_ext_field_1';
1109                arrayType[i] = 'nem';
1110                arrayParams[i] = '';
1111                arrayErrorMessages[i] = '';
1112                i++;
1113            }
1114
1115            if (register_field_require.d_ext_field_2) {
1116                arrayId[i] = 'd_ext_field_2';
1117                arrayType[i] = 'nem';
1118                arrayParams[i] = '';
1119                arrayErrorMessages[i] = '';
1120                i++;
1121            }
1122
1123            if (register_field_require.d_ext_field_3) {
1124                arrayId[i] = 'd_ext_field_3';
1125                arrayType[i] = 'nem';
1126                arrayParams[i] = '';
1127                arrayErrorMessages[i] = '';
1128                i++;
1129            }
1130
1131        }
1132    }
1133    var myForm = new validateForm(formName, arrayId, arrayType, arrayParams, arrayErrorMessages, typeShowError);
1134    return error = myForm.validate();
1135}
1136
1137function validateFormAdvancedSearch(formName) {
1138    var arrayId = new Array('date_from', 'date_to', 'price_from', 'price_to');
1139    var arrayType = new Array('date|em', 'date|em', 'fl|em|0', 'fl|em');
1140    var arrayParams = new Array('', '');
1141    var arrayErrorMessages = new Array('', '');
1142    var myForm = new validateForm(formName, arrayId, arrayType, arrayParams, arrayErrorMessages, 2);
1143    error = myForm.validate();
1144    return error;
1145}
1146
1147function validateReviewForm(formName) {
1148    var arrayId = new Array('review_user_name', 'review_user_email', 'review_review');
1149    var arrayType = new Array('nem', 'em', 'nem');
1150    var arrayParams = new Array('', '');
1151    var arrayErrorMessages = new Array('', '');
1152    var myForm = new validateForm(formName, arrayId, arrayType, arrayParams, arrayErrorMessages, 2);
1153    error = myForm.validate();
1154    return error;
1155}
1156
1157function checkAGBAndNoReturn(agb, no_return) {
1158    result1 = result2 = true;
1159    if (agb == '1') result1 = checkAGB();
1160    if (no_return == '1') result2 = checkNoReturn();
1161    if (result1 && result2)
1162        return true;
1163    else
1164        return false;
1165}
1166
1167function checkAGB() {
1168    if ($_("agb").checked) {
1169        jQuery(".row_agb").removeClass('fielderror');
1170        return true;
1171    } else {
1172        jQuery(".row_agb").addClass('fielderror');
1173        jQuery('#agb').focus();
1174        return false;
1175    }
1176}
1177
1178function checkNoReturn() {
1179    if ($_("no_return").checked) {
1180        jQuery(".row_no_return").removeClass('fielderror');
1181        return true;
1182    } else {
1183        jQuery(".row_no_return").addClass('fielderror');
1184        jQuery('#no_return').focus();
1185        return false;
1186    }
1187}
1188
1189var activePaymentMethod = "";
1190
1191function showPaymentForm(paymentMethod) {
1192    activePaymentMethod = paymentMethod;
1193    jQuery("*[id^='tr_payment_']").hide();
1194    jQuery('#tr_payment_' + paymentMethod).show();
1195}
1196
1197function checkPaymentForm() {
1198    if (activePaymentMethod) {
1199        if (payment_type_check[activePaymentMethod] == '1') {
1200            try {
1201                eval("check_" + activePaymentMethod + "();");
1202            } catch (exception) {
1203                console.log(exception);
1204                jQuery('#payment_form').submit();
1205            }
1206        } else {
1207            jQuery('#payment_form').submit();
1208        }
1209    }
1210}
1211
1212function isInt_5_8(value) {
1213    var pattern = /^(\d){5,8}$/;
1214    return ret = (pattern.test(value)) ? (1) : (0);
1215}
1216
1217function validateShippingMethods() {
1218    var tableShip = $_('table_shippings');
1219    var inputs = tableShip.getElementsByTagName('input');
1220    for (var i = 0; i < inputs.length; i++) {
1221        if (inputs[i].type != 'radio') continue;
1222        if (inputs[i].checked) return true;
1223    }
1224    return false;
1225}
1226
1227function showShippingForm(id) {
1228    jQuery("div.shipping_form").removeClass('shipping_form_active');
1229    jQuery("#shipping_form_" + id).addClass('shipping_form_active');
1230}
1231
1232function hideElement(idElement) {
1233    $_(idElement).style.display = 'none';
1234}
1235
1236function disableElement(idElement) {
1237    $_(idElement).disabled = true;
1238}
1239
1240function submitListProductFilterSortDirection() {
1241    $_('orderby').value = $_('orderby').value ^ 1;
1242    submitListProductFilters();
1243}
1244
1245function submitListProductFilters() {
1246    $_('sort_count').submit();
1247}
1248
1249function clearProductListFilter() {
1250    jQuery("#manufacturers").val("0");
1251    jQuery("#categorys").val("0");
1252    jQuery("#price_from").val("");
1253    jQuery("#price_to").val("");
1254    submitListProductFilters();
1255}
1256
1257var joomshoppingVideoHtml5 = 0;
1258var joomshoppingVideoHtml5Type = '';
1259
1260function showVideo(idElement, width, height) {
1261    var videofile = jQuery("#" + idElement).attr("href");
1262
1263    jQuery('.video_full').hide();
1264    jQuery('#hide_' + idElement).attr("href", videofile);
1265    jQuery('a.lightbox').hide();
1266    jQuery('#main_image').hide();
1267    jQuery(".product_label").hide();
1268    jQuery("#videoshophtml5").remove();
1269    if (!joomshoppingVideoHtml5) {
1270        jQuery('#hide_' + idElement).show();
1271        jQuery('#hide_' + idElement).media({ width: width, height: height });
1272    } else {
1273        var videoOptions = {
1274            id: 'videoshophtml5',
1275            src: videofile,
1276            width: width,
1277            height: height,
1278            controls: true
1279        };
1280        if (joomshoppingVideoHtml5Type != '') {
1281            videoOptions.type = joomshoppingVideoHtml5Type;
1282        }
1283        var video = jQuery('<video />', videoOptions);
1284        video.appendTo(jQuery('.image_middle'));
1285    }
1286}
1287
1288function showVideoCode(idElement) {
1289    jQuery('.video_full:not(#hide_' + idElement + ')').hide();
1290    jQuery('a.lightbox').hide();
1291    jQuery('#main_image').hide();
1292    jQuery(".product_label").hide();
1293    jQuery("#videoshophtml5").remove();
1294    jQuery('#hide_' + idElement).show();
1295}
1296
1297function showImage(id) {
1298    jQuery('.video_full').hide();
1299    jQuery("#videoshophtml5").remove();
1300    jQuery('a.lightbox').hide();
1301    jQuery("#main_image_full_" + id).show();
1302    jQuery(".product_label").show();
1303}
1304
1305function playMusic(idElement) {
1306    jQuery('#' + idElement).media({ width: 100, height: 20, autoplay: true });
1307}
1308
1309function showHideReview() {
1310    jQuery('#jshop_review_write').show();
1311}
1312
1313function formatprice(price) {
1314    if (typeof(decimal_count) === 'undefined') decimal_count = 2;
1315    if (typeof(decimal_symbol) === 'undefined') decimal_symbol = ".";
1316    price = price.toFixed(decimal_count).toString();
1317    price = price.replace('.', decimal_symbol);
1318    res = format_currency.replace("Symb", currency_code);
1319    res = res.replace("00", price);
1320    return res;
1321}
1322
1323var prevAjaxHandler = null;
1324var reloadAttribEvents = [];
1325var extdataurlupdateattr = {};
1326
1327function reloadAttribSelectAndPrice(id_select) {
1328    var product_id = jQuery("#product_id").val();
1329    var qty = jQuery("#quantity").val();
1330    var data = {};
1331    data["change_attr"] = id_select;
1332    data["qty"] = qty;
1333    for (var i = 0; i < attr_list.length; i++) {
1334        var id = attr_list[i];
1335        data["attr[" + id + "]"] = attr_value[id];
1336    }
1337    for (extdatakey in extdataurlupdateattr) {
1338        data[extdatakey] = extdataurlupdateattr[extdatakey];
1339    }
1340
1341    if (prevAjaxHandler) {
1342        prevAjaxHandler.abort();
1343    }
1344
1345    prevAjaxHandler = jQuery.getJSON(
1346        urlupdateprice,
1347        data,
1348        function(json) {
1349            var reload_atribut = 0;
1350            for (var i = 0; i < attr_list.length; i++) {
1351                var id = attr_list[i];
1352                if (reload_atribut) {
1353                    jQuery("#block_attr_sel_" + id).html(json['id_' + id]);
1354                }
1355                if (id == id_select) reload_atribut = 1;
1356            }
1357
1358            jQuery("#block_price").html(json.price);
1359            jQuery("#pricefloat").val(json.pricefloat);
1360
1361            if (json.basicprice) {
1362                jQuery("#block_basic_price").html(json.basicprice);
1363            }
1364            // Добавляем расчет общей суммы
1365            if (json.pricefloat && qty) {
1366                var totalPrice = parseFloat(json.pricefloat) * parseInt(qty);
1367                jQuery("#total_price").html(formatprice(totalPrice));
1368                jQuery(".total_price").show();
1369            } else {
1370                jQuery(".total_price").hide();
1371            }
1372            for (key in json) {
1373                if (key.substr(0, 3) == "pq_") {
1374                    jQuery("#pricelist_from_" + key.substr(3)).html(json[key]);
1375                }
1376            }
1377
1378            if (json.available == "0") {
1379                jQuery("#not_available").html(translate_not_available);
1380            } else {
1381                jQuery("#not_available").html("");
1382            }
1383
1384            if (json.displaybuttons == "0") {
1385                jQuery(".productfull .prod_buttons").hide();
1386            } else {
1387                jQuery(".productfull .prod_buttons").show();
1388            }
1389
1390            if (json.ean) {
1391                jQuery("#product_code").html(json.ean);
1392            }
1393            if (json.manufacturer_code) {
1394                jQuery("#manufacturer_code").html(json.manufacturer_code);
1395            }
1396
1397            if (json.weight) {
1398                jQuery("#block_weight").html(json.weight);
1399            }
1400            if (json.pricedefault) {
1401                jQuery("#pricedefault").html(json.pricedefault);
1402            }
1403            if (json.qty) {
1404                jQuery("#product_qty").html(json.qty);
1405            }
1406            if (json.oldprice) {
1407                jQuery("#old_price").html(json.oldprice);
1408                jQuery(".old_price").show();
1409            } else {
1410                jQuery(".old_price").hide();
1411            }
1412
1413            if (json.images && json.images.length > 0) {
1414                var count_prod_img = json.images.length;
1415                var html_thumb_img = "";
1416                var html_middle_img = "";
1417                var html_zoom_img = '';
1418                if (typeof(jshop_product_hide_zoom_image) === 'undefined') jshop_product_hide_zoom_image = 0;
1419                if (!jshop_product_hide_zoom_image) {
1420                    html_zoom_img = ' <div class="text_zoom"><img alt="zoom" src="' + liveimgpath + '/search.png" /> ' + translate_zoom_image + '</div>';
1421                }
1422                for (var j = 0; j < count_prod_img; j++) {
1423                    html_thumb_img += '<img class="jshop_img_thumb" src="' + liveproductimgpath + '/thumb_' + json.images[j] + '" onclick = "showImage(' + j + ')" />';
1424                    tmp = 'style="display:none"';
1425                    if (j == 0) tmp = '';
1426                    html_middle_img += '<a class="lightbox" id="main_image_full_' + j + '" href="' + liveproductimgpath + '/full_' + json.images[j] + '" ' + tmp + '><img id="main_image_' + j + '" src="' + liveproductimgpath + '/' + json.images[j] + '" />' + html_zoom_img + '</a>';
1427                }
1428                if (json.displayimgthumb == "1")
1429                    jQuery("#list_product_image_thumb").html(html_thumb_img);
1430                else
1431                    jQuery("#list_product_image_thumb").html("");
1432                jQuery("#list_product_image_middle").html(html_middle_img);
1433                initJSlightBox();
1434            }
1435
1436            if (json.block_image_thumb || json.block_image_middle) {
1437                jQuery("#list_product_image_thumb").html(json.block_image_thumb);
1438                jQuery("#list_product_image_middle").html(json.block_image_middle);
1439                initJSlightBox();
1440            }
1441
1442            if (typeof(json.demofiles) != 'undefined') {
1443                jQuery("#list_product_demofiles").html(json.demofiles);
1444            }
1445
1446            if (json.showdeliverytime) {
1447                if (json.showdeliverytime == "0") {
1448                    jQuery(".productfull .deliverytime").hide();
1449                } else {
1450                    jQuery(".productfull .deliverytime").show();
1451                }
1452            }
1453
1454            jQuery.each(reloadAttribEvents, function(key, handler) {
1455                handler.call(this, json);
1456            });
1457
1458            reloadAttrValue();
1459        }
1460    );
1461}
1462
1463function setAttrValue(id, value) {
1464    attr_value[id] = value;
1465    reloadAttribSelectAndPrice(id);
1466    reloadAttribImg(id, value);
1467}
1468
1469function reloadAttribImg(id, value) {
1470    var path = "";
1471    var img = "";
1472    if (value == "0") {
1473        img = "";
1474    } else {
1475        if (attr_img[value]) {
1476            img = attr_img[value];
1477        } else {
1478            img = "";
1479        }
1480    }
1481
1482    if (img == "") {
1483        path = liveimgpath;
1484        img = "blank.gif";
1485    } else {
1486        path = liveattrpath;
1487    }
1488    jQuery("#prod_attr_img_" + id).attr('src', path + "/" + img);
1489}
1490
1491function reloadAttrValue() {
1492    for (var id in attr_value) {
1493        if (jQuery("input[name=jshop_attr_id\\[" + id + "\\]]").attr("type") == "radio") {
1494            attr_value[id] = jQuery("input[name=jshop_attr_id\\[" + id + "\\]]:checked").val();
1495        } else {
1496            attr_value[id] = jQuery("#jshop_attr_id" + id).val();
1497        }
1498    }
1499}
1500
1501function reloadPrices() {
1502    var qty = jQuery("#quantity").val();
1503    if (qty != "") {
1504        reloadAttribSelectAndPrice(0);
1505
1506        // Пересчет общей суммы при изменении количества
1507        var price = parseFloat(jQuery("#pricefloat").val());
1508        if (price && qty) {
1509            var totalPrice = price * parseInt(qty);
1510            jQuery("#total_price").html(formatprice(totalPrice));
1511            jQuery(".total_price").show();
1512        }
1513    }
1514}
1515
1516function showHideFieldFirm(type_id) {
1517    if (type_id == "2") {
1518        jQuery("#tr_field_firma_code").show();
1519        jQuery('#tr_field_tax_number').show();
1520    } else {
1521        jQuery("#tr_field_firma_code").hide();
1522        jQuery('#tr_field_tax_number').hide();
1523    }
1524}
1525
1526function updateSearchCharacteristic(url, category_id) {
1527    function showResponse(data) {
1528        jQuery("#list_characteristics").html(data);
1529    }
1530    var data = { "category_id": category_id };
1531    jQuery.get(url, data, showResponse);
1532}
1533
1534function registrationTestPassword(pass) {
1535    jQuery.ajax({
1536        type: "POST",
1537        url: urlcheckpassword,
1538        data: { "pass": pass },
1539        dataType: "json"
1540    }).done(function(json) {
1541        if (json.msg) {
1542            jQuery('#reg_test_password').html(json.msg);
1543            jQuery('#reg_test_password').addClass('fielderrormsg');
1544            jQuery('#reg_test_password').removeClass('fieldpassok');
1545        } else {
1546            jQuery('#reg_test_password').html('');
1547            jQuery('#reg_test_password').removeClass('fielderrormsg');
1548            jQuery('#reg_test_password').addClass('fieldpassok');
1549        }
1550    });
1551}
1552
1553jQuery(function() {
1554    jQuery('.registrationTestPassword').keyup(function() {
1555        registrationTestPassword(this.value);
1556    });
1557});

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.