PageSourceSearch

http://www.kazansafe.ru/templates/template1/hostcms.js

js kazansafe.ru collected 2026-10-05 00:01:37 UTC 7,251 bytes, 285 lines download raw bytes

1var prev_comment = 0;
2
3// Ответ на комментарий
4function cr(comment_id)
5{
6	if (prev_comment && prev_comment != comment_id)
7	{
8		document.getElementById(prev_comment).style.display = 'none';
9	}
10
11	var div = document.getElementById(comment_id);
12
13	if (div.style.display != 'block')
14	{
15		div.style.display = 'block';
16	}
17	else
18	{
19		div.style.display = 'none';
20	}
21
22	prev_comment = comment_id;
23}
24
25var temp_ChildId = '';
26var temp_CurrenElementId = '';
27var menu_timeout_id = 0;
28var filter_timeout_id = 0;
29
30// обработчик наведения мыши на меню
31function TopMenuOver(CurrenElementId, ChildId)
32{
33	clearTimeout(menu_timeout_id);
34
35	if (temp_CurrenElementId != ''
36	&& temp_CurrenElementId != CurrenElementId)
37	{
38		var oTemp_ChildId = document.getElementById(temp_ChildId);
39
40		if (oTemp_ChildId)
41		{
42			oTemp_ChildId.style.display = "none";
43		}
44	}
45
46	temp_ChildId = ChildId;
47	temp_CurrenElementId = CurrenElementId;
48
49	if (CurrenElementId == undefined)
50	{
51		return false;
52	}
53
54	if (ChildId != '')
55	{
56		var oChildId = document.getElementById(ChildId);
57
58		if (oChildId)
59		{
60			oChildId.style.display = "block";
61			//oChildId.style.opacity = 0.4;
62			//	oChildId.style.filter = 'alpha(opacity=100, style=1, finishopacity=60)';
63			//oChildId.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=0, style=0)";
64		}
65	}
66}
67
68// обработчик уведения мыши с меню
69function TopMenuOut(CurrenElementId, ChildId)
70{
71	if (CurrenElementId == undefined)
72	{
73		return false;
74	}
75
76	if (ChildId != '')
77	{
78		var oChildId = document.getElementById(ChildId);
79		if (oChildId)
80		{
81			menu_timeout_id = setTimeout(function (){oChildId.style.display = "none"}, 300);
82		}
83	}
84}
85
86// Функция обратного вызова для AddIntoCart
87function callbackfunction_AddIntoCart(responseJS)
88{
89	// Результат принят
90	sended_request = false;
91
92	if (typeof responseJS != 'undefined')
93	{
94		// Данные.
95		if (typeof responseJS.cart != 'undefined')
96		{
97			var little_cart = document.getElementById('little_cart');
98
99			if (little_cart)
100			{
101				// Создадим скрытый SPAN для IE, в который поместим текст + скрипт.
102				// Если перед <script> не будет текста, нехороший IE не увидит SCRIPT
103				var span = document.createElement("span");
104				span.style.display = 'none';
105				span.innerHTML = "Stupid IE. " + responseJS.cart;
106
107				runScripts(span.getElementsByTagName('SCRIPT'));
108
109				little_cart.innerHTML = responseJS.cart;
110			}
111			else
112			{
113				alert('Ошибка! Краткая корзина не найдена');
114			}
115		}
116	}
117}
118
119function AddIntoCart(shop_path, item_id, item_count)
120{
121	//location.href = shop_path + 'cart/?ajax_add_item_id=' + item_id + '&count=' + item_count;
122	cmsrequest = shop_path + 'cart/?ajax_add_item_id=' + item_id + '&count=' + item_count;
123
124	// Отправляем запрос backend-у
125	sendRequest(cmsrequest, 'get', callbackfunction_AddIntoCart);
126
127	return false;
128}
129
130/**
131* Склонение после числительных
132* int number числительное
133* int nominative Именительный падеж
134* int genitive_singular Родительный падеж, единственное число
135* int genitive_plural Родительный падеж, множественное число
136*/
137function declension(number, nominative, genitive_singular, genitive_plural)
138{
139	var last_digit = number % 10;
140	var last_two_digits = number % 100;
141
142	if (last_digit == 1 && last_two_digits != 11)
143	{
144		var result = nominative;
145	}
146	else
147	{
148		if ((last_digit == 2 && last_two_digits != 12) || (last_digit == 3 && last_two_digits != 13) || (last_digit == 4 && last_two_digits != 14))
149		{
150			var result = genitive_singular;
151		}
152		else
153		{
154			var result = genitive_plural;
155		}
156	}
157
158	return result;
159}
160
161// массив для хранения текущих рейтингов звезд
162var curr_rate = new Array();
163
164// функция работы со звездами рейтинга
165function set_rate(id, new_rate)
166{
167	// устанавливаем атрибуты
168	curr_star = document.getElementById(id);
169	parent_id = parseInt(curr_star.parentNode.id);
170
171	// при первом пересчете ставим рейтинг для группы звезд в 0
172	if (!curr_rate[parent_id])
173	{
174		curr_rate[parent_id] = 0;
175	}
176
177	// устанавливаем новый рейтинг в массив рейтингов и значение скрытого поля
178	if (new_rate != curr_rate[parent_id] && parseInt(new_rate) > 0)
179	{
180		curr_rate[parent_id] = new_rate;
181
182		curr_form = document.getElementById('comment_form_0' + (parent_id != 0 ? parent_id : ''));
183		curr_form.comment_grade.value = curr_rate[parent_id].charAt(curr_rate[parent_id].length - 1);
184	}
185
186	// пересчет стилей для звезд
187	for (i = 1; i < 6; i++)
188	{
189		if (parent_id != 0)
190		{
191			j = parent_id + '' + i + '_star_' + i;
192		}
193		else
194		{
195			j = i + '_star_' + i;
196		}
197
198		temp_obj = document.getElementById(j);
199
200		if (new_rate == 0)
201		{
202			id = curr_rate[parent_id];
203		}
204
205		if (parseInt(j) > parseInt(id))
206		{
207			temp_obj.className = '';
208		}
209		else
210		{
211			temp_obj.className = 'curr';
212		}
213	}
214}
215
216// Функция обратного вызова для CheckBlogUrl
217function callbackfunction_CheckBlogUrl(responseJS)
218{
219	// Результат принят
220	sended_request = false;
221
222	if (typeof responseJS != 'undefined')
223	{
224		// Данные.
225		if (typeof responseJS.check_url_result != 'undefined')
226		{
227			var check_url = document.getElementById('check_url');
228
229			if (responseJS.check_url_result == 0)
230			{
231				check_url.className = 'error';
232				html = 'Адрес занят.';
233			}
234			else
235			{
236				check_url.className = 'green';
237				html = 'Адрес свободен.';
238			}
239
240			if (check_url)
241			{
242				check_url.innerHTML = html;
243			}
244			else
245			{
246				alert('Ошибка! Блок для вывода результатов запроса не найден');
247			}
248		}
249	}
250}
251
252function CheckBlogUrl(blog_path, blog_url, parent_id, id)
253{
254	cmsrequest = blog_path + '?ajax_check_blog_url=' + blog_url + '&group_parent_id=' + parent_id + '&group_id=' + id;
255
256	var check_url = document.getElementById('check_url');
257
258	if (check_url)
259	{
260		check_url.innerHTML = '<img src="/hostcmsfiles/images/ajax_loader_mini.gif"/>';
261	}
262
263	// Отправляем запрос backend-у
264	sendBackgroundRequest(cmsrequest, 'get', callbackfunction_CheckBlogUrl);
265
266	return false;
267}
268
269// Установка или снятие всех флажков для checkbox'ов элементов.
270function SelectAllItemsByPrefix(ASelect, prefix)
271{
272	element_array = document.getElementsByTagName("input");
273	if (element_array.length > 0)
274	{
275		for (var i = 0; i < element_array.length; i++)
276		{
277			if (element_array[i].name.search(prefix) != -1)
278			{
279				// Устанавливаем checked
280				element_array[i].checked = ASelect;
281			}
282		}
283
284	}
285}

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.