<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">// РћС‡РёСЃС‚РєР° С„РѕСЂРјС‹
function _clear_form( form ) {
	form.find(jQuery('#rent_periodpickerstart')).periodpicker('clear');
	form.find(jQuery(".qty")).val("1");
	form.find(jQuery('.all_summ_rent')).fadeOut(50);
}

// Р”Р°С‚Р° СЃС‚Р°СЂС‚Р° Р°СЂРµРЅРґС‹ РІ Unix time
function _unix_time_start( $date ) {
	var unixTimeStamp = moment($date).unix() + (60*60*3);
	jQuery('#_date_start_unix').val(unixTimeStamp)
	return unixTimeStamp;
}

// Р”Р°С‚Р° РѕРєРѕРЅС‡Р°РЅРёСЏ Р°СЂРµРЅРґС‹ РІ Unix time
function _unix_time_end( $date ) {
	var unixTimeStamp = moment($date).unix() + (60*60*3);
	jQuery('#_date_end_unix').val(unixTimeStamp)
	return unixTimeStamp;
}

// РџСЂРѕРІРµСЂРєР° РґР°С‚С‹ СЃС‚Р°СЂС‚Р° Р°СЂРµРЅРґС‹
function _test_time_start() {
	var start = jQuery('#_date_start_unix').val();
	var end = jQuery('#_date_end_unix').val();
	if ( end != '' ) {
		if ( start &gt; end ) {
			jQuery('#_date_start').val(jQuery('#_date_end').val());
			jQuery('#_date_start_unix').val(jQuery('#_date_end_unix').val())
		}
	}
	return true;
}

// РџСЂРѕРІРµСЂРєР° РґР°С‚С‹ РѕРєРѕРЅС‡Р°РЅРёСЏ Р°СЂРµРЅРґС‹
function _test_time_end() {
	var start = jQuery('#_date_start_unix').val();
	var end = jQuery('#_date_end_unix').val();
	if ( start != '' ) {
		if ( start &gt; end ) {
			jQuery('#_date_end').val(jQuery('#_date_start').val());
			jQuery('#_date_end_unix').val(jQuery('#_date_start_unix').val())
		}
	}
	return true;
}

// Р”РђРўР« РђР&nbsp;Р•РќР”Р«
function _rent_dates_ajax() {

    window.last_date = '';

    var date_start = '';
	var date_end = '';
	
	if (jQuery("#_date_start").val()!='' &amp;&amp; jQuery("#_date_end").val()!='') {
		date_start = jQuery("#_date_start_unix").val();
        date_end = jQuery("#_date_end_unix").val();
	}

    if ( date_start == '' || date_end == '' ) {
		return false;
    }

    jQuery('#to_rent .all_summ_rent').fadeOut(50);
	
	/*
	var dates = jQuery('#rent_periodpickerstart').periodpicker('valueStringStrong');
	var date = dates.split('-');
	if (date.length==2) {
    	var date_start = date[0];
    	var date_end = date[1];
    	
    	if (date_start==date_end) {
    		//dates = '';
    	}
	} else {
		jQuery('#to_rent .all_summ_rent').fadeOut(50);
		//dates = '';
	}*/

	var post_id = jQuery("#post_id").val();
	var count_items = jQuery("#to_rent .qty").val();
	var form = jQuery("#to_rent .form_order");
	
	// РђРєС†РёРё
	var sale_id = 0;
	if (typeof form.find("input[name=rent_set_sale_id]:checked") !== "undefined") {
		sale_id = form.find("input[name=rent_set_sale_id]:checked").val();
	}

	jQuery('#to_rent .all_summ').height('120px');

	jQuery('#to_rent .all_summ .rotating-border').css( 'display' , 'block' );
	jQuery('#to_rent .all_summ_body').fadeOut(50);
	jQuery('#to_rent .all_summ_rent').fadeIn(50);
	
	jQuery.post('/wp-admin/admin-ajax.php?action=rent_dates_ajax', { ajax: 1, post_id:post_id, date_start:date_start, date_end:date_end, count:count_items, sale_id:sale_id }, function(req){
		var respond = JSON.parse(req);
		
		jQuery('#to_rent .all_summ .rotating-border').css( 'display' , 'none' );
		
		if( respond.success=='true' ){
			if( respond.error=='' ){
				jQuery('#to_rent .all_summ_body').html(respond.html);
				jQuery('#to_rent .template_rent_price').html(respond.rent_price_html);
				jQuery('#to_rent .all_summ_body').fadeIn(50);
				
				jQuery('[data-toggle="popover"]').popover({
		    		template: '&lt;div class="popover" role="tooltip"&gt;&lt;div class="arrow"&gt;&lt;/div&gt;&lt;h3 class="popover-header"&gt;&lt;/h3&gt;&lt;div class="popover-body"&gt;&lt;/div&gt;&lt;/div&gt;',
		    		html: true
		    	});
			}
		} else {
			alert('РћС€РёР±РєР° РїСЂРё РѕС‚РїСЂР°РІРєРµ РґР°РЅРЅС‹С….');
		}

		jQuery('#to_rent .all_summ').height('auto');
		
    });
	
	return false;
}

