PageSourceSearch

https://www.sips.org/js/global.js

js sips.org collected 2026-10-02 08:11:15 UTC 6,620 bytes, 232 lines download raw bytes

1/* Add here all your JS customizations */
2function viewDiv(div) 
3{
4	document.getElementById(div).style.display="block";
5	document.getElementById(div).style.visibility="visible";
6}
7function viewDivInline(div) 
8{
9	document.getElementById(div).style.display="inline-block";
10}
11function hideDiv(div)
12{
13	document.getElementById(div).style.display="none";
14}
15function httpRedirect(link)
16{
17	window.location = "/"+escape(link);
18}
19function resetSearch(link)
20{
21	window.location = escape(link);
22}
23function noenter() 
24{
25  return !(window.event && window.event.keyCode == 13);
26}
27
28
29function viewTableData(div) 
30{
31	document.getElementById(div).style.display="table-row";
32}
33function hideTableData(div)
34{
35	document.getElementById(div).style.display="none";
36}
37function digits_only(evt) /*onkeypress="return digits_only(event)"*/
38{       
39    // Only ASCII charactar in that range allowed 
40    var ASCIICode = (evt.which) ? evt.which : evt.keyCode 
41    if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57)) 
42        return false; 
43    return true; 
44}
45function numbers_only(evt) /*onkeypress="return numbers_only(event)"*/
46{       
47    // Only ASCII charactar in that range allowed 
48    var ASCIICode = (evt.which) ? evt.which : evt.keyCode 
49    if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57) && ASCIICode != 45 && ASCIICode != 46) 
50        return false; 
51    return true; 
52}
53function phone_filter(evt) /*onkeypress="return phone_filter(event)"*/
54{       
55    // Only ASCII charactar in that range allowed 
56    var ASCIICode = (evt.which) ? evt.which : evt.keyCode 
57    if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57) && ASCIICode != 45 && ASCIICode != 46 && ASCIICode != 40 && ASCIICode != 41 && ASCIICode != 32) 
58        return false; 
59    return true; 
60}
61function money_only(evt, decimals=2) /*onkeypress="return money_only(event)"*/
62{       
63    // Only ASCII charactar in that range allowed 
64    var ASCIICode = (evt.which) ? evt.which : evt.keyCode 
65    if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57) && ASCIICode != 45 && ASCIICode != 46 && ASCIICode != 36 && ASCIICode != 44) 
66        return false; 
67    return true; 
68}
69function numbers_percentage_only(evt) /*onkeypress="return numbers_percentage_only(event)"*/
70{       
71    // Only ASCII charactar in that range allowed 
72    var ASCIICode = (evt.which) ? evt.which : evt.keyCode 
73    if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57) && ASCIICode != 45 && ASCIICode != 46 && ASCIICode != 37) 
74        return false; 
75    return true; 
76}
77function money_round(value, decimals=2) 
78{
79	return Number(Math.round(value+'e'+decimals)+'e-'+decimals);
80}
81function letters_only(evt, caps=true)
82{
83	// Only ASCII charactar in that range allowed 
84    var ASCIICode = (evt.which) ? evt.which : evt.keyCode 
85    if((ASCIICode < 65 || 90 < ASCIICode) && (ASCIICode < 97 || 122 < ASCIICode))
86        return false;
87    return true; 
88}
89function checkCCdigits(event) 
90{
91    var code = (event.which) ? event.which : event.keyCode;
92
93    if ((code < 48 || code > 57) && code > 31 && code != 45 && code != 32) {
94        return false;
95    }
96
97    return true;
98}
99function checkCCExpiration(event)
100{
101	    var code = (event.which) ? event.which : event.keyCode;
102
103    if ((code < 48 || code > 57) && code > 31 && code != 47) {
104        return false;
105    }
106
107    return true;
108}
109function cc_format(ccid,ctid) 
110{
111	// supports Amex, Master Card, Visa, and Discover
112	// parameter 1 ccid= id of credit card number field
113	// parameter 2 ctid= id of credit card type field
114	
115	var ccNumString=document.getElementById(ccid).value;
116	ccNumString=ccNumString.replace(/[^0-9]/g, '');
117	// mc, starts with - 51 to 55
118	// v, starts with - 4
119	// dsc, starts with 6011, 622126-622925, 644-649, 65
120	// amex, starts with 34 or 37
121	var typeCheck = ccNumString.substring(0, 2);
122	var cType='';
123	var block1='';
124	var block2='';
125	var block3='';
126	var block4='';
127	var formatted='';
128	
129	if  (typeCheck.length==2) {
130	    typeCheck=parseInt(typeCheck);
131	    if (typeCheck >= 40 && typeCheck <= 49) {
132	        cType='Visa';
133	    }
134	    else if (typeCheck >= 51 && typeCheck <= 55) {
135	        cType='Master Card';
136	    }
137	    else if ((typeCheck >= 60 && typeCheck <= 62) || (typeCheck == 64) || (typeCheck == 65)) {
138	        cType='Discover';
139	    }
140	    else if (typeCheck==34 || typeCheck==37) {
141	        cType='American Express';
142	    }
143	    else {
144	        cType='Invalid';
145	    }
146	}
147	
148	// all support card types have a 4 digit firt block
149	block1 = ccNumString.substring(0, 4);
150	if (block1.length==4) {
151	    block1=block1 + '-';
152	}
153	
154	if (cType == 'Visa' || cType == 'Master Card' || cType == 'Discover') {
155	    // for 4X4 cards
156	    block2 = ccNumString.substring(4, 8);
157	    if (block2.length==4) {
158	        block2=block2 + '-';
159	    }
160	    block3 = ccNumString.substring(8, 12);
161	    if (block3.length==4) {
162	        block3=block3 + '-';
163	    }
164	    block4 = ccNumString.substring(12, 16);
165	}
166	else if (cType == 'American Express') {
167	    // for Amex cards
168	    block2 =  ccNumString.substring(4, 10);
169	    if (block2.length==6) {
170	        block2=block2 + '-';
171	    }
172	    block3 =  ccNumString.substring(10, 15);
173	    block4='';
174	}
175	else if (cType == 'Invalid') {
176	    // for Amex cards
177	    block1 =  typeCheck;
178	    block2='';
179	    block3='';
180	    block4='';
181	    alert('Invalid Card Number');
182	}
183	
184	formatted=block1 + block2 + block3 + block4;
185	document.getElementById(ccid).value=formatted;
186	//document.getElementById(ctid).value=cType; //future in case we need to change the color of the icons, etc.
187}
188function formatCreditCardExpiration(exp)
189{
190	var expiration = document.getElementById(exp).value;
191	expiration = expiration.replace(/[^0-9]/g, '');
192	if(expiration.length > 4)
193		document.getElementById(exp).value = expiration.substring(0, 2)+'/'+expiration.substring(2, 6);
194	else if(expiration.length >= 2)
195		document.getElementById(exp).value = expiration.substring(0, 2)+'/'+expiration.substring(2, 4);
196	else
197		document.getElementById(exp).value = expiration;
198}
199
200/* https://www.w3schools.com/charsets/ref_html_ascii.asp */
201
202var owl = $('.owl-carousel');
203owl.owlCarousel({
204	responsive : {
205	    // breakpoint from 0 up
206	    0 : {
207	        items: 2
208	    },
209	    // breakpoint from 480 up
210	    480 : {
211	        items: 3
212	    },
213	    // breakpoint from 768 up
214	    768 : {
215	        items: 4
216	    },
217	    992 : {
218	        items: 6
219	    }
220	},
221    loop:true,
222    margin:10,
223    autoplay:true,
224    autoplayTimeout:3500,
225    autoplayHoverPause:true
226});
227$('.play').on('click',function(){
228    owl.trigger('play.owl.autoplay',[1000])
229})
230$('.stop').on('click',function(){
231    owl.trigger('stop.owl.autoplay')
232})

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.