
function continue_booking_notify(data){if(typeof data=="object"){var html_inner='<div class="clearfix"><div class="image_hotel_at_notify" style="background-image: url('+data.main_image+');"></div>';html_inner+='<div class="text_at_href_notify href_hotel_at_notify">Завершите своё бронирование!<br>'+data.roomcount+' номер по цене '+data.totalSum+' руб.</div>';html_inner+='<div class="img_at_href_notify href_hotel_at_notify"></div>';html_inner+='<br><div class="info_of_order"><a style="color: #ffae4e;" href="'+data.urlHotel+'">'+data.name+'</a><br><br>'+data.datein+' - '+data.dateout+'</div></div>';if(sessionStorage.textForNotifu&&html_inner!=sessionStorage.textForNotifu){sessionStorage.textForNotifu=html_inner;}}else{sessionStorage.clear();$('.show_notify').remove();var html_inner=data;}
if(!sessionStorage.textForNotifu){sessionStorage.textForNotifu=html_inner;$.UIkit.notify(html_inner,{napr:"right",pos:'top-right',status:'continue',timeout:10000,onClose:consolee});}else{consolee();}
function consolee(){$('body').append('<div title="Завершить бронирование" class="show_notify" onclick="show_booking_notify()"><img style="margin-top: -6px;" src="/template/megotel_new/img/hist_2.png"></img></div>');$('.show_notify').fadeIn(300);};$('.href_hotel_at_notify').on('click',function(){window.location='/booking?contBooking=trye';});$('.info_of_order a').on('click',function(){window.location=$(this).attr('href');});};function add_loader1(text=''){if($('.loader1').length&&text){$(".text_loader1").html(text);}else if($('.loader1').length){setTimeout(function(){$('.loader1').remove();},600);$(".loader1").fadeOut();}else{$("body").append('<div class="loader1"><img class="img_loader1" src="/template/megotel_new/img/loader1.gif"><div><div class="text_loader1">'+text+'</div></div></div>');$(".loader1").fadeIn()}}
function show_booking_notify(){continue_booking_notify(sessionStorage.textForNotifu);};$(".phote-hotel-get").swipe({swipe:function(event,direction,distance,duration,fingerCount){var tnpp=$(event.target).data('npp');if(direction=='left'){var el=$(event.target).next(".phote-hotel-get");}else if(direction=='right'){if(tnpp==0)return false;var el=$(event.target).prev(".phote-hotel-get");}else return false;$(event.target).removeClass('active');el.addClass("active");$('li[rel="image-'+tnpp+'"]').removeClass("active");var ic=$('li[rel="image-'+$(el).data('npp')+'"]');ic.addClass("active");el.css({backgroundImage:'url('+el.data('background')+')'});var top=parseInt(ic.css('top'));if(top>10)$('.next-nav')[0].click();else if(top<0)$('.prev-nav')[0].click();}});function dunamik_cost_region(id,start){$(".fast-filter").html('<img style="width: 200px;margin-left: 42%;" src="/template/megohotel_old/img/loading2.gif">');ajax('hotels.price_dynamics',{},{get:'dunamik_cost_region',id:id,start:start},function(data){$(".fast-filter").html(data.content);if(data.dateStop)$(".fast-filter").append('<div onclick="dunamik_cost_region(`'+id+'`,`'+data.dateStop+'`);" class="new-date-dynamick">>></div>');if(data.dateRew)$(".fast-filter").append('<div onclick="dunamik_cost_region(`'+id+'`,`'+data.dateRew+'`);" class="new-date-dynamick" style="right: unset;"><<</div>');});};