// РћР±РЅРѕРІР»РµРЅРёРµ С†РµРЅС‹ РїСЂРѕРґР°Р¶Рё
function _sale_price_update_ajax() {
    jQuery('#to_sale .all_summ_sale').fadeOut(50);
	
	var post_id = jQuery("#post_id").val();
	var count_items = jQuery("#to_sale .qty").val();
	
	var form = jQuery("#to_sale .form_order");
	
	// РђРєС†РёРё
	var sale_id = 0;
	if (typeof form.find("input[name=sale_set_sale_id]:checked") !== "undefined") {
		sale_id = form.find("input[name=sale_set_sale_id]:checked").val();
	}
	
	jQuery('#to_sale .all_summ').height('120px');

	jQuery('#to_sale .all_summ .rotating-border').css( 'display' , 'block' );
	jQuery('#to_sale .all_summ_body').fadeOut(50);
	jQuery('#to_sale .all_summ_sale').fadeIn(50);
	
	jQuery.post('/wp-admin/admin-ajax.php?action=sale_price_update_ajax', { ajax: 1, post_id:post_id, count:count_items, sale_id:sale_id }, function(req){
		var respond = JSON.parse(req);
		
		jQuery('#to_sale .all_summ .rotating-border').css( 'display' , 'none' );
		
		if( respond.success=='true' ){
			if( respond.error=='' ){
				jQuery('#to_sale .all_summ_body').html(respond.html);
				jQuery('#to_sale .sale_price_html').html(respond.sale_price_html);
				//jQuery('#to_sale .sale_price_html .price .summ_itog_top').html(respond.price);
				jQuery("#to_sale .price").val(respond.price);
				jQuery('#to_sale .all_summ_body').fadeIn(50);
			}
		} else {
			alert('РћС€РёР±РєР° РїСЂРё РѕС‚РїСЂР°РІРєРµ РґР°РЅРЅС‹С….');
		}

		jQuery('#to_sale .all_summ').height('auto');
		
    });
	
	return false;
}

