PageSourceSearch

https://asp-co.org/components/com_jshopping/js/functions.js

js asp-co.org collected 2026-10-03 00:31:46 UTC 32,627 bytes, 1,133 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        }
31        else if (elm.detachEvent) {
32                var r = elm.detachEvent('on' + evType, fn);
33                return r;
34        }
35        else {
36                elm['on' + evType] = null;
37        }
38}
39function addEventMy(elm, evType, fn, useCapture) {
40        if (elm.addEventListener) {
41                elm.addEventListener(evType, fn, useCapture);
42        return true;
43        }
44        else if (elm.attachEvent) {
45                var r = elm.attachEvent('on' + evType, fn);
46                return r;
47        }
48        else {
49                elm['on' + evType] = fn;
50        }
51}
52
53function highlightField(field){
54    $_(field).style.backgroundColor = "#FDC055";
55}
56
57function unhighlightField(formName){
58    var form = document.forms[formName];
59    var countElements = form.length;
60    for (i = 0; i < countElements; i++){
61       	if (form.elements[i].type == 'button' || form.elements[i].type == 'submit' || form.elements[i].type == 'radio' || form.elements[i].type == 'hidden') continue;
62       	form.elements[i].style.backgroundColor = "#FFFFFF";
63    }
64}
65
66function isEmpty(value){
67	var pattern = /\S/;
68	return ret = (pattern.test(value)) ? (0) : (1);
69}
70
71function checkMail(value){
72   var pattern = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
73   return ret = (pattern.test(value)) ? (1) : (0);
74}
75
76function Equal(value1, value2){
77  return (value1 == value2)
78}
79
80function validateRegistrationForm(urlcheckdata, formName){
81    
82    var arrayId = new Array();
83    var arrayType = new Array();
84    var arrayParams = new Array();
85    var arrayErrorMessages = new Array();
86    
87    var i = 0;
88    
89    if (register_field_require.title){
90        arrayId[i] = 'title';
91        arrayType[i] = 'notn';
92        arrayParams[i] = '';
93        arrayErrorMessages[i] = '';
94        i++;
95    }
96    
97    if (register_field_require.f_name){
98        arrayId[i] = 'f_name';
99        arrayType[i] = 'nem';
100        arrayParams[i] = '';
101        arrayErrorMessages[i] = '';
102        i++;
103    }
104    
105    if (register_field_require.l_name){
106        arrayId[i] = 'l_name';
107        arrayType[i] = 'nem';
108        arrayParams[i] = '';
109        arrayErrorMessages[i] = '';
110        i++;
111    }
112    
113    if (register_field_require.firma_name){
114        arrayId[i] = 'firma_name';
115        arrayType[i] = 'nem';
116        arrayParams[i] = '';
117        arrayErrorMessages[i] = '';
118        i++;
119    }
120    
121    if (register_field_require.client_type){
122        arrayId[i] = 'client_type';
123        arrayType[i] = 'notn';
124        arrayParams[i] = '';
125        arrayErrorMessages[i] = '';
126        i++;
127    }    
128    
129    if (document.forms[formName].client_type && document.forms[formName].client_type.value=="2"){
130        if (register_field_require.firma_code){
131            arrayId[i] = 'firma_code';
132            arrayType[i] = 'nem';
133            arrayParams[i] = '';
134            arrayErrorMessages[i] = '';
135            i++;
136        }
137
138        if (register_field_require.tax_number){
139            arrayId[i] = 'tax_number';
140            arrayType[i] = 'nem';
141            arrayParams[i] = '';
142            arrayErrorMessages[i] = '';
143            i++;
144        }
145    }
146    
147    if (register_field_require.email){
148        arrayId[i] = 'email';
149        arrayType[i] = 'em';
150        arrayParams[i] = '';
151        arrayErrorMessages[i] = '';
152        i++;
153    }
154    
155    if (register_field_require.email2){
156        arrayId[i] = 'email';
157        arrayType[i] = 'eqne';
158        arrayParams[i] = 'email2';
159        arrayErrorMessages[i] = '';
160        i++;
161    }
162    
163    if (register_field_require.street){
164        arrayId[i] = 'street';
165        arrayType[i] = 'nem';
166        arrayParams[i] = '';
167        arrayErrorMessages[i] = '';
168        i++;
169    }
170    
171    if (register_field_require.zip){
172        arrayId[i] = 'zip';
173        arrayType[i] = 'zip';
174        arrayParams[i] = '';
175        arrayErrorMessages[i] = '';
176        i++;
177    }
178    
179    if (register_field_require.city){
180        arrayId[i] = 'city';
181        arrayType[i] = 'nem';
182        arrayParams[i] = '';
183        arrayErrorMessages[i] = '';
184        i++;
185    }
186    
187    if (register_field_require.state){
188        arrayId[i] = 'state';
189        arrayType[i] = 'nem';
190        arrayParams[i] = '';
191        arrayErrorMessages[i] = '';
192        i++;
193    }
194    
195    if (register_field_require.country){
196        arrayId[i] = 'country';
197        arrayType[i] = 'notn';
198        arrayParams[i] = '';
199        arrayErrorMessages[i] = '';
200        i++;
201    }
202    
203    if (register_field_require.phone){
204        arrayId[i] = 'phone';
205        arrayType[i] = 'nem';
206        arrayParams[i] = '';
207        arrayErrorMessages[i] = '';
208        i++;
209    }
210    
211    if (register_field_require.mobil_phone){
212        arrayId[i] = 'mobil_phone';
213        arrayType[i] = 'nem';
214        arrayParams[i] = '';
215        arrayErrorMessages[i] = '';
216        i++;
217    }
218    
219    if (register_field_require.fax){
220        arrayId[i] = 'fax';
221        arrayType[i] = 'nem';
222        arrayParams[i] = '';
223        arrayErrorMessages[i] = '';
224        i++;
225    }
226    
227    if (register_field_require.ext_field_1){
228        arrayId[i] = 'ext_field_1';
229        arrayType[i] = 'nem';
230        arrayParams[i] = '';
231        arrayErrorMessages[i] = '';
232        i++;
233    }
234
235    if (register_field_require.ext_field_2){
236        arrayId[i] = 'ext_field_2';
237        arrayType[i] = 'nem';
238        arrayParams[i] = '';
239        arrayErrorMessages[i] = '';
240        i++;
241    }
242
243    if (register_field_require.ext_field_3){
244        arrayId[i] = 'ext_field_3';
245        arrayType[i] = 'nem';
246        arrayParams[i] = '';
247        arrayErrorMessages[i] = '';
248        i++;
249    }   
250    
251    if (register_field_require.u_name){
252        arrayId[i] = 'u_name';
253        arrayType[i] = 'nem';
254        arrayParams[i] = '';
255        arrayErrorMessages[i] = '';
256        i++;    
257    }
258    
259    if (register_field_require.password){
260        arrayId[i] = 'password';
261        arrayType[i] = 'eqne';
262        arrayParams[i] = 'password_2';
263        arrayErrorMessages[i] = '';
264        i++;
265    }
266
267    var typeShowError      = 2;
268	var backCurrent = '#FFFFFF';
269	var backColor   = '#FDC055';
270	var myForm = new validateForm(formName, arrayId, arrayType, arrayParams, arrayErrorMessages, typeShowError, backCurrent, backColor);
271	var error = (myForm.validate()) ? (1) : (0);
272	if (!error){
273		return false;
274	} else {
275        function showResponse(originalRequest){
276           if (originalRequest != 1){
277           	  alert (originalRequest);
278           	  return false;
279           } else {
280           	  document.forms[formName].submit();
281           }
282        }        
283        var udata = {"username":$F_('u_name'),"email":$F_('email')};
284	    jQuery.get(urlcheckdata, udata, showResponse);
285        return false;
286	}
287}
288
289function validateCheckoutAdressForm(livepath, formName){
290    
291    var typeShowError = 2;
292    var backCurrent = '#FFFFFF';
293    var backColor   = '#FDC055';
294
295    var arrayId = new Array();
296    var arrayType = new Array();
297    var arrayParams = new Array();
298    var arrayErrorMessages = new Array();
299    
300    var i = 0;
301    
302    if (register_field_require.title){
303        arrayId[i] = 'title';
304        arrayType[i] = 'notn';
305        arrayParams[i] = '';
306        arrayErrorMessages[i] = '';
307        i++;
308    }
309    
310    if (register_field_require.f_name){
311        arrayId[i] = 'f_name';
312        arrayType[i] = 'nem';
313        arrayParams[i] = '';
314        arrayErrorMessages[i] = '';
315        i++;
316    }
317    
318    if (register_field_require.l_name){
319        arrayId[i] = 'l_name';
320        arrayType[i] = 'nem';
321        arrayParams[i] = '';
322        arrayErrorMessages[i] = '';
323        i++;
324    }
325    
326    if (register_field_require.firma_name){
327        arrayId[i] = 'firma_name';
328        arrayType[i] = 'nem';
329        arrayParams[i] = '';
330        arrayErrorMessages[i] = '';
331        i++;
332    }
333    
334    if (register_field_require.client_type){
335        arrayId[i] = 'client_type';
336        arrayType[i] = 'notn';
337        arrayParams[i] = '';
338        arrayErrorMessages[i] = '';
339        i++;
340    }
341    
342    if (document.forms[formName].client_type && document.forms[formName].client_type.value=="2"){
343        if (register_field_require.firma_code){
344            arrayId[i] = 'firma_code';
345            arrayType[i] = 'nem';
346            arrayParams[i] = '';
347            arrayErrorMessages[i] = '';
348            i++;
349        }
350
351        if (register_field_require.tax_number){
352            arrayId[i] = 'tax_number';
353            arrayType[i] = 'nem';
354            arrayParams[i] = '';
355            arrayErrorMessages[i] = '';
356            i++;
357        }
358    }
359    
360    if (register_field_require.email){
361        arrayId[i] = 'email';
362        arrayType[i] = 'em';
363        arrayParams[i] = '';
364        arrayErrorMessages[i] = '';
365        i++;
366    }
367    
368    if (register_field_require.street){
369        arrayId[i] = 'street';
370        arrayType[i] = 'nem';
371        arrayParams[i] = '';
372        arrayErrorMessages[i] = '';
373        i++;
374    }
375    
376    if (register_field_require.zip){
377        arrayId[i] = 'zip';
378        arrayType[i] = 'zip';
379        arrayParams[i] = '';
380        arrayErrorMessages[i] = '';
381        i++;
382    }
383    
384    if (register_field_require.city){
385        arrayId[i] = 'city';
386        arrayType[i] = 'nem';
387        arrayParams[i] = '';
388        arrayErrorMessages[i] = '';
389        i++;
390    }
391    
392    if (register_field_require.state){
393        arrayId[i] = 'state';
394        arrayType[i] = 'nem';
395        arrayParams[i] = '';
396        arrayErrorMessages[i] = '';
397        i++;
398    }
399    
400    if (register_field_require.country){
401        arrayId[i] = 'country';
402        arrayType[i] = 'notn';
403        arrayParams[i] = '';
404        arrayErrorMessages[i] = '';
405        i++;
406    }
407    
408    if (register_field_require.phone){
409        arrayId[i] = 'phone';
410        arrayType[i] = 'nem';
411        arrayParams[i] = '';
412        arrayErrorMessages[i] = '';
413        i++;
414    }
415    
416    if (register_field_require.mobil_phone){
417        arrayId[i] = 'mobil_phone';
418        arrayType[i] = 'nem';
419        arrayParams[i] = '';
420        arrayErrorMessages[i] = '';
421        i++;
422    }
423    
424    if (register_field_require.fax){
425        arrayId[i] = 'fax';
426        arrayType[i] = 'nem';
427        arrayParams[i] = '';
428        arrayErrorMessages[i] = '';
429        i++;
430    }
431    
432    if (register_field_require.ext_field_1){
433        arrayId[i] = 'ext_field_1';
434        arrayType[i] = 'nem';
435        arrayParams[i] = '';
436        arrayErrorMessages[i] = '';
437        i++;
438    }
439
440    if (register_field_require.ext_field_2){
441        arrayId[i] = 'ext_field_2';
442        arrayType[i] = 'nem';
443        arrayParams[i] = '';
444        arrayErrorMessages[i] = '';
445        i++;
446    }
447
448    if (register_field_require.ext_field_3){
449        arrayId[i] = 'ext_field_3';
450        arrayType[i] = 'nem';
451        arrayParams[i] = '';
452        arrayErrorMessages[i] = '';
453        i++;
454    }
455        
456    if ($_('delivery_adress_2')){
457        if ($F_('delivery_adress_2')){
458            
459            if (register_field_require.d_title){
460                arrayId[i] = 'd_title';
461                arrayType[i] = 'notn';
462                arrayParams[i] = '';
463                arrayErrorMessages[i] = '';
464                i++;
465            }
466            
467            if (register_field_require.d_f_name){
468                arrayId[i] = 'd_f_name';
469                arrayType[i] = 'nem';
470                arrayParams[i] = '';
471                arrayErrorMessages[i] = '';
472                i++;
473            }
474            
475            if (register_field_require.d_l_name){
476                arrayId[i] = 'd_l_name';
477                arrayType[i] = 'nem';
478                arrayParams[i] = '';
479                arrayErrorMessages[i] = '';
480                i++;
481            }
482            
483            if (register_field_require.d_firma_name){
484                arrayId[i] = 'd_firma_name';
485                arrayType[i] = 'nem';
486                arrayParams[i] = '';
487                arrayErrorMessages[i] = '';
488                i++;
489            }
490            
491            if (register_field_require.d_email){
492                arrayId[i] = 'd_email';
493                arrayType[i] = 'em';
494                arrayParams[i] = '';
495                arrayErrorMessages[i] = '';
496                i++;
497            }
498            
499            if (register_field_require.d_street){
500                arrayId[i] = 'd_street';
501                arrayType[i] = 'nem';
502                arrayParams[i] = '';
503                arrayErrorMessages[i] = '';
504                i++;
505            }
506            
507            if (register_field_require.d_zip){
508                arrayId[i] = 'd_zip';
509                arrayType[i] = 'zip';
510                arrayParams[i] = '';
511                arrayErrorMessages[i] = '';
512                i++;
513            }
514            
515            if (register_field_require.d_city){
516                arrayId[i] = 'd_city';
517                arrayType[i] = 'nem';
518                arrayParams[i] = '';
519                arrayErrorMessages[i] = '';
520                i++;
521            }
522            
523            if (register_field_require.d_state){
524                arrayId[i] = 'd_state';
525                arrayType[i] = 'nem';
526                arrayParams[i] = '';
527                arrayErrorMessages[i] = '';
528                i++;
529            }
530            
531            if (register_field_require.d_country){
532                arrayId[i] = 'd_country';
533                arrayType[i] = 'notn';
534                arrayParams[i] = '';
535                arrayErrorMessages[i] = '';
536                i++;
537            }
538            
539            if (register_field_require.d_phone){
540                arrayId[i] = 'd_phone';
541                arrayType[i] = 'nem';
542                arrayParams[i] = '';
543                arrayErrorMessages[i] = '';
544                i++;
545            }
546            
547            if (register_field_require.d_mobil_phone){
548                arrayId[i] = 'd_mobil_phone';
549                arrayType[i] = 'nem';
550                arrayParams[i] = '';
551                arrayErrorMessages[i] = '';
552                i++;
553            }
554            
555            if (register_field_require.d_fax){
556                arrayId[i] = 'd_fax';
557                arrayType[i] = 'nem';
558                arrayParams[i] = '';
559                arrayErrorMessages[i] = '';
560                i++;
561            }
562            
563            if (register_field_require.d_ext_field_1){
564                arrayId[i] = 'd_ext_field_1';
565                arrayType[i] = 'nem';
566                arrayParams[i] = '';
567                arrayErrorMessages[i] = '';
568                i++;
569            }
570
571            if (register_field_require.d_ext_field_2){
572                arrayId[i] = 'd_ext_field_2';
573                arrayType[i] = 'nem';
574                arrayParams[i] = '';
575                arrayErrorMessages[i] = '';
576                i++;
577            }
578
579            if (register_field_require.d_ext_field_3){
580                arrayId[i] = 'd_ext_field_3';
581                arrayType[i] = 'nem';
582                arrayParams[i] = '';
583                arrayErrorMessages[i] = '';
584                i++;
585            }
586            
587        }
588    }
589	var myForm = new validateForm(formName, arrayId, arrayType, arrayParams, arrayErrorMessages, typeShowError, backCurrent, backColor);
590	return error = (myForm.validate()) ? (true) : (false);
591}
592
593function validateEditAccountForm(livepath, formName){
594    
595    var typeShowError = 2;
596    var backCurrent = '#FFFFFF';
597    var backColor   = '#FDC055';
598
599    var arrayId = new Array();
600    var arrayType = new Array();
601    var arrayParams = new Array();
602    var arrayErrorMessages = new Array();
603    
604    var i = 0;
605    
606    if (register_field_require.title){
607        arrayId[i] = 'title';
608        arrayType[i] = 'notn';
609        arrayParams[i] = '';
610        arrayErrorMessages[i] = '';
611        i++;
612    }
613    
614    if (register_field_require.f_name){
615        arrayId[i] = 'f_name';
616        arrayType[i] = 'nem';
617        arrayParams[i] = '';
618        arrayErrorMessages[i] = '';
619        i++;
620    }
621    
622    if (register_field_require.l_name){
623        arrayId[i] = 'l_name';
624        arrayType[i] = 'nem';
625        arrayParams[i] = '';
626        arrayErrorMessages[i] = '';
627        i++;
628    }
629    
630    if (register_field_require.firma_name){
631        arrayId[i] = 'firma_name';
632        arrayType[i] = 'nem';
633        arrayParams[i] = '';
634        arrayErrorMessages[i] = '';
635        i++;
636    }
637    
638    if (register_field_require.client_type){
639        arrayId[i] = 'client_type';
640        arrayType[i] = 'notn';
641        arrayParams[i] = '';
642        arrayErrorMessages[i] = '';
643        i++;
644    }
645    
646    if (document.forms[formName].client_type && document.forms[formName].client_type.value=="2"){
647        if (register_field_require.firma_code){
648            arrayId[i] = 'firma_code';
649            arrayType[i] = 'nem';
650            arrayParams[i] = '';
651            arrayErrorMessages[i] = '';
652            i++;
653        }
654
655        if (register_field_require.tax_number){
656            arrayId[i] = 'tax_number';
657            arrayType[i] = 'nem';
658            arrayParams[i] = '';
659            arrayErrorMessages[i] = '';
660            i++;
661        }
662    }
663    
664    if (register_field_require.email){
665        arrayId[i] = 'email';
666        arrayType[i] = 'em';
667        arrayParams[i] = '';
668        arrayErrorMessages[i] = '';
669        i++;
670    }
671    
672    if (register_field_require.street){
673        arrayId[i] = 'street';
674        arrayType[i] = 'nem';
675        arrayParams[i] = '';
676        arrayErrorMessages[i] = '';
677        i++;
678    }
679    
680    if (register_field_require.zip){
681        arrayId[i] = 'zip';
682        arrayType[i] = 'zip';
683        arrayParams[i] = '';
684        arrayErrorMessages[i] = '';
685        i++;
686    }
687    
688    if (register_field_require.city){
689        arrayId[i] = 'city';
690        arrayType[i] = 'nem';
691        arrayParams[i] = '';
692        arrayErrorMessages[i] = '';
693        i++;
694    }
695    
696    if (register_field_require.state){
697        arrayId[i] = 'state';
698        arrayType[i] = 'nem';
699        arrayParams[i] = '';
700        arrayErrorMessages[i] = '';
701        i++;
702    }
703    
704    if (register_field_require.country){
705        arrayId[i] = 'country';
706        arrayType[i] = 'notn';
707        arrayParams[i] = '';
708        arrayErrorMessages[i] = '';
709        i++;
710    }
711    
712    if (register_field_require.phone){
713        arrayId[i] = 'phone';
714        arrayType[i] = 'nem';
715        arrayParams[i] = '';
716        arrayErrorMessages[i] = '';
717        i++;
718    }
719    
720    if (register_field_require.mobil_phone){
721        arrayId[i] = 'mobil_phone';
722        arrayType[i] = 'nem';
723        arrayParams[i] = '';
724        arrayErrorMessages[i] = '';
725        i++;
726    }    
727    
728    if (register_field_require.fax){
729        arrayId[i] = 'fax';
730        arrayType[i] = 'nem';
731        arrayParams[i] = '';
732        arrayErrorMessages[i] = '';
733        i++;
734    }
735    
736    if (register_field_require.ext_field_1){
737        arrayId[i] = 'ext_field_1';
738        arrayType[i] = 'nem';
739        arrayParams[i] = '';
740        arrayErrorMessages[i] = '';
741        i++;
742    }
743
744    if (register_field_require.ext_field_2){
745        arrayId[i] = 'ext_field_2';
746        arrayType[i] = 'nem';
747        arrayParams[i] = '';
748        arrayErrorMessages[i] = '';
749        i++;
750    }
751
752    if (register_field_require.ext_field_3){
753        arrayId[i] = 'ext_field_3';
754        arrayType[i] = 'nem';
755        arrayParams[i] = '';
756        arrayErrorMessages[i] = '';
757        i++;
758    }
759        
760    if ($_('delivery_adress_2')){
761        if ($F_('delivery_adress_2')){
762            
763            if (register_field_require.d_title){
764                arrayId[i] = 'd_title';
765                arrayType[i] = 'notn';
766                arrayParams[i] = '';
767                arrayErrorMessages[i] = '';
768                i++;
769            }
770            
771            if (register_field_require.d_f_name){
772                arrayId[i] = 'd_f_name';
773                arrayType[i] = 'nem';
774                arrayParams[i] = '';
775                arrayErrorMessages[i] = '';
776                i++;
777            }
778            
779            if (register_field_require.d_l_name){
780                arrayId[i] = 'd_l_name';
781                arrayType[i] = 'nem';
782                arrayParams[i] = '';
783                arrayErrorMessages[i] = '';
784                i++;
785            }
786            
787            if (register_field_require.d_firma_name){
788                arrayId[i] = 'd_firma_name';
789                arrayType[i] = 'nem';
790                arrayParams[i] = '';
791                arrayErrorMessages[i] = '';
792                i++;
793            }
794            
795            if (register_field_require.d_email){
796                arrayId[i] = 'd_email';
797                arrayType[i] = 'em';
798                arrayParams[i] = '';
799                arrayErrorMessages[i] = '';
800                i++;
801            }
802            
803            if (register_field_require.d_street){
804                arrayId[i] = 'd_street';
805                arrayType[i] = 'nem';
806                arrayParams[i] = '';
807                arrayErrorMessages[i] = '';
808                i++;
809            }
810            
811            if (register_field_require.d_zip){
812                arrayId[i] = 'd_zip';
813                arrayType[i] = 'zip';
814                arrayParams[i] = '';
815                arrayErrorMessages[i] = '';
816                i++;
817            }
818            
819            if (register_field_require.d_city){
820                arrayId[i] = 'd_city';
821                arrayType[i] = 'nem';
822                arrayParams[i] = '';
823                arrayErrorMessages[i] = '';
824                i++;
825            }
826            
827            if (register_field_require.d_state){
828                arrayId[i] = 'd_state';
829                arrayType[i] = 'nem';
830                arrayParams[i] = '';
831                arrayErrorMessages[i] = '';
832                i++;
833            }
834            
835            if (register_field_require.d_country){
836                arrayId[i] = 'd_country';
837                arrayType[i] = 'notn';
838                arrayParams[i] = '';
839                arrayErrorMessages[i] = '';
840                i++;
841            }
842            
843            if (register_field_require.d_phone){
844                arrayId[i] = 'd_phone';
845                arrayType[i] = 'nem';
846                arrayParams[i] = '';
847                arrayErrorMessages[i] = '';
848                i++;
849            }
850            
851            if (register_field_require.d_mobil_phone){
852                arrayId[i] = 'd_mobil_phone';
853                arrayType[i] = 'nem';
854                arrayParams[i] = '';
855                arrayErrorMessages[i] = '';
856                i++;
857            }            
858            
859            if (register_field_require.d_fax){
860                arrayId[i] = 'd_fax';
861                arrayType[i] = 'nem';
862                arrayParams[i] = '';
863                arrayErrorMessages[i] = '';
864                i++;
865            }
866            
867            if (register_field_require.d_ext_field_1){
868                arrayId[i] = 'd_ext_field_1';
869                arrayType[i] = 'nem';
870                arrayParams[i] = '';
871                arrayErrorMessages[i] = '';
872                i++;
873            }
874
875            if (register_field_require.d_ext_field_2){
876                arrayId[i] = 'd_ext_field_2';
877                arrayType[i] = 'nem';
878                arrayParams[i] = '';
879                arrayErrorMessages[i] = '';
880                i++;
881            }
882
883            if (register_field_require.d_ext_field_3){
884                arrayId[i] = 'd_ext_field_3';
885                arrayType[i] = 'nem';
886                arrayParams[i] = '';
887                arrayErrorMessages[i] = '';
888                i++;
889            }
890            
891        }
892    }
893    var myForm = new validateForm(formName, arrayId, arrayType, arrayParams, arrayErrorMessages, typeShowError, backCurrent, backColor);
894    return error = (myForm.validate()) ? (true) : (false);
895}
896
897function validateFormAdvancedSearch(formName){
898    var arrayId            = new Array('date_from', 'date_to', 'price_from', 'price_to');
899    var arrayType          = new Array('date|em', 'date|em', 'fl|em|0', 'fl|em');
900    var arrayParams        = new Array('', '');
901    var arrayErrorMessages = new Array('', '');
902    var typeShowError      = 2;
903	var backCurrent = '#FFFFFF';
904	var backColor   = '#FDC055';
905    var myForm = new validateForm(formName, arrayId, arrayType, arrayParams, arrayErrorMessages, typeShowError, backCurrent, backColor);
906    error = myForm.validate(); 
907    return error;
908}
909
910function checkAGB(){
911    if ($_("agb").checked){        
912        return true;
913    }else{
914        jQuery(".row_agb").css({"background-color":"#FDC055"})
915        return false;
916    }
917} 
918
919var activePaymentMethod = "";
920function showPaymentForm(paymentMethod){
921    activePaymentMethod = paymentMethod;
922    jQuery("tr[id^='tr_payment_']").hide();
923    jQuery('#tr_payment_'+paymentMethod).show();
924}
925
926function checkPaymentForm(){
927    if (activePaymentMethod){        
928        if (payment_type_check[activePaymentMethod]=='1'){
929            eval("check_"+activePaymentMethod+"();");    
930        }else{
931            $_('payment_form').submit();
932        }
933    }
934}
935
936function isInt_5_8(value){
937	var pattern = /^(\d){5,8}$/;
938	return ret = (pattern.test(value)) ? (1) : (0);
939}
940
941function validateShippingMethods(){
942    var tableShip = $_('table_shippings');
943    var inputs = tableShip.getElementsByTagName('input');
944    for (var i=0; i<inputs.length; i++){
945    	if (inputs[i].type != 'radio') continue;
946        if (inputs[i].checked) return true;
947    }
948    return false;
949}
950
951function hideElement(idElement){
952    $_(idElement).style.display = 'none';
953}
954
955function disableElement(idElement){
956    $_(idElement).disabled = true;
957}
958
959function submitListProductFilterSortDirection(){
960    $_('orderby').value = $_('orderby').value ^ 1;
961    submitListProductFilters();
962}
963
964function submitListProductFilters(){
965    $_('sort_count').submit();
966}
967
968function clearProductListFilter(){
969    jQuery("#manufacturers").val("0");
970    jQuery("#categorys").val("0");
971    jQuery("#price_from").val("");
972    jQuery("#price_to").val("");
973    submitListProductFilters();
974}
975
976function showVideo(idElement, width, height){
977	jQuery('.video_full').hide();
978    jQuery('#hide_' + idElement).attr("href", jQuery("#"+idElement).attr("href"));
979	jQuery('a.lightbox').hide();
980    jQuery('#main_image').hide();
981	jQuery('#hide_' + idElement).show();
982    
983	jQuery('#hide_' + idElement).media( { width: width, height: height} );
984    jQuery(".product_label").hide();
985}
986
987function showImage(id){    
988    jQuery('.video_full').hide();
989    jQuery('a.lightbox').hide();
990    jQuery("#main_image_full_"+id).show();
991    jQuery(".product_label").show();    
992}
993
994function playMusic(idElement){
995	jQuery('#' + idElement).media( { width: 100, height: 20, autoplay:true } );
996}
997
998function showHideReview(){
999	jQuery('#jshop_review_write').show();
1000}
1001
1002function formatprice(price){
1003    res = format_currency.replace("Symb",currency_code);
1004    res = res.replace("00",price);
1005return res;
1006}
1007
1008var prevAjaxHandler = null;
1009function reloadAttribSelectAndPrice(id_select){
1010    var product_id = jQuery("#product_id").val();
1011    var qty = jQuery("#quantity").val();
1012    var data = {};
1013    data["change_attr"] = id_select;
1014    data["qty"] = qty;    
1015    for(var i=0;i<attr_list.length;i++){
1016        var id = attr_list[i];        
1017        data["attr["+id+"]"] = attr_value[id];
1018    }
1019    
1020    if (prevAjaxHandler){
1021        prevAjaxHandler.abort();
1022    }
1023    
1024    prevAjaxHandler = jQuery.getJSON(
1025        urlupdateprice,
1026        data,
1027        function(json){
1028            var reload_atribut = 0;
1029            for(var i=0;i<attr_list.length;i++){
1030                var id = attr_list[i];
1031                if (reload_atribut){
1032                    jQuery("#block_attr_sel_"+id).html(json['id_'+id]);
1033                }
1034                if (id == id_select) reload_atribut = 1;
1035            }            
1036            jQuery("#block_price").html(json.price);
1037            if (product_basic_price_volume>0){
1038                var a_basic_price_volume = json.wvu;
1039                var volume = product_basic_price_volume;
1040                if (a_basic_price_volume>0) volume = a_basic_price_volume;                                    
1041                var basicPrice = parseFloat(json.pricefloat / volume) * product_basic_price_unit_qty;                                
1042                basicPrice = basicPrice.toFixed(2).toString();
1043                basicPrice = basicPrice.replace('.',',');
1044                jQuery("#block_basic_price").html(formatprice(basicPrice));
1045            }
1046            for(key in json){
1047                if (key.substr(0,3)=="pq_"){                    
1048                    jQuery("#pricelist_from_"+key.substr(3)).html(json[key]);
1049                }
1050            }
1051            
1052            if (json.available=="0"){
1053                jQuery("#not_available").html(translate_not_available);
1054            }else{
1055                jQuery("#not_available").html("");
1056            }
1057            
1058            if (json.ean){
1059                jQuery("#product_code").html(json.ean);
1060            }
1061            
1062            if (json.weight){
1063                jQuery("#block_weight").html(json.weight);
1064            }
1065            
1066            reloadAttrValue();
1067        }
1068    );
1069}
1070
1071function setAttrValue(id, value){
1072    attr_value[id] = value;
1073    reloadAttribSelectAndPrice(id);
1074    reloadAttribImg(id, value);
1075}
1076
1077function reloadAttribImg(id, value){
1078    var path = "";
1079    var img = "";
1080    if (value=="0"){
1081        img = "";
1082    }else{
1083        if (attr_img[value]){
1084            img = attr_img[value];
1085        }else{
1086            img = "";
1087        }
1088    }
1089    
1090    if (img==""){
1091        path = liveimgpath;
1092        img = "blank.gif";
1093    }else{
1094        path = liveattrpath;
1095    }
1096    
1097    jQuery("#prod_attr_img_"+id).attr('src', path+"/"+img);
1098}
1099
1100function reloadAttrValue(){
1101    for(var id in attr_value){        
1102        if (jQuery("input[name=jshop_attr_id\\["+id+"\\]]").attr("type")=="radio"){
1103            attr_value[id] = jQuery("input[name=jshop_attr_id\\["+id+"\\]]:checked").val();
1104        }else{
1105            attr_value[id] = jQuery("#jshop_attr_id"+id).val();
1106        }
1107    }    
1108}
1109
1110function reloadPrices(){
1111    var qty = jQuery("#quantity").val();
1112    if (qty!=""){
1113        reloadAttribSelectAndPrice(0);
1114    }
1115}
1116
1117function showHideFieldFirm(type_id){
1118    if (type_id=="2"){
1119        jQuery("#tr_field_firma_code").show();
1120        jQuery('#tr_field_tax_number').show();        
1121    }else{
1122        jQuery("#tr_field_firma_code").hide();
1123        jQuery('#tr_field_tax_number').hide();
1124    }
1125}
1126
1127function updateSearchCharacteristic(url, category_id){    
1128    function showResponse(data){
1129        jQuery("#list_characteristics").html(data);
1130    }
1131    var data = {"category_id":category_id};
1132    jQuery.get(url, data, showResponse);
1133}

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.