PageSourceSearch

https://fotocom.com.ua/published/SC/html/scripts/js/frame.js

js fotocom.com.ua collected 2026-10-04 05:21:25 UTC 6,921 bytes, 273 lines download raw bytes

1function open_printable_version(link) // opens new window
2{
3	var win = "menubar=no,location=no,resizable=yes,scrollbars=yes";
4	newWin = window.open(link, 'printableWin', win);
5	if(newWin){newWin.focus();}
6}
7
8function confirmUnsubscribe() // unsubscription confirmation
9{
10
11	temp = window.confirm(translate.cnfrm_unsubscribe);
12	if (temp) // delete
13	{
14		window.location = "index.php?killuser=yes";
15	}
16
17}
18
19function validate() // newsletter subscription form validation
20{
21	if (document.subscription_form.email.value.length < 1) {
22		alert(translate.err_input_email);
23		return false;
24	}
25	if (document.subscription_form.email.value == 'Email') {
26		alert(translate.err_input_email);
27		return false;
28	}
29	return true;
30}
31function validate_disc() // review form verification
32{
33	if (document.formD.nick.value.length < 1) {
34		alert(translate.err_input_nickname);
35		return false;
36	}
37
38	if (document.formD.topic.value.length < 1) {
39		alert(translate.err_input_message_subject);
40		return false;
41	}
42	if (document.formD.log.value.length < 1) {
43		alert(translate.err_input_authorize2discuss);
44		return false;
45	}
46
47	return true;
48}
49function validate_search() {
50
51	if (document.Sform.price1.value != ""
52			&& ((document.Sform.price1.value < 0) || isNaN(document.Sform.price1.value))) {
53		alert(translate.err_input_price);
54		return false;
55	}
56	if (document.Sform.price2.value != ""
57			&& ((document.Sform.price2.value < 0) || isNaN(document.Sform.price2.value))) {
58		alert(translate.err_input_price);
59		return false;
60	}
61
62	return true;
63}
64
65function validate_input_digit(e) {
66	var keynum;
67	var keychar;
68	var numcheck;
69	try {
70		if (window.event) // IE
71		{
72			keynum = window.event.keyCode;
73		} else if (e.which) // Netscape/Firefox/Opera
74		{
75			keynum = e.which;
76		}
77	} catch (exception) {
78		alert(exception.message);
79	}
80
81	keynum = parseInt(keynum);
82	if (keynum == 13)
83		return false;// ignore Enter
84	if (keynum >= 33 && keynum <= 40)
85		return true;// skip navigation buttons
86	if (keynum == 8)
87		return true;// skip backspace
88	if (keynum == 17)
89		return true;// skip ctrl
90	if (keynum == 45)
91		return true;// skip insert
92	if (keynum == 46)
93		return true;// skip delete
94	if (keynum >= 96 && keynum <= 105) {
95		keynum -= 48;
96	}
97	keychar = String.fromCharCode(keynum);
98	// alert('char '+keychar+'\n code '+keynum);
99	numcheck = /\d/;
100	return numcheck.test(keychar);
101	var res = numcheck.test(keychar);
102	// if(!res)alert('char '+keychar+'\n code '+keynum);
103	return res;
104}
105
106Behaviour.register({
107
108	'input.input_message' : function(e) {
109
110		e.onfocus = function() {
111
112			this.className = this.className.replace(/input_message/, '')
113					+ ' input_message_focus';
114
115			var value = this.getAttribute('rel');
116			if(!value){
117				value = this.getAttribute('title');
118			}
119			if (this.value != value)
120				return;
121			this.value = '';
122		}
123
124		e.onblur = function() {
125			if (this.value != '')
126				return;
127			this.className = this.className.replace(/input_message_focus/, '')
128					+ ' input_message';
129			var value = this.getAttribute('rel');
130			if(!value){
131				value = this.getAttribute('title');
132			}
133			this.value = value;
134		}
135	},
136	'.add2cart_handler' : function(element) {
137
138		element.onclick = function() {
139
140			var objForm = getFormByElem(this);
141			if (!objForm)
142				return true;
143
144			var r_productParam = getElementsByClass('product_option', objForm);
145
146			var query = '';
147			for (var i = r_productParam.length - 1; i >= 0; i--) {
148
149				if (!parseInt(r_productParam[i].value))
150					continue;
151
152				if (r_productParam[i].name)
153					query += '&' + r_productParam[i].name + '='
154							+ parseInt(r_productParam[i].value);
155			}
156
157			var r_productQty = getElementByClass('product_qty', objForm);
158			if (r_productQty) {
159				r_productQty = parseInt(r_productQty.value);
160				if (r_productQty > 1) {
161					query += '&product_qty=' + r_productQty;
162				}
163			}
164
165			var url = ORIG_LANG_URL
166					+ set_query('?ukey=cart&view=noframe&action=add_product&'
167									+ query + '&productID='
168									+ objForm.getAttribute('rel'), '');
169			openFadeIFrame(url);
170			return false;
171		}
172	},
173	'.product_option' : function(e) {
174		e.onchange = function() {
175			var objForm = getFormByElem(this);
176			if (!objForm)
177				return true;
178
179			var r_productParam = getElementsByClass('product_option', objForm);
180			var price = parseFloat(getElementByClass('product_price', objForm).value);
181			var list_price = 0;
182			var obj = getElementByClass('product_list_price', objForm);
183			if (obj)
184				list_price = parseFloat(obj.value);
185
186			for (var i = r_productParam.length - 1; i >= 0; i--) {
187
188				var option = select_getCurrOption(r_productParam[i]);
189				if (!option)
190					continue;
191
192				price += parseFloat(option.getAttribute('rel'));
193				list_price += parseFloat(option.getAttribute('rel'));
194			}
195
196			getElementByClass('totalPrice', objForm).innerHTML = formatPrice(price);
197			var obj = getElementByClass('regularPrice', objForm);
198			if (obj)
199				obj.innerHTML = formatPrice(list_price);
200			var obj = getElementByClass('youSavePrice', objForm);
201			if (obj)
202				obj.innerHTML = formatPrice(list_price - price)
203						+ ' ('
204						+ Math
205								.round((list_price - price) / list_price * 100,
206										2) + '%)';
207		}
208	},
209	'.hndl_proceed_checkout' : function(e) {
210		e.onclick = function() {
211			openFadeIFrame(ORIG_LANG_URL + set_query('?ukey=cart&view=noframe'));
212			return false;
213		}
214	},
215	'input.goto' : function(e) {
216		e.onclick = function() {
217			if (this.className.search(/confirm/) !== -1
218					&& !window.confirm(this.getAttribute('title')))
219				return
220			document.location.href = this.getAttribute('rel');
221		}
222	},
223	'.gofromfade' : function(e) {
224		e.onclick = function() {
225
226			parent.document.location.href = this.href;
227			parent.closeFadeIFrame();
228			return false;
229		}
230	},
231	'input.digit' : function(e) {
232		e.onkeydown = function(event) {
233			return validate_input_digit(event);
234		}
235	}
236});
237
238Behaviour.addLoadEvent(function() {
239
240	var totalPrices = getElementsByClass('totalPrice');
241	for (var k = totalPrices.length - 1; k >= 0; k--) {
242
243		var objForm = getFormByElem(totalPrices[k]);
244		if (!objForm)
245			continue;;
246
247		var r_productParam = getElementsByClass('product_option', objForm);
248		var price = parseFloat(getElementByClass('product_price', objForm).value);
249		var list_price = 0;
250		var obj = getElementByClass('product_list_price', objForm);
251		if (obj)
252			list_price = parseFloat(obj.value);
253
254		for (var i = r_productParam.length - 1; i >= 0; i--) {
255
256			var option = select_getCurrOption(r_productParam[i]);
257			if (!option)
258				continue;
259
260			price += parseFloat(option.getAttribute('rel'));
261			list_price += parseFloat(option.getAttribute('rel'));
262		}
263		totalPrices[k].innerHTML = formatPrice(price);
264		var obj = getElementByClass('regularPrice', objForm);
265		if (obj)
266			obj.innerHTML = formatPrice(list_price);
267		var obj = getElementByClass('youSavePrice', objForm);
268		if (obj)
269			obj.innerHTML = formatPrice(list_price - price) + ' ('
270					+ Math.round((list_price - price) / list_price * 100, 2)
271					+ '%)';
272	}
273});

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.