PageSourceSearch

https://www.oisraelishop.co.il/GlobalIncludes/_JS/javascript.js?update=06_10_2026_15_54

js oisraelishop.co.il collected 2026-10-06 12:54:09 UTC 11,300 bytes, 377 lines download raw bytes

1//  ###################################################################
2//	Powered by A&A Digital Agency (From Almir Internet Solutions GROUP)
3//	www.almir.co.il || [email protected]
4//	Developer : Albert Amir
5//	Phone/Fax: +972 04-63-63-281
6//	Mobile: +972 0523731057
7//  ###################################################################
8
9function trackAddToCart(productId, price, currency) 
10{
11    fbq('track', 'AddToCart', {
12        content_ids: [productId], // מזהה המוצר שנוסף לעגלה
13        content_type: 'product', // סוג התוכן (מומלץ: 'product' או 'product_group')
14        value: price, // מחיר המוצר
15        currency: currency // מטבע (למשל, 'ILS' לשקלים)
16    });
17}
18
19
20
21$(document).ready(function() {
22    $(window).scroll(function() {
23        if ($(this).scrollTop() > 20) {
24            $('#toTopBtn').fadeIn();
25        } else {
26            $('#toTopBtn').fadeOut();
27        }
28    });
29
30    $('#toTopBtn').click(function() {
31        $("html, body").animate({
32            scrollTop: 0
33        }, 1500);
34        return false;
35    });
36
37});
38
39
40function SelectedColorOfProduct(GetSuffixName,GetPositions)
41{
42	for(InnerCnt=0;InnerCnt<=30;InnerCnt++)
43	{
44		if(document.getElementById(GetSuffixName+InnerCnt))
45		{
46			if(InnerCnt==GetPositions){
47				$("#"+GetSuffixName+InnerCnt).addClass("SelectedColorOfProduct");
48			} else {
49				$("#"+GetSuffixName+InnerCnt).removeClass("SelectedColorOfProduct");
50			}
51		} 
52	}
53}
54
55function SelectedSizeOfProduct(GetSuffixName,GetPositions)
56{
57	for(InnerCnt=0;InnerCnt<=30;InnerCnt++)
58	{
59		if(document.getElementById(GetSuffixName+InnerCnt))
60		{
61			if(InnerCnt==GetPositions){
62				$("#"+GetSuffixName+InnerCnt).addClass("SelectedSizeOfProduct");
63			} else {
64				$("#"+GetSuffixName+InnerCnt).removeClass("SelectedSizeOfProduct");
65			}
66		} 
67	}
68}
69
70
71function createCookie(name, value, days) {
72    var expires;
73    if (days) {
74        var date = new Date();
75        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
76        expires = "; expires=" + date.toGMTString();
77    }
78    else {
79        expires = "";
80    }
81    document.cookie = name + "=" + value + expires + "; path=/";
82}
83
84function getCookie(c_name)
85{
86    if (document.cookie.length > 0)
87    {
88        c_start = document.cookie.indexOf(c_name + "=");
89        if (c_start != -1) {
90            c_start = c_start + c_name.length + 1;
91            c_end = document.cookie.indexOf(";", c_start);
92            if (c_end == -1) {
93                c_end = document.cookie.length;
94            }
95            return unescape(document.cookie.substring(c_start, c_end));
96        }
97    }
98    return "";
99}
100
101function eraseCookie(name) {   
102    document.cookie = name+'=; Max-Age=-99999999;';  
103}
104
105function strpos (haystack, needle, offset) {
106	//  discuss at: http://locutus.io/php/strpos/
107	//	original by: Kevin van Zonneveld (http://kvz.io)
108	//	improved by: Onno Marsman (https://twitter.com/onnomarsman)
109	//	improved by: Brett Zamir (http://brett-zamir.me)
110	//	bugfixed by: Daniel Esteban
111	//  example 1: strpos('Kevin van Zonneveld', 'e', 5)
112	//  returns 1: 14
113	var i = (haystack + '')
114	.indexOf(needle, (offset || 0))
115	return i === -1 ? false : i
116}
117
118function trim(str, chr) {
119	var rgxtrim = (!chr) ? new RegExp('^\\s+|\\s+$', 'g') : new RegExp('^'+chr+'+|'+chr+'+$', 'g');
120	return str.replace(rgxtrim, '');
121}
122
123
124function rtrim(str, chr) {
125	var rgxtrim = (!chr) ? new RegExp('\\s+$') : new RegExp(chr+'+$');
126	return str.replace(rgxtrim, '');
127}
128
129
130function ltrim(str, chr) {
131	var rgxtrim = (!chr) ? new RegExp('^\\s+') : new RegExp('^'+chr+'+');
132	return str.replace(rgxtrim, '');
133}
134
135function toggler(divId) {
136    $("#"+divId).toggle();
137	/*
138	var obj = document.getElementById(divId);
139
140	if(obj.style.display=='none'){
141		obj.style.display = 'block';
142	} else {
143		obj.style.display = 'none';
144	}
145	*/
146}
147
148
149function copyToClipboard(text) {
150    if (window.clipboardData && window.clipboardData.setData) {
151        // IE specific code path to prevent textarea being shown while dialog is visible.
152        return clipboardData.setData("Text", text); 
153
154    } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
155        var textarea = document.createElement("textarea");
156        textarea.textContent = text;
157        textarea.style.position = "fixed";  // Prevent scrolling to bottom of page in MS Edge.
158        document.body.appendChild(textarea);
159        textarea.select();
160        try {
161            return document.execCommand("copy");  // Security exception may be thrown by some browsers.
162        } catch (ex) {
163            console.warn("העתקה נכשלה", ex);
164            return false;
165        } finally {
166            document.body.removeChild(textarea);
167			alert("העתקה עברה בהצלחה, עכשיו הדביקו את הקישור במיקום הרצוי");
168        }
169    }
170}  
171
172
173function copyToClipboardModalMessage(text,ModalIdMessageOk) {
174    if (window.clipboardData && window.clipboardData.setData) {
175        // IE specific code path to prevent textarea being shown while dialog is visible.
176        return clipboardData.setData("Text", text); 
177
178    } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
179        var textarea = document.createElement("textarea");
180        textarea.textContent = text;
181        textarea.style.position = "fixed";  // Prevent scrolling to bottom of page in MS Edge.
182        document.body.appendChild(textarea);
183        textarea.select();
184        try {
185            return document.execCommand("copy");  // Security exception may be thrown by some browsers.
186        } catch (ex) {
187            console.warn("העתקה נכשלה", ex);
188            return false;
189        } finally {
190            document.body.removeChild(textarea);
191			$('#'+ModalIdMessageOk).first().hide().fadeIn(200).delay(1000).fadeOut(500, function () { /*$(this).remove();*/ });
192        }
193    }
194}
195
196
197function isValidEmailAddress(emailAddress)
198{
199    var pattern = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
200    return pattern.test(emailAddress);
201}
202
203
204function checkPhoneNumber(CHKNumber)
205{
206	TempLength = document.getElementById(CHKNumber.id).value.length;
207	TempValue = document.getElementById(CHKNumber.id).value;
208	FixValue="";
209	for(count = 0; count < TempLength; count++){
210		if (TempValue.substring(count,count+1)=="*"){
211		 FixValue=FixValue+TempValue.substring(count,count+1);
212		}
213		else{
214		   if (!isNaN(TempValue.substring(count,count+1)) && TempValue.substring(count,count+1)!=" ") {
215				FixValue=FixValue+TempValue.substring(count,count+1);
216		   }
217		}
218	}
219	var index888 = FixValue.indexOf( "*" );
220	
221	if (index888 != 0 && (FixValue.length < 9 || FixValue.length > 10))
222	{
223		if (index888 != 0 && (FixValue.length < 9 || FixValue.length > 10))
224		{
225			if (FixValue.length < 9 && document.getElementById(CHKNumber.id).value!=""){
226				/* חסרות ספרות */
227				document.getElementById(CHKNumber.id).value = "";
228				document.getElementById(CHKNumber.id).select();
229				return false;
230			}
231			if (FixValue.length > 15 && document.getElementById(CHKNumber.id).value!=""){
232				/* יותר מידי ספרות */
233				document.getElementById(CHKNumber.id).value = "";
234				document.getElementById(CHKNumber.id).select();
235				return false;
236			}
237		}
238	}
239	//=============================================
240	if (FixValue.length == 9)
241	{
242	   ValueTemp=TempValue.substring(0,2);
243		var reg9 = /^\(?([0-9]{2})\)?[-.]?([0-9]{3})[-.]?([0-9]{4})$/;  
244			var OK = reg9.exec(FixValue);  
245			if (!OK || ValueTemp=="05" || ValueTemp=="01" || ValueTemp=="06" || ValueTemp=="07")  {
246			   document.getElementById(CHKNumber.id).value = "";
247			   document.getElementById(CHKNumber.id).select();
248			   return false;
249			}
250			else  {
251				var formattedPhoneNumber = FixValue.replace(reg9, "$1-$2-$3");
252				 //document.getElementById(CHKNumber.id).value = formattedPhoneNumber;
253			}
254	}
255	
256	if (FixValue.length == 10){
257		var tv = TempValue.substring(0,2)
258		if (tv == "19" || tv == "18" || tv == "17" || tv == "15"){
259		  var reg1800 = /^\(?([0-9]{1})\)?[-.]?([0-9]{3})[-.]?([0-9]{3})[-.]?([0-9]{3})$/;
260		  var formattedPhoneNumber = FixValue.replace(reg1800, "$1-$2-$3-$4");
261		  //document.getElementById(CHKNumber.id).value = formattedPhoneNumber;
262		}
263		else {
264		  ValueTemp10=TempValue.substring(0,2);
265			if (ValueTemp10=="01" || ValueTemp10=="02" || ValueTemp10=="03" || ValueTemp10=="04" || ValueTemp10=="06" || ValueTemp10=="08" || ValueTemp10=="09")  {
266				document.getElementById(CHKNumber.id).value = "";
267				document.getElementById(CHKNumber.id).select();
268				return false;
269			}
270			else{
271				var reg10 = /^\(?([0-9]{3})\)?[-.]?([0-9]{3})[-.]?([0-9]{4})$/;
272				var formattedPhoneNumber =FixValue.replace(reg10, "$1-$2-$3");
273				//document.getElementById(CHKNumber.id).value = formattedPhoneNumber;
274			}
275		}
276	}
277	
278	var index =FixValue.indexOf( "*" );
279	if (index == 0){
280		 document.getElementById(CHKNumber.id).value = FixValue;
281	}
282	//=============================================
283	return true;
284} 
285
286
287
288
289
290
291
292
293/*
294How to use: onkeypress="return isNumberKey(event)"
295*/
296function isNumberKey(event)
297{
298	var charCode = (event.which) ? event.which : event.keyCode;
299	
300	if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))
301 	return false;
302	
303	return true;
304}
305
306
307/*
308How to use: onkeypress="return fun_AllowOnlyAmountAndDot(this.id);"
309*/
310function fun_AllowOnlyAmountAndDot(txt)
311{
312    //alert(event.keyCode);
313	if(event.keyCode > 47 && event.keyCode < 58 || event.keyCode == 46)
314	{
315	   var txtbx=document.getElementById(txt);
316	   var amount = document.getElementById(txt).value;
317	   var present=0;
318	   var count=0;
319
320	   if(amount.indexOf(".",present)||amount.indexOf(".",present+1));
321	   {
322	  // alert('0');
323	   }
324
325	  /*if(amount.length==2)
326	  {
327		if(event.keyCode != 46)
328		return false;
329	  }*/
330	   do
331	   {
332	   present=amount.indexOf(".",present);
333	   if(present!=-1)
334		{
335		 count++;
336		 present++;
337		 }
338	   }
339	   while(present!=-1);
340	   if(present==-1 && amount.length==0 && event.keyCode == 46)
341	   {
342			event.keyCode=0;
343			//alert("Wrong position of decimal point not  allowed !!");
344			return false;
345	   }
346
347	   if(count>=1 && event.keyCode == 46)
348	   {
349
350			event.keyCode=0;
351			//alert("Only one decimal point is allowed !!");
352			return false;
353	   }
354	   if(count==1)
355	   {
356		var lastdigits=amount.substring(amount.indexOf(".")+1,amount.length);
357		if(lastdigits.length>=2)
358					{
359					  //alert("Two decimal places only allowed");
360					  event.keyCode=0;
361					  return false;
362					  }
363	   }
364			return true;
365	}
366	else
367	{
368			event.keyCode=0;
369			//alert("Only Numbers with dot allowed !!");
370			return false;
371	}
372
373}
374
375
376
377

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.