<script>
$( document ).ready(function() {
$('select[name$="_system"]').closest('.t-input-group_sb').hide();
$('div[data-record-type="700"]:last').hide();
$('.t700 .t-form').before('<div class="tabformwrap"><div class="tabform acttabf" data-posit="left">Аренда</div><div class="tabform" data-posit="right">Энергоснабжение</div></div>');
var articles = [
['1200','1400','1600','2000','3500','5000','8000','13000'],
['1000','1200','1400','1600','2700','4000','6500','12000'],
];
var sizpower = $('select[name="power_arenda"] option').size();
function reloadprice(e){
for (var i = 0; i < sizpower; i++) {
$('select[name="power_arenda"] option:eq('+i+')').attr('data-calc-value', articles[e][i]);
};
};
$('.t-range[name="time_arenda"]').on("input change",function(){
var needtime = Number($(this).val());
if(needtime<15){reloadprice(0)}else{reloadprice(1)};
});
$('select[name^="power"]').on('change', function (e) {
var place = $(this)[0].selectedIndex;
var systemcol = $(this).closest('.t-form__inputsbox').find('select[name$="_system"]').length;
for (var i = 0; i < systemcol; i++) {
$(this).closest('.t-form__inputsbox').find('select[name$="_system"]:eq('+i+') option:eq('+place+')').prop('selected', true);
};
});
$('.tabform').click(function(){
$('.tabform').removeClass('acttabf');
$('.tabform[data-posit="'+$(this).attr('data-posit')+'"]').addClass('acttabf');
$('div[data-record-type="700"]').toggle();
});
});
</script>
<style>
.t700 form {
background: #ffffff;
box-shadow: 0 6px 4px 0px #ababab;
padding: 30px;
border-radius: 0px;
}
.t700 .t-input-group {
width: 100%;
}
.t700 .t-input-title {
font-size: 16px;
}
.t700 .t-input-group_fr .t-input-title {
font-size: 14px;
}
@media screen and (min-width: 640px){
.t700 .t-form__inputsbox {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.t700 .t-input-group_rg , .t700 .t-input-group_fr , .t700 .t-input-group_rd{
width: 45%;
}
.t700 .t-input-title , .t700 .t-input-subtitle{
height: auto;
}
.t700 .t-input-group_ph {
width: 55%;
}
}
.t700 span.t-calc__postfix-text {
font-size: 16px;
}
.t700 span.t-calc {
font-size: 30px;
}
.t700 .t-section__topwrapper {
margin-bottom: 50px;
}
.tabformwrap {
font-family: 'Roboto',Arial,sans-serif;
font-size: 18px;
display: flex;
background-color: #f7f7f7;
border-radius: 10px 10px 0 0;
box-shadow: 0 4px 4px 0px #ababab;
overflow: hidden;
}
.tabform {
width: 50%;
text-align: center;
padding: 15px;
cursor: pointer;
}
.acttabf {
background-color: #fcb42f;
color: #fff;
pointer-events: none;
}
</style>