jQuery(function($) {
    "use strict";
    $.noConflict();

    $(document).ready(function() {
    	
    	// РЈСЃС‚Р°РЅРѕРІРєР° Р°РєС†РёРё Рє Р·Р°РїРёСЃРё
    	//jQuery('input[type=radio][name=set_sale_id]').change(function() {
    	jQuery( document ).on( 'change', 'input[type=radio][name=rent_set_sale_id], input[type=radio][name=sale_set_sale_id]', function(e) {
    		var sale_id = jQuery(this).val();
    		var post_id = $(this).data("post_id");
    		var device_type = $(this).data("device_type");
    		var user_id = $(this).data("user_id");
    		var parent = jQuery(this).closest('label');
    		var form = jQuery(this).closest('form');
    		
    		var date_start = '';
			var date_end = '';
			if (jQuery("#_date_start").val()!='' &amp;&amp; jQuery("#_date_end").val()!='') {
        		date_start = jQuery("#_date_start_unix").val();
                date_end = jQuery("#_date_end_unix").val();
    		}
			
			if ( device_type == 'rent' &amp;&amp; (date_start == '' || date_end == '') ) {
            	// Р§С‚Рѕ Р±С‹ РІС‹РІРµСЃС‚Рё РѕС€РёР±РєСѓ
				$('#to_rent .form_order').submit();
				//$(this).attr("checked", false);
				//jQuery(parent).find('.jq-radio').removeClass("checked");
				return false;
            }
    			
    		jQuery(form).css('pointer-events', 'none');
    		jQuery(form).css('opacity', '0.3');
    		jQuery(form).addClass('animation');
    		
    		jQuery.post('/wp-admin/admin-ajax.php?action=set_sale_by_post_id', { ajax: 1, sale_id: sale_id, post_id: post_id, device_type: device_type, user_id: user_id, date_start: date_start, date_end: date_end }, function(req){
    			var respond = JSON.parse(req);
    			
    			if( respond.success=='true' ){
    	    		if (device_type=='rent') {
    	    			_rent_dates_ajax();
    	    		} else {
    	    			// РћР±РЅРѕРІР»РµРЅРёРµ С†РµРЅС‹ РїСЂРѕРґР°Р¶Рё
    					_sale_price_update_ajax();
    	    		}
    	    		
    			} else {
    				alert('РћС€РёР±РєР° РїСЂРё РѕС‚РїСЂР°РІРєРµ РґР°РЅРЅС‹С….');
    			}
    			
    			jQuery(form).css('pointer-events', 'auto');
	    		jQuery(form).css('opacity', '1');
	    		jQuery(form).removeClass('animation');
    	    });
    		
    		if (jQuery(this).is(':checked')) {
    			
    			//jQuery(this).prop('checked', false);
    			//jQuery(parent).removeClass("checked");
    			//$(this).attr("checked", false);
    			//$(this).removeAttr("checked");
    			//alert(sale_id);
    		} else {
    			//$(this).prop('checked', true);
    		}
    	});
    	
    	// https://xdsoft.net/jqplugins/datetimepicker/#onChangeDateTime
        // Р”Р°С‚Р° Рё РІСЂРµРјСЏ РЅР°С‡Р°Р»Р° Р°СЂРµРЅРґС‹
        jQuery('#_date_start').datetimepicker({
        	format:'j M Y H:i',
        	onSelectTime:function(dp,$input){
        		// Р”Р°С‚Р° СЃС‚Р°СЂС‚Р° Р°СЂРµРЅРґС‹ РІ Unix time
        		var startTimeStamp = _unix_time_start( dp );
        		// РџСЂРѕРІРµСЂРєР° РґР°С‚С‹ СЃС‚Р°СЂС‚Р° Р°СЂРµРЅРґС‹
        		_test_time_start();
        		jQuery(".date_start .close").css( 'opacity' , '1' );

        		_rent_dates_ajax();
        		
        	    //alert($input.val());
				/*var dates  = $input.val();
				var date = dates.split(' ');
            	if (date.length==4) {
            		var month = date[1];
            		month = month.replace("РњР°СЂ","РњР°СЂС‚");
            		jQuery('#_date_start').val(date[0]+' '+month+' '+date[2]+' '+date[3]);
            	}*/
        	},
        	onSelectDate:function(dp,$input){
        		$input.val('');
        		return true;
        	},
        	onGenerate:function(dp,$input){
        		if ($input.val()!='') {
					jQuery(".date_start .close").css( 'opacity' , '1' );
				}
        	},
        	onShow:function( ct ){
        		this.setOptions({
        		    maxDate:jQuery('#_date_end').val()?jQuery('#_date_end').val():false,
                	formatDate:'j M Y',
                	//maxTime:jQuery('#_date_end').val()?new Date(jQuery('#_date_end').val()):false,
                	//formatTime:'H:i',
        		})
        	},
		});

    	// Р”Р°С‚Р° Рё РІСЂРµРјСЏ РѕРєРѕРЅС‡Р°РЅРёСЏ Р°СЂРµРЅРґС‹
        jQuery('#_date_end').datetimepicker({
        	format:'j M Y H:i',
        	onSelectTime:function(dp,$input){
        		// Р”Р°С‚Р° СЃС‚Р°СЂС‚Р° Р°СЂРµРЅРґС‹ РІ Unix time
        		var endTimeStamp = _unix_time_end( dp );
        		// РџСЂРѕРІРµСЂРєР° РґР°С‚С‹ РѕРєРѕРЅС‡Р°РЅРёСЏ Р°СЂРµРЅРґС‹
        		_test_time_end();
        		jQuery(".date_end .close").css( 'opacity' , '1' );

        		_rent_dates_ajax();
        		
        	},
        	onSelectDate:function(dp,$input){
        		$input.val('');
        		return true;
        	},
        	onGenerate:function(dp,$input){
        		if ($input.val()!='') {
					jQuery(".date_end .close").css( 'opacity' , '1' );
				}
        	},
        	onShow:function( ct ){
        		this.setOptions({
        		    minDate:jQuery('#_date_start').val()?jQuery('#_date_start').val():false,
                	formatDate:'j M Y',
                	//minTime:jQuery('#_date_start').val()?new Date(jQuery('#_date_start').val()):false,
                    //formatTime:'H:i',
        		})
        	},
		});

    	// РЈСЃС‚Р°РЅРѕРІРєР° Р»РѕРєР°Р»Рё
        $.datetimepicker.setLocale('ru');

        // РџРѕР»Рµ РґР»СЏ РІРІРѕРґР°
        jQuery('.comment textarea').bind('input propertychange', function() {
        	jQuery(".comment .close").css( 'opacity' , '1' );
        });
        if (jQuery('.comment textarea').val()!='') {
        	jQuery(".comment .close").css( 'opacity' , '1' );
		}

        // РЈРґР°Р»РµРЅРёРµ РґР°РЅРЅС‹С… РёР· РїРѕР»СЏ
        jQuery(".date_start .close").on("click",function() {
        	jQuery(".date_start .close").css( 'opacity' , '0' );
        	jQuery("#_date_start_unix").val('');
        	jQuery("#_date_start").val('');
        	jQuery('#to_rent .all_summ_rent').fadeOut(50);
        });
     	// РЈРґР°Р»РµРЅРёРµ РґР°РЅРЅС‹С… РёР· РїРѕР»СЏ
        jQuery(".date_end .close").on("click",function() {
        	jQuery(".date_end .close").css( 'opacity' , '0' );
        	jQuery("#_date_end_unix").val('');
        	jQuery("#_date_end").val('');
        	jQuery('#to_rent .all_summ_rent').fadeOut(50);
        });
     	// РЈРґР°Р»РµРЅРёРµ РґР°РЅРЅС‹С… РёР· РїРѕР»СЏ
        jQuery(".comment .close").on("click",function() {
        	jQuery(".comment .close").css( 'opacity' , '0' );
        	jQuery(".comment textarea").val('');
        });
        
		// РљРЅРѕРїРєР° РІ РјРѕР±. РІРµСЂСЃРёРё "РЎС„РѕСЂРјРёСЂРѕРІР°С‚СЊ Р·Р°РїСЂРѕСЃ"
    	jQuery(".nav_to_order").on("click",function(event) {
    		event.preventDefault();

    		var el = $(this);
    		var id  = $(el).attr('href');
    		
    		if (id=='#nav_to_order') {    		
    			var top = $(id).offset().top-60;
    		} else {
    			var top = 0;
    		}
    		$('body,html').animate({scrollTop: top}, 500);
    	});

     	// РћС‚РїСЂР°РІРєР° С„РѕСЂРјС‹ Р·Р°СЏРІРєРё РЅР° РѕР±РѕСЂСѓРґРѕРІР°РЅРёРµ / РђСЂРµРЅРґР°
    	$('#to_rent .form_order').submit(function(){
    		
    		var form = $(this);
    		var post_id = jQuery(form).find(".post_id").val();
    		var count_items = jQuery(form).find(".qty").val();
    		var cat_type = jQuery(form).find(".cat_type").val();

			var date_start = '';
			var date_end = '';

    		/*if (jQuery("#_date_start").val()!='' &amp;&amp; jQuery("#_date_end").val()!='') {
        		date_start = jQuery("#_date_start_unix").val();
                date_end = jQuery("#_date_end_unix").val();
    		}*/

    		if (jQuery("#_date_start").val()!='' &amp;&amp; jQuery("#_date_end").val()!='') {
        		date_start = jQuery("#_date_start_unix").val();
                date_end = jQuery("#_date_end_unix").val();
    		}

            if ( date_start == '' || date_end == '' ) {
				form.find(jQuery('.dates_order_error')).css( 'display' , 'block' );
        		var _Timers = setInterval(function () {clearInterval(_Timers);form.find(jQuery('.dates_order_error')).fadeOut(500);}, 5000);
        		return false;
            }

    		/*var dates = jQuery('#rent_periodpickerstart').periodpicker('valueStringStrong');
        	var date = dates.split('-');
        	if (date.length!=2) {

        		form.find(jQuery('.dates_order_error')).css( 'display' , 'block' );
        		
        		var _Timers = setInterval(function () {clearInterval(_Timers);form.find(jQuery('.dates_order_error')).fadeOut(500);}, 5000);
        		return false;
        	}*/
    		
    		$(form).height(form.height());
    		
			form.find($('.rotating-border')).css( 'display' , 'block' );
			form.find($('.order_body')).fadeOut(50);
			
			jQuery.post($(form).attr('action'), { action:"send_order_devices", post_id: post_id, date_start:date_start, date_end:date_end, count:count_items, cat_type:cat_type }, function(req){
    			var respond = JSON.parse(req);
    			
    			if( respond.success=='true' ){
					form.find($('.order_send')).before(respond.message);
					$(form).height('auto');

					_clear_form( form )
					
					var _Timers = setInterval(function () {clearInterval(_Timers);jQuery('.order_text').fadeOut(500);}, 15000);
					
    			} else {
    				alert('РћС€РёР±РєР° РїСЂРё РѕС‚РїСЂР°РІРєРµ РґР°РЅРЅС‹С….');
    			}
    			
    			form.find($('.rotating-border')).css( 'display' , 'none' );
    			form.find($('.order_body')).fadeIn(50);
    	    });
    		return false;
    	});

    	// РћС‚РїСЂР°РІРєР° С„РѕСЂРјС‹ Р·Р°СЏРІРєРё РЅР° РѕР±РѕСЂСѓРґРѕРІР°РЅРёРµ / РџСЂРѕРґР°Р¶Р°
    	$('#to_sale .form_order').submit(function(){
    		
    		var form = $(this);
    		var post_id = jQuery(form).find(".post_id").val();
    		var count_items = jQuery(form).find(".qty").val();
    		var cat_type = jQuery(form).find(".cat_type").val();

    		$(form).height(form.height());
    		
			form.find($('.rotating-border')).css( 'display' , 'block' );
			form.find($('.order_body')).fadeOut(50);
			
			jQuery.post($(form).attr('action'), { action:"send_order_devices", post_id: post_id, count:count_items, cat_type:cat_type }, function(req){
    			var respond = JSON.parse(req);
    			
    			if( respond.success=='true' ){
					form.find($('.order_send')).before(respond.message);
					$(form).height('auto');

					//_clear_form( form )
					
					var _Timers = setInterval(function () {clearInterval(_Timers);jQuery('.order_text').fadeOut(500);}, 15000);
					
    			} else {
    				alert('РћС€РёР±РєР° РїСЂРё РѕС‚РїСЂР°РІРєРµ РґР°РЅРЅС‹С….');
    			}
    			
    			form.find($('.rotating-border')).css( 'display' , 'none' );
    			form.find($('.order_body')).fadeIn(50);
    	    });
    		return false;
    	});

     	// РљРѕР»-РІРѕ Р”РђРўР« РђР&nbsp;Р•РќР”Р«
    	jQuery("#to_rent .qty").on("change",function() {

    		var $qty = $( this ).closest( '.quantity' ).find( '.qty' );
    		var max = parseFloat( $qty.attr( 'max' ) );

    		// Р§С‚Рѕ Р±С‹ РЅРµ РѕР±РЅРѕРІР»СЏС‚СЊ РѕРґРёРЅР°РєРѕРІС‹Рµ Р·РЅР°С‡РµРЅРёСЏ
			if (window.last_qty == jQuery(this).val() || max == 1) {
				return true;
			}
    		
			window.last_qty = jQuery(this).val();

    		/*var dates = jQuery('#rent_periodpickerstart').periodpicker('valueStringStrong');
        	var date = dates.split('-');
        	if (date.length==2) {*/
    			_rent_dates_ajax();
        	//}
    	});

    	// РљРѕР»-РІРѕ РїСЂРѕРґР°Р¶Рё
    	jQuery("#to_sale .qty").on("change",function() {
    		var count = parseInt(jQuery(this).val());
    		var price = parseInt(jQuery("#to_sale .price_sale_result").val());
    		
    		var summ = count * price;
    		jQuery("#to_sale .summ_itog").html(summ);
    	});

        jQuery('.item_fields_masonry').masonry({
  		  itemSelector: '.single_description_masonry',
  		  percentPosition: true,
  		  gutter: 0
  		});

     	// Р”РђРўР« РђР&nbsp;Р•РќР”Р«
		// https://xdsoft.net/jqplugins/periodpicker/
        /*jQuery('#rent_periodpickerstart').periodpicker({
        	end: '#rent_periodpickerend',
        	lang: 'ru',
        	i18n: {
        	 'ru' : {'Choose period' : 'Р’Р’Р•Р”РРўР• Р”РђРўР« РђР&nbsp;Р•РќР”Р«'}
        	},
        	cells: [2, 1],
    	    withoutBottomPanel: false,
    	    yearsLine: false,
    	    title: false,
    	    closeButton: false,
    	    fullsizeButton: false,
    	    clearButtonInButton: true,
            okButton: true,
            animation: false,
            showDatepickerInputs: false,
            minDate: '&lt;?=date('Y', time())?&gt;.&lt;?=date('m', time())?&gt;.&lt;?=date('d', time())?&gt;',
            //formatDecoreDateWithYear: 'DD.MM.YYYY',
        	formatDate: 'YYYY.MM.DD',
        	onClearButtonClick: function () {
        		//_rent_dates_ajax();
        		jQuery('#to_rent .all_summ').fadeOut(50);
        		//var _Timers = setInterval(function () {clearInterval(_Timers);jQuery('#rent_periodpickerstart').periodpicker('hide');}, 100);
        	},
        	onOkButtonClick: function () {
        		_rent_dates_ajax();

        		var dates = jQuery('#rent_periodpickerstart').periodpicker('valueStringStrong');
        		var date = dates.split('-');
        		if (date.length==2) {
    	        	var date_start = date[0];
    	        	var date_end = date[1];

    	        	jQuery('#rent_periodpickerstart').periodpicker('value', [date_start, date_end]);
        		}
        		
        	}
    	});*/

        /*jQuery('.icon_clear').css( 'display' , 'none' );*/
        
        /*jQuery('#rent_periodpickerstart').on('change', function () {
        	var dates = jQuery(this).periodpicker('valueStringStrong');
        	var dates_input = jQuery('.period_button_content_body').html();

        	var date = dates.split('-');
        	var date_input = dates_input.split('-');

        	//alert(jQuery('.period_picker_selected').length);

        	if (date.length==2) {
	        	var date_start = date[0];
	        	var date_end = date[1];

	        	if (date_start==date_end) {*/
	        		/*if (date_input.length==2) {
	        			return true;
	        		}*/
	        		/*return true;
	        	}

	        	jQuery(this).periodpicker('hide');
	        	_rent_dates_ajax();
        	}
        });*/

        // Р“Р°Р»РµСЂРµСЏ
        var galleryThumbs = new Swiper('.gallery-thumbs', {
            spaceBetween: 10,
            slidesPerView: 10,
            loop: false,
            freeMode: true,
            loopedSlides: 0, //looped slides should be the same
            watchSlidesVisibility: true,
            watchSlidesProgress: true,
        });

        var galleryTop = new Swiper('.gallery-top', {
            /*spaceBetween: 10,
            slidesPerView: 1,
            loop: true,
            loopedSlides: 5,*/ //looped slides should be the same
            slidesPerView: 'auto',
            navigation: {
              nextEl: '.swiper-button-next',
              prevEl: '.swiper-button-prev',
            },
            thumbs: {
              swiper: galleryThumbs,
            },
        });
        
        // РџРµСЂРµРєР»СЋС‡Р°Р»РєРё
    	jQuery( ".tab_select" ).tabs({
    		hide: { effect: "fade", duration: 1000 },
    		collapsible: false, 
    		active: false
    	});
    	
    	// РљРЅРѕРїРєР° РџРµСЂРµРєР»СЋС‡Р°Р»РєРё
    	jQuery("#a_to_rent, #a_to_sale").on("click",function(e) {
    		var type =  $(this).data("type");
    		jQuery(".sales_for_gallery .sale").css({'display': 'none'});
    		
    		switch(type) {
	    		case 'rent':
	    			jQuery(".sale_for_"+type).css({'display': 'block'});
	    		break;
	    		case 'sale':
	    			jQuery(".sale_for_"+type).css({'display': 'block'});
	    		break;
	    	}
    	});
    	
    	// РљРЅРѕРїРєР° СЂР°СЃС€Р°СЂРёРІР°РЅРёСЏ Р¤СЌР№СЃР±СѓРєР°
    	/*jQuery("#share_fb").on("click",function(e) {
    		e.preventDefault();
    		jQuery(".ya-share2__item_service_facebook").click();
    	});*/
		
		// РљРЅРѕРїРєР° СЂР°СЃС€Р°СЂРёРІР°РЅРёСЏ Р’Рљ
    	/*jQuery("#share_vk").on("click",function(e) {
    		e.preventDefault();
    		jQuery(".ya-share2__item_service_vkontakte").click();
    	});*/
		
		// РљРЅРѕРїРєР° СЂР°СЃС€Р°СЂРёРІР°РЅРёСЏ
    	/*jQuery("#share_ok").on("click",function(e) {
    		e.preventDefault();
    		jQuery(".ya-share2__item_service_odnoklassniki").click();
    	});*/
		
		// РљРЅРѕРїРєР° СЂР°СЃС€Р°СЂРёРІР°РЅРёСЏ
    	/*jQuery("#share_tw").on("click",function(e) {
    		e.preventDefault();
    		jQuery(".ya-share2__item_service_twitter").click();
    	});*/

    	jQuery("._expandable-content").each(function() {
    		var el = this;
    		var parent = jQuery(el).closest('.item_fields_expandable');
        	
    		jQuery(parent).css({'display': 'table'});

    		var _origHeight = jQuery(el).innerHeight();

    		if (_origHeight&lt;180) {
    			parent.find("._expandable-trigger-wrapper").css({'display': 'none'});
				return true;
        	}
        	
    		var content = jQuery(this);
    		// var origHeight = jQ(this).outerHeight(true);
    		jQuery(this).css({
    			height: 180
    		})
    		var trigger = parent.find("._expandable-trigger");
    		var fade = jQuery(this).find("._expandable-fade");
    	
    		trigger.click(function() {
    			var origHeight = content.find("._expandable-inner").outerHeight(true);
    			if (!jQuery(this).hasClass("trigger-on")) {
    				jQuery(this).addClass("trigger-on");
    				content.transition({
    					height: origHeight
    				},1000)
    				trigger.html(trigger.data("collapsetext"));
    				fade.fadeOut(1000);
    			} else {
    				jQuery(this).removeClass("trigger-on");
    				content.transition({
    					height: 180
    				},1000)
    				trigger.html(trigger.data("expandtext"))
    				fade.fadeIn(1000);
    			}
    		});
    	
    	});

    	jQuery('[data-toggle="popover"]').popover({
    		template: '&lt;div class="popover" role="tooltip"&gt;&lt;div class="arrow"&gt;&lt;/div&gt;&lt;h3 class="popover-header"&gt;&lt;/h3&gt;&lt;div class="popover-body"&gt;&lt;/div&gt;&lt;/div&gt;',
    		html: true
    	});

    	// РЁРµСЂ РґР»СЏ РґСЂСѓРіРёС… РїР»РѕС‰Р°РґРѕРє
		jQuery(document).on('click', "#share_clipboard", function(e) {
			e.preventDefault();
			
			var text =  $(this).data("text");
			
			var $temp = $("&lt;textarea&gt;");
    	    $("body").append($temp);
    	    $temp.val(text).select();
    	    document.execCommand("copy");
    	    $temp.remove();
    	    /*alert('РўРµРєСЃС‚ РѕР±СЉСЏРІР»РµРЅРёСЏ СЃРєРѕРїРёСЂРѕРІР°РЅ! \n \n'+
    	    ''+text);*/
    	    bottom_notification('РўРµРєСЃС‚ РѕР±СЉСЏРІР»РµРЅРёСЏ СЃРєРѕРїРёСЂРѕРІР°РЅ!',text);
		});
    	
    });
    
    jQuery(window).on('load', function(){
    	var Timers = setInterval(function () {
    		clearInterval(Timers);
    		jQuery('.section_blocks').animate({opacity: 1}, 1000);
        }, 100);
    });
    
});

</pre></body></html>