PageSourceSearch

https://maribondarka.ru/js/common.js

js maribondarka.ru collected 2026-10-05 00:29:58 UTC 22,373 bytes, 658 lines download raw bytes

1var debugg = location.href.indexOf('vital') != -1 ;
2var isMobile = $(window).width()<900;
3var defaultMenuIsTop = null;
4
5
6function scrollToItem( item ) {
7	$('html, body').animate({scrollTop: $(item).offset().top}, 500);
8}
9function changeMapSize( params ) {
10	$.extend({minHeight:200,maxHeight:400,duration:500},params);
11	if( $('#YMapsID').height()<params.maxHeight-1 ) {
12		height = params.maxHeight;
13		title = window.translate.cancel;
14	} else {
15		height = params.minHeight;
16		title = window.translate.expand_map;
17	}
18	$(params.trigger).html(title);
19	$('#YMapsID').animate({height:height+'px'},params.duration, __changeMapSizeCallback );
20}
21
22var updateWidgets_LeftBlock_Map = function() {
23	//map
24	if ($('#map_block .static-map').size()) {
25		src = $('#map_block .static-map').attr('src');
26		aSRC = src.split('size=');
27		var widthNow = $('#map_block .static-map').width();
28		if( widthNow != parseInt(aSRC[1])) {
29			var mapSizeSeparator = src.indexOf('.yandex')!==-1?',':'x';
30			var newUrl = aSRC[0]+'size='+widthNow+mapSizeSeparator+parseInt(widthNow*0.77)+'&'+src.split('size='+aSRC[1].split('&')[0]+'&')[1];
31			$('#map_block .static-map').attr('src', newUrl );
32		}
33	}
34}
35
36
37checkMenuOnZeroCol = function() {
38	if( $('#left_colum').hasClass('zero') ) {
39		if ( !$( '#left_colum' ).hasClass( 'top' ) ) {
40			if( !$( '#left_colum' ).hasClass( 'notop' ) ) {
41				$('.menu-trigger').show();
42				$( '#left_colum' ).addClass('notop');
43			}
44		} else if( $(window).width()>900 ) {
45			$('.menu-trigger').hide();
46			$( '#left_colum' ).removeClass('notop');
47		}
48	} 
49}
50
51setMenuDefaultPosition = function( pos ){
52	
53	if(!pos || typeof pos !='string') pos = this.options[this.selectedIndex].value;
54	
55	
56	$('#content').css('padding-top','0px');
57	if(!isMobile){
58		$('#left_menu').css({'margin-top':'0px','width':'auto','height':'auto'});
59	}
60	$('#left_colum')[0].className=$('#left_colum').hasClass('zero')?'zero':''; 
61	//$('#left_colum').removeClass('top').removeClass('left').removeClass('right').removeClass('stretch');
62	$('#right_colum').removeClass('left');
63	switch ( pos ) {
64		case 'right':
65		case 'top':
66			$('#left_colum').addClass(pos);			
67			if( pos == 'right' ) {
68				$('#right_colum').addClass('left');
69			}
70			break;
71	}
72	
73	if ( pos !='top' ) {
74		$('.toggle_submenu').unbind('mouseover').unbind('mouseleave').unbind('click').click(openSubmenu); 
75		$('#topMenuState option').remove();
76		$('#top_menu_state').css('visibility','hidden');
77		$('#left_colum #left_menu').css({'margin-left':'0'}).removeClass('is-top');
78		
79		if( !isMobile ) {
80			$('#left_colum #left_menu').css({'position':'initial'});
81		}
82		$('#left_colum #left_menu li.menu_button').css('width','100%');
83		$('#left_col_sort .content_block,#left_menu').css('margin-top','19px').filter(':first').css('margin-top','0');
84	} else {
85		$('#left_colum #left_menu').css({'position':'absolute'}).addClass('is-top');
86		$('#left_colum #left_menu .child').addClass('toslide').hide();
87		$('.toggle_submenu').mouseover(openSubmenu).mouseleave(openSubmenu);
88		$('#left_colum #left_menu li.menu_button').css('width','auto');
89		$('#left_col_sort .content_block:not(#gadblock):first').css('margin-top','0');
90		positTopMenu();
91	}
92}
93
94function positTopMenu() {
95//	if ( !isMobile && defaultMenuIsTop ) {
96//		setMenuDefaultPosition('top');
97//	}
98	
99	var lm = $('#left_colum.top #left_menu');
100	var tpmStateRow = $('#top_menu_state');
101	if (!lm.size()){
102		return tpmStateRow.css('visibility','hidden');		
103	}
104	if ( isMobile ) {
105		//defaultMenuIsTop = 1;
106		return setMenuDefaultPosition('left');
107	}
108	
109	
110	var tpmSelect	 = $('#topMenuState');
111	var addTmpOptins = !$('option',tpmSelect).size();
112	var menuWidth	 = lm.width();
113	var currState = $('#left_colum')[0].className.split(' ')[1];
114	
115	$('#left_colum #left_menu .child').addClass('toslide').hide();
116	$('.toggle_submenu').unbind('mouseover').unbind('mouseleave').mouseover(openSubmenu).mouseleave(openSubmenu);
117	
118	if (tpmSelect.size()) {
119		if (addTmpOptins){
120			tpmSelect.append($('<option value="stretch" selected>'+trn['sem_js_topmenu_stretch']+'</option>'));
121			tpmSelect.append($('<option value="squeeze"'+(currState=='squeeze'?' selected':'')+'>'+trn['sem_js_topmenu_squeeze']+'</option>'));
122		}
123		if (menuWidth>$('#content').width()-$('#content').width()*0.042) {//920
124			if (addTmpOptins){
125				tpmSelect.append($('<option value="squeeze-plus"'+(currState=='squeeze-plus'?' selected':'')+'>'+trn['sem_js_topmenu_squeeze_plus']+'</option>'));
126			}
127		}
128		tpmStateRow.css('visibility','visible');
129		if (typeof topMenuChangeState != 'undefined' ) {
130			
131			if(!tpmSelect.hasClass('change-binded')){
132				tpmSelect.change(topMenuChangeState);
133				tpmSelect.addClass('change-binded');
134			}
135			tpmSelect.change();
136		}
137	} else {
138		
139		topMenuChangeState(currState);
140	}
141	
142	checkMenuOnZeroCol();
143	
144}
145
146function topMenuChangeState(state) {
147	
148	var contWidth = $('#content').width();
149	contWidth = contWidth -20;
150	
151	var lm = $('#left_colum.top #left_menu');
152	$('#content').css('padding-top','0px');
153	$('li:not(.child)',lm).css({'margin-top':'0px','width':'auto'});
154	$('li:not(.child) a',lm).css('padding', '11px 20px 10px 5%');
155	lm.removeClass('squeeze').css('width',/*'auto'*/contWidth+'px');
156	
157	/*lm.removeClass('squeeze').css('width',function(){
158		var totalWidth = 0;
159		$('li:not(.child)',lm).each(function(i,j){
160			totalWidth+=$(this).outerWidth()+1;
161		})
162		return totalWidth+'px';
163	});*/
164	var menuWidth = lm.width();
165	var lmItems=$('#left_menu li').not('.toslide');
166	var contentWidth = contWidth+contWidth*0.018;
167	
168	if(!state || typeof state != 'string'){
169		state = this.options[this.selectedIndex].value;
170	}
171	
172	switch ( state ) {
173		case 'stretch':
174			
175			if (menuWidth>contentWidth-1) {
176				lm.css( { 'margin-left':'-'+(menuWidth-contentWidth-1)/2+'px','height':'auto', 'width' : (contentWidth+30) + 'px' } );
177			} else {
178				lm.addClass('squeeze');
179				if ( menuWidth <= contentWidth-1 ) {
180					_topMenuInline(lmItems,state);
181				}
182			}
183			break;
184		case 'squeeze':
185		case 'squeeze-plus':
186			//lm.removeClass('stretch');			
187			lm.addClass('squeeze').css({'margin-left':'0px','height':'auto'});			
188			/*if( menuWidth>contentWidth )*/lm.css('width',(contentWidth-1)+'px');			
189			if ( state == 'squeeze-plus' ) {				
190				_topMenuInline(lmItems,state);
191			}			
192			break;
193	}
194	$('#left_menu').css('margin-top','-'+_realMenuMarginTop()+'px')
195	$('#content').css('padding-top',$('#left_menu').height()+'px');
196	
197}
198
199
200function _realMenuMarginTop() {
201	return $('#left_menu').height()+12;
202}
203
204
205function _topMenuInline(lmItems,state) {
206	
207	var totalItemsWidth=0;
208	var iMaxWidth = 0;
209	//return;
210	lmItems.each(function(){
211		if (state == 'squeeze-plus' ) {
212			var width = $('a',this).width();
213			
214			if (state == 'squeeze-plus'){
215				$(this).css('width',width+'px');
216			}
217			iMaxWidth=iMaxWidth>width?iMaxWidth:width;		
218		} else {
219			var width = $(this).width();
220		}
221		totalItemsWidth+=width;
222	});
223	console.log( state );
224	if (state == 'squeeze-plus' ) {
225		avg = totalItemsWidth/lmItems.size();
226		lmItems.css({'width':function(){var width = $(this).width();return (width>(iMaxWidth-avg)/2?avg:width)+'px'}});
227		
228		$('a',lmItems).css('margin','0px 3px');		//1
229		menuHeight=lmItems.parent().height();		//2
230		//3
231		lmItems.css({'margin-top':function(){var height=$(this).height(); if ( height > menuHeight-2) {return 0+'px';} return ((menuHeight-height)/2)+'px';}});		
232	} else {		
233		lmItems.css({'width':function(){var width=$(this).width();return ((width+parseInt(( /*919*/($('#content').width()-$('#content').width()*0.02)-totalItemsWidth)/lmItems.size()))-1)+'px'}});
234	}
235	
236}
237
238function openSubmenu() {
239	
240	return setMenuDefaultPosition($('#leftmenuPosition')[0].options[this.selectedIndex].value);
241}
242
243function openSubmenuTop(parentID,event) {
244	
245	var items4toggle=$('.chfor'+parentID);
246	slidewrap=$('#'+parentID+'slidewrap');			
247	if (event.type == 'mouseover' && !slidewrap.size()) {
248		items4toggle.addClass('toslide');
249		$('<span id="'+parentID+'slidewrap" onmouseover="_tmpSubmenu='+parentID+';" class="slidewrap dynamic_border dynamic_radius"><div class="subtmp" style="position:absolute;width:'+$('#'+parentID+'menuitem').width()+'px;height:30px;margin-top:-30px"></div></span>').append(items4toggle).prependTo('#'+parentID+'_parent_point');
250		items4toggle.show();
251		$('#'+parentID+'slidewrap').show();
252		$('#'+parentID+'_parent_point').parent().addClass('current');
253		menuItemHeight=$('#'+parentID+'menuitem').height()
254		marginMinus = parseInt($('#left_menu').innerHeight()-menuItemHeight);
255		$('#' + parentID + 'slidewrap').css('margin-top', parseInt(menuItemHeight - 1 - marginMinus * 2) + 'px').mouseleave(function () {_tmpSubmenu = 0;});
256	} else if ( _tmpSubmenu != parentID ) {
257		$('.subtmp').remove();
258		$('#'+parentID+'_parent_point').parent().after(slidewrap.html());
259		slidewrap.remove();
260		$('.chfor'+parentID).hide();
261		$('.current #'+parentID+'_parent_point').parent().removeClass('current');
262		
263	}
264}
265
266
267function openSubmenuNorm(parentID) {
268	
269	var items4toggle=$('.chfor'+parentID);
270	if ( $('.current #'+parentID+'_parent_point').size() ) {
271		items4toggle.fadeOut('fast');
272		$('.current #'+parentID+'_parent_point').parent().removeClass('current');
273	} else {
274		items4toggle.fadeIn('fast');
275		$('#'+parentID+'_parent_point').parent().addClass('current');
276	}
277}
278
279
280		
281		
282
283function go2me(oLink, attrFrom ) {
284	if (!attrFrom)attrFrom='title';
285	$(oLink).attr('href',function(){return $(oLink).attr(attrFrom);});
286	return true;
287}
288
289
290function checkEmail( sEmail ) {
291	var reg = /^[\w]+([\.-]?[\w\-]+)*@[\w\-]+([\.-]?[\w\-]+)*(\.[\w]{2,6})+$/i;
292	return reg.test(sEmail);
293}
294
295function contact( ) {
296	var submitTo = $(this).attr('href')
297	var themeMsg = $(this).attr('title');
298	var mod 	 = $(this).attr('name').split(':')[0];
299	$('body').bind('keypress',function(e) {
300		var key = e.keyCode ? e.keyCode : e.which;
301		if (key==27) return contactClose();
302	});
303	$('.locker,#contact').fadeIn('fast');
304	$('.locker').height('100%');	
305	$('body').addClass('blured');
306	$('#contact form').attr('action',submitTo);
307	$('#themeMsg').html( (themeMsg?window.translate.site_write_theme_action+' ' :'')+themeMsg.toLowerCase());
308	$('#hidden_send_header,#contact_form_name').focus();
309	$('#contact form').show();
310	$('#contact .error_row').css('display','none');
311	$('#smsg_cptImage').attr('src','/cpt/index.php?'+(new Date()).getTime());
312	$('#sendMsgBtn').click( function() {
313		$('#contact .error_row').css('display','none');
314		$('#contact img.ajaxicon').css('visibility','visible');
315		if( location.href.indexOf('vital=')!=-1 )alert(2)
316//		$('#iagree_pers_datos')[0].checked
317		$.post('/end.php?params[a]=sendMsg', {action:'sendMsg',mod: mod,item_id:submitTo.split('/b')[1].split('-')[0],message:$('#contact textarea[name=message]').val(),captcha:$('#contact input[name=captcha]').val(),name:$('#contact input[name=name]').val(),phone:$('#contact input[name=phone]').val(),city:$('#contact input[name=city]').val(),email:$('#contact input[name=email]').val(),password:$('#contact input[name=password]').val(),im_agree:$('#iagree_pers_datos:checked').size(),iagree_pers_datos:true},
318		
319		function(data){
320			
321			$('#contact img.ajaxicon').css('visibility','hidden');
322			
323			if (!data)return alert(window.translate.msg_err_data_save);
324			if( location.href.indexOf('vital=')!=-1 )alert(typeof data.ok)	
325			if ( typeof data.ok != 'undefined') {
326				if( location.href.indexOf('vital=')!=-1 )alert(3)	
327				$('#contact form').hide();
328				if( location.href.indexOf('vital=')!=-1 )alert(4)	
329				if( location.href.indexOf('vital=')!=-1 )alert(window.translate.close)	
330				$('#themeMsg').html(data.ok+'<br><br><a href="javascript:;" class="close" onclick="contactClose();">'+window.translate.close+'</a><br><br>');
331			} else {
332				for( field in data ) {					
333					errRow='#contact .error_row.'+field;
334					$( errRow ).css('display','');
335					$( errRow+' .entry').html(data[field])					
336				}
337				if ( data.user_exists ) {
338					var p='pa_ord'.replace('_','ssw');
339					$('#send_msg_pd_row .entry').html('<input type="text" name="'+p+'">');
340					$('#send_msg_pd_row .entry input').focus(function(){$(this).css({filter:'blur(2px)'});}).blur(function(){if($(this).val())return;$(this).css({filter:''})});
341					$('#send_msg_pd_row').css('display','');
342				}
343			}
344		},'JSON')
345	});
346	return false;
347}
348
349function add2basket(id) {
350	if (!id || ( typeof id == 'object' ) ||( typeof id == 'Object' ) ) id=parseInt($(this).attr('name'));
351	else id = parseInt(id);
352	var that = this;
353	$('#'+id+'total').html('<img src="http://img.cataloxy.ru/ajax.gif">');
354	$.post('/end.php?params[a]=add2basket',{id:id,count:$('#'+id+'count_basket_val').val()},function(data){
355
356		if ( data && typeof data.count != 'undefined' && parseInt(data.count)){
357			$('#basket_line,#basket_xline').slideDown();			
358			$('#basket_line').css('width',parseInt($('#content').width()-$('#content').width()*0.03)+'px');
359			$('#basket_count').html(data.count);
360			$('#basket_price').html(data.price);
361
362			$('#gadblock:not(.primer)').css('marginTop','55px');
363			centrarBasket();
364		} else {
365			$('#basket_line,#basket_xline').slideUp();
366			$('#gadblock').css('marginTop','10px');
367		}
368		
369		if (!data || ( typeof data.basket_full !='undefined' && ( typeof data.basket_full.total =='undefined' || !data.basket_full.total.count ) )){
370			$('#basket_table').fadeOut();
371			location.href='/basket';
372			return;
373		}
374		
375		if ( typeof data.basket_full != 'undefined' ){
376			if (typeof data.basket_full.items[id] == 'undefined'||data.basket_full.items[id].count<0) {
377				$('#'+id+'hr,#'+id+'row').hide();
378			} else {
379				$('#'+id+'count_basket_val').val(data.basket_full.items[id].count);
380				$('#'+id+'total').html(data.basket_full.items[id].total);
381			}
382			$('#basket_total_positions').html(data.basket_full.total.count);
383			$('#basket_total_price').html(data.basket_full.total.price);
384						
385		} else {
386			that.href='/basket';
387			$(that).unbind('click').html(window.translate.basket)[0].className = that.className.replace('s45','s50');
388		}
389		
390	},'JSON');
391}
392
393function centrarBasket(){
394	if ( !$('#basket_line').is(':visible') ) return;
395	var qPer = $('#content').width()*0.07;
396	$('#basket_line .center').css('margin-left','0px').css(
397		{
398			'width':parseInt($('#content').width()-qPer)+'px',
399			'margin-left':'-'+parseInt(($('#basket_line .center').offset().left-$('#content').offset().left)-qPer*2.2 )+'px'
400		}
401	);
402}
403
404function basketChangePostition( id, mas ) {
405	$('#'+id+'count_basket_val').val(parseInt($('#'+id+'count_basket_val').val().replace(/[^\d]/,''))+(mas?1:-1));
406	add2basket(id);
407}
408
409function contactClose() {
410	$('.locker,#contact').fadeOut('fast');
411	$('body').removeClass('blured');
412}
413
414gad_position = null;
415
416function setGAD_Block() {
417	
418	windowWidth = parseInt($(window).width());
419	headerWidth = $('#header').width()+20;
420	
421	
422	if( windowWidth < 670 ) {
423		$('#gadblock').hide();
424	} else {
425		$('#gadblock').slideDown();
426	}
427	if ( (windowWidth-headerWidth)/2<183 ) {
428		if (gad_position!='b2b'){
429			$('#gadblock').hide().css({'position':'relative','width':!$('#left_colum.zero').size()?'100%':'216px','top':'auto','left':'auto'}).slideDown('slow');
430			if( $('#gadblock').hasClass('primer') ){
431				$('#gadblock').css('margin-top','0px');
432			}
433			gad_position='b2b';
434		}
435	} else {
436		
437		if (gad_position!='head') {
438			$('#gadblock').hide().css({'position':'fixed','width':'180px','top':'0','left':(windowWidth-(windowWidth-headerWidth)/2)+'px'}).slideDown('slow');
439			if( $('#gadblock').hasClass('primer') )$('#gadblock').css('margin-top','10px');
440			gad_position='head';
441		} else {
442			$('#gadblock').css({'left':(windowWidth-(windowWidth-headerWidth)/2)+'px'})
443		}
444	}
445
446}
447
448function __checkImgWidth(){
449	var maxImgWidth = $(window).width()>920?920:$(window).width();
450	if ( parseInt($(this).width()) > maxImgWidth ) {
451		var img = this;
452		$(img).css({width:'100%'});
453	}
454}
455
456
457function imgIsVisibleLoad( img ) {
458	if( !$(img).attr('src-original') ) return;
459	if( $(img).offset().top-($(window).height()*1.2) <= $(window).scrollTop()) {
460		$(img).attr('src',$(img).attr('src-original')).attr('src-original','');
461	}
462}
463function checkImgWaitLoad(){
464	$('img[src-original],iframe[src-original],img.waitload,iframe.waitload').each(function(){imgIsVisibleLoad(this);});
465}
466function _mobMenuTriggerSetTop() {
467	var scrollTop = $(window).scrollTop();
468	var gogAHeight = $('#gogadapt').height();
469	if( isMobile ) {
470		$('.menu-trigger,#basket_line,#left_menu').css('top',function(){
471			if ( scrollTop > gogAHeight ) return '10px';
472			iTop = gogAHeight-scrollTop+5;
473			return (iTop+15)+'px';
474		});
475	}
476
477}
478
479var lastWindowWidth = $(window).width();
480
481
482masnrInit = function(){
483	///return;
484	if( !$('.pop_product.incol .prod_item,#left-blocks-down .content_block').size() ) return;
485	
486 	$grid=$('.pop_product.incol,#left-blocks-down').masonry({
487		itemSelector: '.prod_item,#left-blocks-down .content_block',
488	    singleMode: false,
489		isResizable: true,
490		/*stamp:'#fixed',*/
491		isAnimated: true,
492	    animationOptions: { 
493			queue: false, 
494			duration: 50
495		}
496	});
497	iInterval = 1000;
498	
499	layout = function(){
500		if (iInterval==1000) iInterval = 2500;/* else if ( iInterval == 2500 ) clearInterval(interval); */
501		setItemsMsn('.pop_product.incol','.prod_item');
502		setItemsMsn('#left-blocks-down','.content_block');
503		return;
504	}
505	interval = setInterval( layout, iInterval );
506	/*$(window).resize(layout);*/
507	
508	setItemsMsn = function( parentS, itemS ) {
509		var itemsSize= $(parentS+' '+itemS).size();
510		if( !itemsSize ) return;
511		
512		var w = $(parentS).width();
513		
514		var iCountInRow = parseInt((w/(parentS == '#left-blocks-down'?185:205)));
515		if( itemsSize<iCountInRow) {
516			iCountInRow = itemsSize;
517		} 
518		if( iCountInRow == 1 && w > 320 ) {
519			iCountInRow = 2;
520		}
521		itemSett={width:((100/iCountInRow)-(parentS == '#left-blocks-down'?2:4))+'%'};		
522		$(parentS+' '+itemS).css(itemSett);
523		if( parentS == '#left-blocks-down' ) {
524			$('#left-blocks-down #vk_widget_block iframe,.strut').css('width', $('#vk_widget_block').width());
525		}
526		$grid.masonry('layout');
527	}
528}
529
530
531$(
532	function() {
533		
534		
535		_mobMenuTriggerSetTop();
536		$(window).scroll(_mobMenuTriggerSetTop);
537		
538		checkImgWaitLoad();	
539		$(window).scroll(checkImgWaitLoad);
540
541		positTopMenu();
542		
543		setGAD_Block();
544		$(window).scroll(setGAD_Block).resize(setGAD_Block).resize(function(){$('img').each(__checkImgWidth);});
545
546		$('#left_colum .content_block').append(function(){
547			return '<div class="strut" style="width:'+$(this).width()+'px"></div>';
548		});
549		
550		$(window).resize( function(){
551			if(lastWindowWidth==$(window).width()) return;						
552			positTopMenu();			
553			lastWindowWidth=$(window).width();			
554		});
555		
556		$('.sendmsg').click(contact);
557		$('.buy').click(add2basket)
558
559		centrarBasket();
560
561		//sbscrptn
562		$('#subscribtion .accept').click(function(){
563			var eml = $('#subscribtion input[name=email]').val();
564		
565			if (!checkEmail(eml)) return alert(window.translate.msg_err_email_incorr);
566			var OKBtn=this;
567			$(this).hide();
568			$('#subscribtion .ajaxiconaccept').show();
569			
570			$.post('/end.php?params[a]=checkEmailSubscribe', {action:'checkEmailSubscribe',email: eml},
571			function(data){
572				$(OKBtn).show();
573				$('#subscribtion .ajaxiconaccept').hide();
574				if (!data) {
575					alert(window.translate.msg_err_data_save);
576				}else if ( typeof data.ok != 'undefined') {								
577					$('#subscribtion .allform').slideDown( 'fast' );
578					$(OKBtn).hide();
579					$('#subscribtion .cptImg').attr('src','/cpt/index.php');
580				} else if ( typeof data.error !='undefined' ) {
581					alert(data.error);
582				}
583			},'JSON');
584		});
585
586		$('#subscribtion .button[name=set_subscribtion]').click(function(){
587			var eml = $('#subscribtion input[name=email]').val();
588			$('#subscribtion .ajaxicon').css('visibility','visible');
589			
590			$.post('/end.php?params[a]=newSubscriber', {action:'newSubscriber',email: eml,captcha:$('#subscribtion input[name=captcha]').val(),name:$('#subscribtion input[name=name]').val()},
591			function(data){
592				$('#subscribtion img.ajaxicon').css('visibility','hidden');
593				if (!data) {
594					alert(window.translate.msg_err_data_save);
595				} else if ( typeof data.ok != 'undefined') {
596					$('#subscribtion').css({'margin':'0','padding':'0'}).html(data.ok);
597					
598				} else if ( typeof data.error !='undefined' ) {
599					alert(data.error);
600				}
601				$('#subscribtion .cptImg').attr('src','/cpt/index.php?'+(new Date()).getTime());
602			},'JSON');
603		});
604		//sbscrptn FINISH
605		
606		
607		//--scroll2up
608		$('.scrollup').click(function(){$("html, body").animate({ scrollTop: 0 }, 600);return false;});
609		$(window).scroll(function(){if ($(this).scrollTop() > 100) {$('.scrollup,#scrollup_editor').fadeIn();} else {$('.scrollup,#scrollup_editor').fadeOut();}}); 
610		//--scroll2up
611
612
613		$('img').load(__checkImgWidth);
614		$('img').each(__checkImgWidth);
615		
616		
617		masnrInit();
618		
619		
620		
621    	var source_link = '<p>'+(typeof window.translate != 'undefined'?window.translate.more:'Sourse')+': <a href="' + location.href + '">' + location.href + '</a></p>';
622        if (window.getSelection) $('body').bind('copy',
623            function()
624            {
625            	$('body script').remove();
626                var selection = window.getSelection();
627                var seltxt=selection.toString();
628                if(!seltxt||seltxt.length<35) return;
629                var range = selection.getRangeAt(0);
630                var magic_div = $('<div>').css({ overflow : 'hidden', width: '1px',height : '1px', position : 'absolute', top: '-10000px', left : '-10000px' });
631                magic_div.append(range.cloneContents(), source_link);
632                $('body').append(magic_div);
633                var cloned_range = range.cloneRange();
634                selection.removeAllRanges();                
635                clone = magic_div;
636                clone.css({overflow:'auto',width:'auto',height:'auto',position:'relative',top:'auto',left:'auto'});
637                var new_range = document.createRange();
638                new_range.selectNode(clone.get(0));
639                selection.addRange(new_range);
640                window.setTimeout(
641                    function()
642                    {
643                        selection.removeAllRanges();
644                        selection.addRange(cloned_range);
645                        magic_div.remove();
646                    }, 0
647                );
648            }
649        );
650        
651        if( $('.blocks_container').hasClass('resized') ) {
652        	updateWidgets_LeftBlock_Map();
653        }
654		if( $('#left_colum .primer').size()>1 ){
655			$('#left_colum .primer').not(':first').removeClass('primer');
656		}
657	}
658);

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.