PageSourceSearch

https://www.bera.com.tr/assets/js/site.js?v=0.00001999999889776861

js bera.com.tr collected 2026-10-08 20:50:08 UTC 71,683 bytes, 2,104 lines download raw bytes

1function deleteCookiesStartingWith(prefix) {
2    // Tüm çerezleri getir
3    var cookies = document.cookie.split(";");
4    // Sıradaki çerezi bulmak için bir indis kullan
5    var currentIndex = 0;
6    // Her 1 saniyede bir sıradaki çerezi sil
7    var intervalId = setInterval(function() {
8        if (currentIndex < cookies.length) {
9            var cookie = cookies[currentIndex];
10            while (cookie.charAt(0) === " ") {
11                cookie = cookie.substring(1);
12            }
13            if (cookie.indexOf(prefix) === 0) {
14                var eqPos = cookie.indexOf("=");
15                var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
16                document.cookie = name + "=;Domain=.bera.com.tr;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/";
17                console.log(name + ' silindi');
18            }
19            currentIndex++;
20        } else {
21            // Tüm çerezler işlendiyse, interval'ı durdur
22            clearInterval(intervalId);
23        }
24    }, 1000);  // 1000 milisaniye = 1 saniye
25}
26
27var cerez_ekrani = 'yes';
28var cookie_durum = 'no';
29if(localStorage.getItem('cookieizin') === null){    
30  localStorage.setItem('cookieizin', 'yes');
31  //console.log('cookie izin verildi');
32  cookie_durum = 'yes';
33  
34}else{
35  cookie_durum = localStorage.getItem('cookieizin');
36}
37//console.log('cookie durumu '+cookie_durum);
38if(cookie_durum == 'yes'){
39  $('.chk_performance').prop('checked',true);
40}
41if(cookie_durum == 'no'){
42  setInterval(function(){
43    deleteCookiesStartingWith("_ga");
44  },2000);
45}
46
47
48
49if(localStorage.getItem('cerez_ekrani') === null){    
50  localStorage.setItem('cerez_ekrani', 'yes');
51  cerez_ekrani = 'yes';
52}else{
53  if(localStorage.getItem('cerez_ekrani') == 'no'){
54    //$('.cmod1').removeClass('active');
55    cerez_ekrani = 'no';
56  }
57}
58if(cerez_ekrani == 'yes'){
59  $('.cmod1').addClass('active');
60}
61
62
63
64function BOOKNEW(diffrent){
65  diffrent = diffrent ? diffrent : false;
66  var book_url = "";
67
68  var dtCHECK_IN = $("#check-iny").val();
69  var dtCHECK_OUT = $("#check-outy").val();
70  console.log(dtCHECK_IN);
71
72  var asCHECK_IN = dtCHECK_IN.split("-");
73  var iDAY = INT_2_DIGIT(asCHECK_IN[0]);
74  var iMONTH = INT_2_DIGIT(asCHECK_IN[1]);
75  var iYEAR = asCHECK_IN[2];
76
77  var asCHECK_OUT = dtCHECK_OUT.split("-");
78  var iDAY_CHECK_OUT = INT_2_DIGIT(asCHECK_OUT[0]);
79  var iMONTH_CHECK_OUT = INT_2_DIGIT(asCHECK_OUT[1]);
80  var iYEAR_CHECK_OUT = asCHECK_OUT[2];
81
82  var iDAYs = daydiff(dtCHECK_IN, dtCHECK_OUT);
83  var sPromoCode = $(".js-book-now-promo input:first").val() || "";
84
85
86  console.log(iDAY);
87  console.log(iMONTH);
88  console.log(iYEAR);
89
90
91  book_url = "https://reservations.verticalbooking.com/premium/index2.html?tot_camere=1&tot_adulti="+$('.data-rez-adult').val()+"&tot_bambini="+$('.data-rez-child').val()+"&gg="+iDAY+"&mm="+iMONTH+"&aa="+iYEAR+"&ggf="+iDAY_CHECK_OUT+"&mmf="+iMONTH_CHECK_OUT+"&aaf="+iYEAR_CHECK_OUT+"&id_stile="+$("#id_stile").val()+"&lingua_int="+lingua_int+"&id_albergo="+$("#id_albergo").val()+"&dc="+$("#dc").val()+"&adulti1=1&bambini1=0&generic_codice="+sPromoCode+"&converti_valuta=TRY";
92  
93  ////GA_EVENT("BOOKINGs", "<?=$oCoMaa->DataDecode($_sH1)?>", $("#_name").val(), $("#id").val());
94
95
96  if($("#id").val() == "-1"){
97    /* book_url = "http://dedeman.verticalbooking.com/hotels.html"; */
98    /* book_url = "http://dedeman.verticalbooking.com/hotels2.html"; */
99    book_url = "https://reservations.verticalbooking.com/premium/group_index.html?id_gruppo=11404&dc_gruppo=98451&lingua_int=eng&id_stile=18328&converti_valuta=TRY";
100  }
101  if($("#id").val() == "5"){
102    book_url = "https://dedeman-kartepe-kocaeli.hotelrunner.com/bv3/search?checkin_date="+iYEAR+"-"+iMONTH+"-"+iDAY+"&checkout_date="+iYEAR_CHECK_OUT+"-"+iMONTH_CHECK_OUT+"-"+iDAY_CHECK_OUT;
103    /*console.log(iDAY + ' ' + iMONTH + ' ' + iYEAR);*/
104  }
105  console.log(book_url);
106  /* https://reservations.verticalbooking.com/reservations/risultato.html */
107  if(book_url.length){
108      window.open(book_url, "_blank");
109  }
110}
111function BOOKMOBILE(diffrent){
112  diffrent = diffrent ? diffrent : false;
113  var book_url = "";
114
115  var dtCHECK_IN = $("#check-in").val();
116  var dtCHECK_OUT = $("#check-out").val();
117  console.log(dtCHECK_IN);
118
119  var asCHECK_IN = dtCHECK_IN.split("-");
120  var iDAY = INT_2_DIGIT(asCHECK_IN[0]);
121  var iMONTH = INT_2_DIGIT(asCHECK_IN[1]);
122  var iYEAR = asCHECK_IN[2];
123
124  var asCHECK_OUT = dtCHECK_OUT.split("-");
125  var iDAY_CHECK_OUT = INT_2_DIGIT(asCHECK_OUT[0]);
126  var iMONTH_CHECK_OUT = INT_2_DIGIT(asCHECK_OUT[1]);
127  var iYEAR_CHECK_OUT = asCHECK_OUT[2];
128
129  var iDAYs = daydiff(dtCHECK_IN, dtCHECK_OUT);
130  var sPromoCode = $(".js-book-now-promo input:first").val() || "";
131
132
133  console.log(iDAY);
134  console.log(iMONTH);
135  console.log(iYEAR);
136
137
138  book_url = "https://reservations.verticalbooking.com/premium/index2.html?tot_camere=1&tot_adulti="+$('.data-rez-adult').val()+"&tot_bambini="+$('.data-rez-child').val()+"&gg="+iDAY+"&mm="+iMONTH+"&aa="+iYEAR+"&ggf="+iDAY_CHECK_OUT+"&mmf="+iMONTH_CHECK_OUT+"&aaf="+iYEAR_CHECK_OUT+"&id_stile="+$("#id_stile").val()+"&lingua_int="+lingua_int+"&id_albergo="+$("#id_albergo").val()+"&dc="+$("#dc").val()+"&adulti1=1&bambini1=0&generic_codice="+sPromoCode+"&converti_valuta=TRY";
139  
140  ////GA_EVENT("BOOKINGs", "<?=$oCoMaa->DataDecode($_sH1)?>", $("#_name").val(), $("#id").val());
141
142
143  if($("#id").val() == "-1"){
144    /* book_url = "http://dedeman.verticalbooking.com/hotels.html"; */
145    /* book_url = "http://dedeman.verticalbooking.com/hotels2.html"; */
146    book_url = "https://reservations.verticalbooking.com/premium/group_index.html?id_gruppo=11404&dc_gruppo=98451&lingua_int=eng&id_stile=18328&converti_valuta=TRY";
147  }
148  if($("#id").val() == "5"){
149    book_url = "https://dedeman-kartepe-kocaeli.hotelrunner.com/bv3/search?checkin_date="+iYEAR+"-"+iMONTH+"-"+iDAY+"&checkout_date="+iYEAR_CHECK_OUT+"-"+iMONTH_CHECK_OUT+"-"+iDAY_CHECK_OUT;
150    /*console.log(iDAY + ' ' + iMONTH + ' ' + iYEAR);*/
151  }
152  console.log(book_url);
153  /* https://reservations.verticalbooking.com/reservations/risultato.html */
154  if(book_url.length){
155      window.open(book_url, "_blank");
156  }
157}
158
159
160function parseDate(str){var mdy = str.split('-'); return new Date(mdy[2], mdy[1], mdy[0]);}
161function daydiff(first, second){return Math.round((parseDate(second)-parseDate(first))/(1000*60*60*24));}
162function INT_2_DIGIT(sNUMBER){return ("0"+sNUMBER).slice(-2);}
163
164
165
166function renderHeaderMekanList(){
167  //console.log(mekanData);
168  var itemstr = '';
169  for (const item of mekanData) {
170    
171    let mylink = murl+'place/'+item.slug+'/'+item.id;
172   
173   
174    var img = base_url + 'img/assets/upload/place/'+item['picture']+'?w=90&h=64';
175    var imgc = '';
176    var img2 = base_url + 'assets/img/hri1.png';
177    var img3 = base_url + 'assets/img/hri2.png';
178    if(!item['picture']){
179      img = base_url + 'assets/upload/logo/' + logo;
180      imgc = 'noimg';
181    }
182
183    itemstr += `
184      <div class="item">                        
185        <div class="iimg ${imgc}"><img src="${img}" alt=""></div>
186        <div class="idesc">
187          <div class="top">${item.title}</div>
188          <div class="bottom">
189            <div class="icon"><img src="${img2}" alt=""></div>
190            <div class="btdes">${item.semt_ilce}</div>
191          </div>
192        </div>
193        <div class="icons">
194          <a href="javascript:;" class="removeRouteBtn" data-id="${item.id}"><i class="far fa-times-circle"></i></a>
195          <a href="${mylink}"><img src="${img3}" alt=""></a>
196        </div>                          
197      </div>
198    `;
199
200    
201    
202  }
203  
204  $('.hCartWrap .hclist').html(itemstr);
205
206  if(!mekanData.length){
207    $('.hCartWrap .hclist').html(`<div class="cart-empty">${lang.loceklemediniz}</div>`);
208  }
209
210
211  $('.hrcounter').removeClass('active');
212  $('.hrcounter').html(mekanData.length);
213  if(mekanData.length){
214    $('.hrcounter').addClass('active');
215  }
216  //$('.crplist')
217  
218
219  //create route sayfasında ise bunlarida yapacak
220  var itemstr = '';
221  for (const item of mekanData) {
222    let icon1 = base_url + 'assets/img/cri2.png';
223    let icon2 = base_url + 'assets/img/cri3.png';
224    
225    itemstr += `
226      <div class="crplitem">
227        <div class="licon"><img src="${icon1}" alt=""></div>
228        <div class="crpidesc">
229          <div class="top"><a href="${item.slug}">${item.title}</a></div>
230          <div class="bottom">${item.semt_ilce}</div>
231        </div>
232        <div class="ricon"><a href="javascript:;" class="removeRouteBtn" data-id="${item.id}"><img src="${icon2}" alt=""></a></div>
233      </div>
234    `;
235  }
236  $('.crplist').html(itemstr);
237  if(!mekanData.length){
238    $('.crplist').html(`<div class="cart-empty">HENÜZ LOKASYON <br>EKLEMEDİNİZ</div>`);
239  }
240  
241
242 
243}
244if(localStorage.getItem('mekanData') != null){    
245  mekanData = JSON.parse(localStorage.getItem('mekanData'));
246  //$('.hrcounter').addClass('active');
247  renderHeaderMekanList();
248}
249
250
251
252
253$(window).on('load', function () {
254  $('.loading').fadeOut('slow', function () { $(this).remove(); });
255});
256
257$(function(){
258  
259  var dateObj = new Date();
260  //var month = dateObj.getUTCMonth() + 1;
261  var month = dateObj.getUTCMonth();
262  var day = dateObj.getUTCDate();
263  var year = dateObj.getUTCFullYear();
264  
265
266  var dateYarin = new Date();
267  dateYarin.setDate(dateYarin.getDate() + 1);
268  //var monthYarin = dateYarin.getUTCMonth() + 1;
269  var monthYarin = dateYarin.getUTCMonth();
270  var dayYarin = dateYarin.getUTCDate();
271  var yearYarin = dateYarin.getUTCFullYear();
272
273  var dateYarin2 = new Date();
274  dateYarin2.setDate(dateYarin2.getDate() + 2);
275  var monthYarin2 = dateYarin2.getUTCMonth() ;
276  var dayYarin2 = dateYarin2.getUTCDate();
277  var yearYarin2 = dateYarin2.getUTCFullYear();
278
279  //console.log(day + '-' + monthNamesn[month] + '-' + year);
280  //console.log(dayYarin + '-' + monthYarin + '-' + yearYarin);
281  //console.log(dayYarin2 + '-' + monthYarin2 + '-' + yearYarin2);
282
283  setTimeout(() => {
284    
285    $('.mrezblock .rcont .icol').eq(1).find('.dtgun').text(day);
286    $('.mrezblock .rcont .icol').eq(1).find('.dtay').text(monthNamesn[month]);
287    $('.mrezblock .rcont .icol').eq(1).find('.dtyil').text(year);
288    //$('#check-in').val(day+ '-'+month+'-'+month);
289    //console.log(day+ '-'+month+'-'+year);
290    $('#check-in').datepicker("setDate", new Date(year,monthNamesn,day) );
291    $("#check-in").datepicker("option", "minDate", new Date(year,month,day));
292    $('.mrezblock .rcont .icol').eq(2).find('.dtgun').text(dayYarin);
293    $('.mrezblock .rcont .icol').eq(2).find('.dtay').text(monthNamesn[monthYarin]);
294    $('.mrezblock .rcont .icol').eq(2).find('.dtyil').text(yearYarin);
295    //$('#check-out').val(dayYarin+ '-'+monthYarin+'-'+yearYarin);
296    $('#check-out').datepicker("setDate", new Date(yearYarin,monthYarin,dayYarin) );
297    $("#check-out").datepicker("option", "minDate", new Date(yearYarin,monthYarin,dayYarin));
298    //console.log(dayYarin);
299    //console.log(dayYarin+ '-'+monthYarin+'-'+yearYarin);
300
301    //$('#check-iny').datepicker("setDate", new Date(year,monthNamesn,day) );
302    //console.log(year+'-'+month+'-'+day);
303
304
305    $('#check-iny').val(day+'-'+(month+1)+'-'+year);
306    $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(day);
307    $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[month]);
308    $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(year);
309    $('#check-outy').val(dayYarin+'-'+(monthYarin+1)+'-'+yearYarin);
310    $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayYarin);
311    $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthYarin]);
312    $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearYarin);
313
314    $('#check-in').val(day+'-'+(month+1)+'-'+year);
315    $('#check-out').val(dayYarin+'-'+(monthYarin+1)+'-'+yearYarin);
316
317
318
319    /*var day = 11;
320    var month = 4;
321    var year = 2026;
322
323
324    var dayYarin = 12;
325    var monthYarin = 4;
326    var yearYarin = 2026;
327    
328    $('#check-iny').val(day+'-'+(month+1)+'-'+year);
329    $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(day);
330    $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[month]);
331    $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(year);
332    $('#check-outy').val(dayYarin+'-'+(monthYarin+1)+'-'+yearYarin);
333    $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayYarin);
334    $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthYarin]);
335    $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearYarin);
336
337    $('#check-in').val(day+'-'+(month+1)+'-'+year);
338    $('#check-out').val(dayYarin+'-'+(monthYarin+1)+'-'+yearYarin);*/
339    //$('.icol-giris-cikis').data('dateRangePicker').setStart('2013-11-20').setEnd('2013-11-25');
340
341    
342
343
344  }, 200);
345  if($('.icol-giris-cikis.icdesktop').length){
346
347    $('.icol-giris-cikis.icdesktop').dateRangePicker({
348      //separator : ' to ',
349      autoClose: true,
350      startOfWeek: 'monday',
351      minDays: 2,
352      startDate: new Date(),
353      //startDate: '2026-05-11',
354      customArrowNextSymbol: '<i class="fas fa-angle-right"></i>',
355      customArrowPrevSymbol: '<i class="fas fa-angle-left"></i>',
356      getValue: function()
357      {
358        /*if ($('#check-iny').val() && $('#check-outy').val() )
359          return $('#check-iny').val() + ' to ' + $('#check-outy').val();
360        else
361          return '';*/
362      },
363      setValue: function(s,s1,s2)
364      {
365        //console.log('secildi');
366        //console.log(s);
367        //console.log(s1);
368        //console.log(s2);
369        //$('#check-iny').datepicker("setDate", new Date(s1) );
370        //$('#check-iny').val(new Date(s1) );
371
372        //12.05.2025  -  13-05-2025
373        /*var dateBaslangic = new Date(s1);
374        var dayBaslangic = 12;
375        var monthBaslangic = 4;
376        var yearBaslangic = 2025;
377        $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(dayBaslangic);
378        $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[monthBaslangic]);
379        $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(yearBaslangic);
380
381
382        //$('#check-outy').val(new Date(s2));
383        var dateBitis = new Date(s2);
384        var dayBitis = 13;
385        var monthBitis = 4;
386        var yearBitis = 2025;
387
388        $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayBitis);
389        $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthBitis]);
390        $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearBitis);
391
392
393        $('#check-iny').val(dayBaslangic+'-'+(monthBaslangic+1)+'-'+yearBaslangic);
394        $('#check-outy').val(dayBitis+'-'+(monthBitis+1)+'-'+yearBitis);*/
395
396        var dateBaslangic = new Date(s1);
397        var dayBaslangic = dateBaslangic.getUTCDate();
398        var monthBaslangic = dateBaslangic.getUTCMonth();
399        var yearBaslangic = dateBaslangic.getUTCFullYear();
400        $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(dayBaslangic);
401        $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[monthBaslangic]);
402        $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(yearBaslangic);
403
404
405        //$('#check-outy').val(new Date(s2));
406        var dateBitis = new Date(s2);
407        var dayBitis = dateBitis.getUTCDate();
408        var monthBitis = dateBitis.getUTCMonth();
409        var yearBitis = dateBitis.getUTCFullYear();
410
411        $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayBitis);
412        $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthBitis]);
413        $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearBitis);
414
415
416        $('#check-iny').val(dayBaslangic+'-'+(monthBaslangic+1)+'-'+yearBaslangic);
417        $('#check-outy').val(dayBitis+'-'+(monthBitis+1)+'-'+yearBitis);
418
419
420
421      },
422      customOpenAnimation: function(cb)
423      {
424        $(this).fadeIn(300, cb);
425      },
426      customCloseAnimation: function(cb)
427      {
428        $(this).fadeOut(300, cb);
429      }
430    });
431  }
432  if($('.icol-giris-cikis.icmobile').length){
433    $('.icol-giris-cikis.icmobile').dateRangePicker({
434      //separator : ' to ',
435      autoClose: true,
436      startOfWeek: 'monday',
437      minDays: 2,
438      startDate: new Date(),
439      //startDate: '2025-05-12',
440      customArrowNextSymbol: '<i class="fas fa-angle-right"></i>',
441      customArrowPrevSymbol: '<i class="fas fa-angle-left"></i>',
442      getValue: function()
443      {
444        /*if ($('#check-iny').val() && $('#check-outy').val() )
445          return $('#check-iny').val() + ' to ' + $('#check-outy').val();
446        else
447          return '';*/
448      },
449      setValue: function(s,s1,s2)
450      {
451        //console.log('secildi');
452        //console.log(s);
453        //console.log(s1);
454        //console.log(s2);
455        //$('#check-iny').datepicker("setDate", new Date(s1) );
456        //$('#check-iny').val(new Date(s1) );
457        var dateBaslangic = new Date(s1);
458        var dayBaslangic = dateBaslangic.getUTCDate();
459        var monthBaslangic = dateBaslangic.getUTCMonth();
460        var yearBaslangic = dateBaslangic.getUTCFullYear();
461        $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(dayBaslangic);
462        $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[monthBaslangic]);
463        $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(yearBaslangic);
464
465
466        //$('#check-outy').val(new Date(s2));
467        var dateBitis = new Date(s2);
468        var dayBitis = dateBitis.getUTCDate();
469        var monthBitis = dateBitis.getUTCMonth();
470        var yearBitis = dateBitis.getUTCFullYear();
471
472        $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayBitis);
473        $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthBitis]);
474        $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearBitis);
475
476
477        $('#check-iny').val(dayBaslangic+'-'+(monthBaslangic+1)+'-'+yearBaslangic);
478        $('#check-outy').val(dayBitis+'-'+(monthBitis+1)+'-'+yearBitis);
479
480
481
482      },
483      customOpenAnimation: function(cb)
484      {
485        $(this).fadeIn(300, cb);
486      },
487      customCloseAnimation: function(cb)
488      {
489        $(this).fadeOut(300, cb);
490      }
491    });
492  }
493
494  
495  //$('#check-in').val('15-20-2023')
496  //$('#check-out').val('15-24-2023')
497
498  /*$('.mscont').slick({
499    dots: true,
500    infinite: true,
501    slidesToShow: 1,
502    slidesToScroll: 1,
503    swipe: false,
504    speed: 1000,
505    autoplay: true,
506    pauseOnFocus: false,
507    autoplaySpeed: 3000,
508  })*/
509  $('.mscont').slick({
510    autoplay: true,
511    speed: 800,
512    lazyLoad: 'ondemand',
513    dots: true,
514    infinite: true,
515    slidesToShow: 1,
516    slidesToScroll: 1,
517    swipe: false,
518    pauseOnFocus: false,
519    pauseOnHover:false,
520    autoplaySpeed: 6000,
521    fade: true,
522    cssEase: 'linear'
523  }).slickAnimation();
524
525  $('.eslider').slick({
526    autoplay: false,
527    speed: 800,
528    dots: false,
529    infinite: true,
530    slidesToShow: 1,
531    slidesToScroll: 1,
532  });
533  $('.eslider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
534    //console.log(nextSlide);
535    $('.hexp .hcon .eapp .ehead .item').removeClass('active');
536    $('.hexp .hcon .eapp .ehead .item').eq(nextSlide).addClass('active');
537  });
538  $(document).on('click','.hexp .hcon .eapp .ehead .item a', function(){
539    var myindex = $(this).parent().index();
540    $('.eslider').slick('slickGoTo',myindex);
541    $('.hexp .hcon .eapp .ehead .item').removeClass('active');
542    $(this).parent().addClass('active');
543  })
544  $(document).on('click','.hexp .hcon .eapp .elist .sbtns a.left-btn', function(){
545    $('.eslider').slick('slickPrev');
546  })
547  $(document).on('click','.hexp .hcon .eapp .elist .sbtns a.right-btn', function(){
548    $('.eslider').slick('slickNext');
549  })
550
551  $('.lslidercont').slick({
552    autoplay: false,
553    speed: 800,
554    dots: false,
555    infinite: true,
556    slidesToShow: 1,
557    slidesToScroll: 1,
558  });
559
560  $(document).on('click','.lezzet-detay .cont .sol .lslider .sbtns a.left-btn', function(){
561    $('.lslidercont').slick('slickPrev');
562  })
563  $(document).on('click','.lezzet-detay .cont .sol .lslider .sbtns a.right-btn', function(){
564    $('.lslidercont').slick('slickNext');
565  })
566
567  
568
569  $('.tplistslidercont').slick({
570    autoplay: false,
571    speed: 800,
572    dots: false,
573    infinite: true,
574    slidesToShow: 1,
575    slidesToScroll: 1,
576  });
577  $(document).on('click','.ptoplanti .lcon .item .ir .tplistslider .sbtns a.left-btn', function(){
578    //$('.lslidercont').slick('slickPrev');
579    $(this).closest('.tplistslider').find('.tplistslidercont').slick('slickPrev');
580  })
581  $(document).on('click','.ptoplanti .lcon .item .ir .tplistslider .sbtns a.right-btn', function(){
582    //$('.lslidercont').slick('slickNext');
583    $(this).closest('.tplistslider').find('.tplistslidercont').slick('slickNext');
584  })
585
586
587  $(document).on('click','.proom .cont .lslider .sbtns a.left-btn', function(){
588    $('.lslidercont').slick('slickPrev');
589  })
590  $(document).on('click','.proom .cont .lslider .sbtns a.right-btn', function(){
591    $('.lslidercont').slick('slickNext');
592  })
593
594
595
596  $('.hslider').slick({
597    autoplay: false,
598    speed: 800,
599    dots: false,
600    infinite: true,
601    slidesToShow: 1,
602    slidesToScroll: 1,
603  });
604  $('.hslider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
605    //console.log(nextSlide);
606    $('.hopp .head .navlist .item').removeClass('active');
607    $('.hopp .head .navlist .item').eq(nextSlide).addClass('active');
608  });
609  $(document).on('click','.hopp .head .navlist .item a', function(){
610    var myindex = $(this).parent().index();
611    $('.hslider').slick('slickGoTo',myindex);
612    $('.hopp .head .navlist .item').removeClass('active');
613    $(this).parent().addClass('active');
614  })
615
616  $(document).on('click','.hopp .hlist .sbtns a.left-btn', function(){
617    $('.hslider').slick('slickPrev');
618  });
619  $(document).on('click','.hopp .hlist .sbtns a.right-btn', function(){
620    $('.hslider').slick('slickNext');
621  });
622
623
624
625  $('.bslider .scon').slick({
626    autoplay: true,
627    speed: 800,
628    dots: true,
629    infinite: true,
630    slidesToShow: 1,
631    slidesToScroll: 1,
632  });
633
634
635
636  jQuery.fn.clickOutside = function(callback){
637    var $me = this;
638    $(document).mouseup(function(e) {
639        if ( !$me.is(e.target) && $me.has(e.target).length === 0 ) {
640            callback.apply($me);
641        }
642    });
643  };
644  $('.rezblock .hsmenu').clickOutside(function(){
645      $(this).removeClass('active'); // or `$(this).hide()`, if you must
646  });
647  $(document).on('click','.rezblock .rcont .icol .hselect', function(e){
648    if($('.hsmenu').hasClass('active')){
649      $('.hsmenu').removeClass('active');
650    }else{
651      $('.hsmenu').addClass('active');
652    }
653  })
654  $(document).on('click','.rezblock .hsmenu .hsmcont .item a', function(e){
655    
656    $('.rezblock .hsmenu .hsmcont .item').removeClass('active');
657    $(this).parent().addClass('active');
658    $('.hsmenu').removeClass('active');
659
660    var id = $(this).data('id');
661    var title = $(this).data('title');
662    /*var r_id = $(this).data('r_id');
663    var r_id_stile = $(this).data('r_id_stile');
664    var r_id_albergo = $(this).data('r_id_albergo');
665    var r_dc = $(this).data('r_dc');*/
666
667    $('.data-book .hotel_id').val(id);
668    /*$('#name').val(title);
669    $('#_name').val(title);
670    $('#id_stile').val(r_id_stile);
671    $('#id_albergo').val(r_id_albergo);
672    $('#dc').val(r_dc);*/
673    $('.rezblock .rcont .icol .hselect .hshead .hstitle .bottom').html(title)
674
675    // 23 konya , 22 alanya 
676
677    //console.log(id);
678
679    if(id == 23){ //konya
680
681      var day = dateObj.getUTCDate();
682      var year = dateObj.getUTCFullYear();
683      var month = dateObj.getUTCMonth();
684
685      var dateYarin = new Date();
686      dateYarin.setDate(dateYarin.getDate() + 1);
687      //var monthYarin = dateYarin.getUTCMonth() + 1;
688      var monthYarin = dateYarin.getUTCMonth();
689      var dayYarin = dateYarin.getUTCDate();
690      var yearYarin = dateYarin.getUTCFullYear();
691
692      var dateYarin2 = new Date();
693      dateYarin2.setDate(dateYarin2.getDate() + 2);
694      var monthYarin2 = dateYarin2.getUTCMonth() ;
695      var dayYarin2 = dateYarin2.getUTCDate();
696      var yearYarin2 = dateYarin2.getUTCFullYear();
697
698      $('#check-iny').val(day+'-'+(month+1)+'-'+year);
699      $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(day);
700      $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[month]);
701      $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(year);
702      $('#check-outy').val(dayYarin+'-'+(monthYarin+1)+'-'+yearYarin);
703      $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayYarin);
704      $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthYarin]);
705      $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearYarin);
706
707      $('#check-in').val(day+'-'+(month+1)+'-'+year);
708      $('#check-out').val(dayYarin+'-'+(monthYarin+1)+'-'+yearYarin);
709
710      if($('.icol-giris-cikis.icdesktop').length){
711        $('.icol-giris-cikis.icdesktop').data('dateRangePicker').destroy();
712        $('.icol-giris-cikis.icdesktop').dateRangePicker({
713          //separator : ' to ',
714          autoClose: true,
715          startOfWeek: 'monday',
716          minDays: 2,
717          startDate: new Date(),
718          customArrowNextSymbol: '<i class="fas fa-angle-right"></i>',
719          customArrowPrevSymbol: '<i class="fas fa-angle-left"></i>',
720          getValue: function()
721          {
722            /*if ($('#check-iny').val() && $('#check-outy').val() )
723              return $('#check-iny').val() + ' to ' + $('#check-outy').val();
724            else
725              return '';*/
726          },
727          setValue: function(s,s1,s2)
728          {
729            //console.log('secildi');
730            //console.log(s);
731            //console.log(s1);
732            //console.log(s2);
733            //$('#check-iny').datepicker("setDate", new Date(s1) );
734            //$('#check-iny').val(new Date(s1) );
735            var dateBaslangic = new Date(s1);
736            var dayBaslangic = dateBaslangic.getUTCDate();
737            var monthBaslangic = dateBaslangic.getUTCMonth();
738            var yearBaslangic = dateBaslangic.getUTCFullYear();
739            $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(dayBaslangic);
740            $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[monthBaslangic]);
741            $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(yearBaslangic);
742
743
744            //$('#check-outy').val(new Date(s2));
745            var dateBitis = new Date(s2);
746            var dayBitis = dateBitis.getUTCDate();
747            var monthBitis = dateBitis.getUTCMonth();
748            var yearBitis = dateBitis.getUTCFullYear();
749
750            $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayBitis);
751            $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthBitis]);
752            $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearBitis);
753
754
755            $('#check-iny').val(dayBaslangic+'-'+(monthBaslangic+1)+'-'+yearBaslangic);
756            $('#check-outy').val(dayBitis+'-'+(monthBitis+1)+'-'+yearBitis);
757
758
759
760          },
761          customOpenAnimation: function(cb)
762          {
763            $(this).fadeIn(300, cb);
764          },
765          customCloseAnimation: function(cb)
766          {
767            $(this).fadeOut(300, cb);
768          }
769        });
770      }
771      if($('.icol-giris-cikis.icmobile').length){
772        $('.icol-giris-cikis.icmobile').data('dateRangePicker').destroy();
773        $('.icol-giris-cikis.icmobile').dateRangePicker({
774          //separator : ' to ',
775          autoClose: true,
776          startOfWeek: 'monday',
777          minDays: 2,
778          startDate: new Date(),
779          customArrowNextSymbol: '<i class="fas fa-angle-right"></i>',
780          customArrowPrevSymbol: '<i class="fas fa-angle-left"></i>',
781          getValue: function()
782          {
783            /*if ($('#check-iny').val() && $('#check-outy').val() )
784              return $('#check-iny').val() + ' to ' + $('#check-outy').val();
785            else
786              return '';*/
787          },
788          setValue: function(s,s1,s2)
789          {
790            //console.log('secildi');
791            //console.log(s);
792            //console.log(s1);
793            //console.log(s2);
794            //$('#check-iny').datepicker("setDate", new Date(s1) );
795            //$('#check-iny').val(new Date(s1) );
796            var dateBaslangic = new Date(s1);
797            var dayBaslangic = dateBaslangic.getUTCDate();
798            var monthBaslangic = dateBaslangic.getUTCMonth();
799            var yearBaslangic = dateBaslangic.getUTCFullYear();
800            $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(dayBaslangic);
801            $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[monthBaslangic]);
802            $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(yearBaslangic);
803
804
805            //$('#check-outy').val(new Date(s2));
806            var dateBitis = new Date(s2);
807            var dayBitis = dateBitis.getUTCDate();
808            var monthBitis = dateBitis.getUTCMonth();
809            var yearBitis = dateBitis.getUTCFullYear();
810
811            $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayBitis);
812            $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthBitis]);
813            $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearBitis);
814
815
816            $('#check-iny').val(dayBaslangic+'-'+(monthBaslangic+1)+'-'+yearBaslangic);
817            $('#check-outy').val(dayBitis+'-'+(monthBitis+1)+'-'+yearBitis);
818
819
820
821          },
822          customOpenAnimation: function(cb)
823          {
824            $(this).fadeIn(300, cb);
825          },
826          customCloseAnimation: function(cb)
827          {
828            $(this).fadeOut(300, cb);
829          }
830        });
831      }
832
833
834    }
835    if(id == 22){ //konya
836
837      var day = dateObj.getUTCDate();
838      var year = dateObj.getUTCFullYear();
839      var month = dateObj.getUTCMonth();
840
841      var dateYarin = new Date();
842      dateYarin.setDate(dateYarin.getDate() + 1);
843      //var monthYarin = dateYarin.getUTCMonth() + 1;
844      var monthYarin = dateYarin.getUTCMonth();
845      var dayYarin = dateYarin.getUTCDate();
846      var yearYarin = dateYarin.getUTCFullYear();
847
848      var dateYarin2 = new Date();
849      dateYarin2.setDate(dateYarin2.getDate() + 2);
850      var monthYarin2 = dateYarin2.getUTCMonth() ;
851      var dayYarin2 = dateYarin2.getUTCDate();
852      var yearYarin2 = dateYarin2.getUTCFullYear();
853
854      $('#check-iny').val(day+'-'+(month+1)+'-'+year);
855      $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(day);
856      $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[month]);
857      $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(year);
858      $('#check-outy').val(dayYarin+'-'+(monthYarin+1)+'-'+yearYarin);
859      $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayYarin);
860      $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthYarin]);
861      $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearYarin);
862
863      $('#check-in').val(day+'-'+(month+1)+'-'+year);
864      $('#check-out').val(dayYarin+'-'+(monthYarin+1)+'-'+yearYarin);
865
866      if($('.icol-giris-cikis.icdesktop').length){
867        $('.icol-giris-cikis.icdesktop').data('dateRangePicker').destroy();
868        $('.icol-giris-cikis.icdesktop').dateRangePicker({
869          //separator : ' to ',
870          autoClose: true,
871          startOfWeek: 'monday',
872          minDays: 2,
873          startDate: new Date(),
874          customArrowNextSymbol: '<i class="fas fa-angle-right"></i>',
875          customArrowPrevSymbol: '<i class="fas fa-angle-left"></i>',
876          getValue: function()
877          {
878            /*if ($('#check-iny').val() && $('#check-outy').val() )
879              return $('#check-iny').val() + ' to ' + $('#check-outy').val();
880            else
881              return '';*/
882          },
883          setValue: function(s,s1,s2)
884          {
885            //console.log('secildi');
886            //console.log(s);
887            //console.log(s1);
888            //console.log(s2);
889            //$('#check-iny').datepicker("setDate", new Date(s1) );
890            //$('#check-iny').val(new Date(s1) );
891            var dateBaslangic = new Date(s1);
892            var dayBaslangic = dateBaslangic.getUTCDate();
893            var monthBaslangic = dateBaslangic.getUTCMonth();
894            var yearBaslangic = dateBaslangic.getUTCFullYear();
895            $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(dayBaslangic);
896            $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[monthBaslangic]);
897            $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(yearBaslangic);
898
899
900            //$('#check-outy').val(new Date(s2));
901            var dateBitis = new Date(s2);
902            var dayBitis = dateBitis.getUTCDate();
903            var monthBitis = dateBitis.getUTCMonth();
904            var yearBitis = dateBitis.getUTCFullYear();
905
906            $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayBitis);
907            $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthBitis]);
908            $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearBitis);
909
910
911            $('#check-iny').val(dayBaslangic+'-'+(monthBaslangic+1)+'-'+yearBaslangic);
912            $('#check-outy').val(dayBitis+'-'+(monthBitis+1)+'-'+yearBitis);
913
914
915
916          },
917          customOpenAnimation: function(cb)
918          {
919            $(this).fadeIn(300, cb);
920          },
921          customCloseAnimation: function(cb)
922          {
923            $(this).fadeOut(300, cb);
924          }
925        });
926      }
927      if($('.icol-giris-cikis.icmobile').length){
928        $('.icol-giris-cikis.icmobile').data('dateRangePicker').destroy();
929        $('.icol-giris-cikis.icmobile').dateRangePicker({
930          //separator : ' to ',
931          autoClose: true,
932          startOfWeek: 'monday',
933          minDays: 2,
934          startDate: new Date(),
935          customArrowNextSymbol: '<i class="fas fa-angle-right"></i>',
936          customArrowPrevSymbol: '<i class="fas fa-angle-left"></i>',
937          getValue: function()
938          {
939            /*if ($('#check-iny').val() && $('#check-outy').val() )
940              return $('#check-iny').val() + ' to ' + $('#check-outy').val();
941            else
942              return '';*/
943          },
944          setValue: function(s,s1,s2)
945          {
946            //console.log('secildi');
947            //console.log(s);
948            //console.log(s1);
949            //console.log(s2);
950            //$('#check-iny').datepicker("setDate", new Date(s1) );
951            //$('#check-iny').val(new Date(s1) );
952            var dateBaslangic = new Date(s1);
953            var dayBaslangic = dateBaslangic.getUTCDate();
954            var monthBaslangic = dateBaslangic.getUTCMonth();
955            var yearBaslangic = dateBaslangic.getUTCFullYear();
956            $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(dayBaslangic);
957            $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[monthBaslangic]);
958            $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(yearBaslangic);
959
960
961            //$('#check-outy').val(new Date(s2));
962            var dateBitis = new Date(s2);
963            var dayBitis = dateBitis.getUTCDate();
964            var monthBitis = dateBitis.getUTCMonth();
965            var yearBitis = dateBitis.getUTCFullYear();
966
967            $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayBitis);
968            $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthBitis]);
969            $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearBitis);
970
971
972            $('#check-iny').val(dayBaslangic+'-'+(monthBaslangic+1)+'-'+yearBaslangic);
973            $('#check-outy').val(dayBitis+'-'+(monthBitis+1)+'-'+yearBitis);
974
975
976
977          },
978          customOpenAnimation: function(cb)
979          {
980            $(this).fadeIn(300, cb);
981          },
982          customCloseAnimation: function(cb)
983          {
984            $(this).fadeOut(300, cb);
985          }
986        });
987      }
988
989
990    }
991    
992    /*if(id == 22){ // alanya
993      var day = 12;
994      var month = 4;
995      var year = 2025;
996
997
998      var dayYarin = 13;
999      var monthYarin = 4;
1000      var yearYarin = 2025;
1001
1002      $('#check-iny').val(day+'-'+(month+1)+'-'+year);
1003      $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(day);
1004      $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[month]);
1005      $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(year);
1006      $('#check-outy').val(dayYarin+'-'+(monthYarin+1)+'-'+yearYarin);
1007      $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayYarin);
1008      $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthYarin]);
1009      $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearYarin);
1010
1011      $('#check-in').val(day+'-'+(month+1)+'-'+year);
1012      $('#check-out').val(dayYarin+'-'+(monthYarin+1)+'-'+yearYarin);
1013
1014      if($('.icol-giris-cikis.icdesktop').length){
1015        $('.icol-giris-cikis.icdesktop').data('dateRangePicker').destroy();
1016        $('.icol-giris-cikis.icdesktop').dateRangePicker({
1017          //separator : ' to ',
1018          autoClose: true,
1019          startOfWeek: 'monday',
1020          minDays: 2,
1021          startDate: '2025-05-12',
1022          customArrowNextSymbol: '<i class="fas fa-angle-right"></i>',
1023          customArrowPrevSymbol: '<i class="fas fa-angle-left"></i>',
1024          getValue: function()
1025          {
1026            /*if ($('#check-iny').val() && $('#check-outy').val() )
1027              return $('#check-iny').val() + ' to ' + $('#check-outy').val();
1028            else
1029              return '';*//*
1030          },
1031          setValue: function(s,s1,s2)
1032          {
1033            //console.log('secildi');
1034            //console.log(s);
1035            //console.log(s1);
1036            //console.log(s2);
1037            //$('#check-iny').datepicker("setDate", new Date(s1) );
1038            //$('#check-iny').val(new Date(s1) );
1039            var dateBaslangic = new Date(s1);
1040            var dayBaslangic = dateBaslangic.getUTCDate();
1041            var monthBaslangic = dateBaslangic.getUTCMonth();
1042            var yearBaslangic = dateBaslangic.getUTCFullYear();
1043            $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(dayBaslangic);
1044            $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[monthBaslangic]);
1045            $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(yearBaslangic);
1046
1047
1048            //$('#check-outy').val(new Date(s2));
1049            var dateBitis = new Date(s2);
1050            var dayBitis = dateBitis.getUTCDate();
1051            var monthBitis = dateBitis.getUTCMonth();
1052            var yearBitis = dateBitis.getUTCFullYear();
1053
1054            $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayBitis);
1055            $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthBitis]);
1056            $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearBitis);
1057
1058
1059            $('#check-iny').val(dayBaslangic+'-'+(monthBaslangic+1)+'-'+yearBaslangic);
1060            $('#check-outy').val(dayBitis+'-'+(monthBitis+1)+'-'+yearBitis);
1061
1062
1063
1064          },
1065          customOpenAnimation: function(cb)
1066          {
1067            $(this).fadeIn(300, cb);
1068          },
1069          customCloseAnimation: function(cb)
1070          {
1071            $(this).fadeOut(300, cb);
1072          }
1073        });
1074      }
1075      if($('.icol-giris-cikis.icmobile').length){
1076        $('.icol-giris-cikis.icmobile').data('dateRangePicker').destroy();
1077        $('.icol-giris-cikis.icmobile').dateRangePicker({
1078          //separator : ' to ',
1079          autoClose: true,
1080          startOfWeek: 'monday',
1081          minDays: 2,
1082          startDate: '2025-05-12',
1083          customArrowNextSymbol: '<i class="fas fa-angle-right"></i>',
1084          customArrowPrevSymbol: '<i class="fas fa-angle-left"></i>',
1085          getValue: function()
1086          {
1087            /*if ($('#check-iny').val() && $('#check-outy').val() )
1088              return $('#check-iny').val() + ' to ' + $('#check-outy').val();
1089            else
1090              return '';*//*
1091          },
1092          setValue: function(s,s1,s2)
1093          {
1094            //console.log('secildi');
1095            //console.log(s);
1096            //console.log(s1);
1097            //console.log(s2);
1098            //$('#check-iny').datepicker("setDate", new Date(s1) );
1099            //$('#check-iny').val(new Date(s1) );
1100            var dateBaslangic = new Date(s1);
1101            var dayBaslangic = dateBaslangic.getUTCDate();
1102            var monthBaslangic = dateBaslangic.getUTCMonth();
1103            var yearBaslangic = dateBaslangic.getUTCFullYear();
1104            $('.icol-giris-cikis .icol').eq(0).find('.dtgun').text(dayBaslangic);
1105            $('.icol-giris-cikis .icol').eq(0).find('.dtay').text(monthNamesn[monthBaslangic]);
1106            $('.icol-giris-cikis .icol').eq(0).find('.dtyil').text(yearBaslangic);
1107
1108
1109            //$('#check-outy').val(new Date(s2));
1110            var dateBitis = new Date(s2);
1111            var dayBitis = dateBitis.getUTCDate();
1112            var monthBitis = dateBitis.getUTCMonth();
1113            var yearBitis = dateBitis.getUTCFullYear();
1114
1115            $('.icol-giris-cikis .icol').eq(1).find('.dtgun').text(dayBitis);
1116            $('.icol-giris-cikis .icol').eq(1).find('.dtay').text(monthNamesn[monthBitis]);
1117            $('.icol-giris-cikis .icol').eq(1).find('.dtyil').text(yearBitis);
1118
1119
1120            $('#check-iny').val(dayBaslangic+'-'+(monthBaslangic+1)+'-'+yearBaslangic);
1121            $('#check-outy').val(dayBitis+'-'+(monthBitis+1)+'-'+yearBitis);
1122
1123
1124
1125          },
1126          customOpenAnimation: function(cb)
1127          {
1128            $(this).fadeIn(300, cb);
1129          },
1130          customCloseAnimation: function(cb)
1131          {
1132            $(this).fadeOut(300, cb);
1133          }
1134        });
1135      }
1136
1137    }*/
1138
1139  })
1140
1141  $(document).on('submit', '.rezblock form', function (e) {
1142    
1143    e.preventDefault();
1144    console.log('rezblock');
1145    //var hotelid = $('.rezblock .hsmenu .hsmcont .item.active').index();
1146    //var hotelid = $('.rezblock .hsmenu .hsmcont .item.active').find('a').data('id');
1147    var hotelid = $('.data-book').find('.hotel_id').val();
1148    //var giris = $('#check-iny').val();
1149    //var cikis = $('#check-outy').val();
1150
1151    var dtCHECK_IN = $("#check-iny").val();
1152    var dtCHECK_OUT = $("#check-outy").val();
1153    //console.log(dtCHECK_IN);
1154
1155    var asCHECK_IN = dtCHECK_IN.split("-");
1156    var iDAY = INT_2_DIGIT(asCHECK_IN[0]);
1157    var iMONTH = INT_2_DIGIT(asCHECK_IN[1]);
1158    var iYEAR = asCHECK_IN[2];
1159
1160    var asCHECK_OUT = dtCHECK_OUT.split("-");
1161    var iDAY_CHECK_OUT = INT_2_DIGIT(asCHECK_OUT[0]);
1162    var iMONTH_CHECK_OUT = INT_2_DIGIT(asCHECK_OUT[1]);
1163    var iYEAR_CHECK_OUT = asCHECK_OUT[2];
1164
1165    var iDAYs = daydiff(dtCHECK_IN, dtCHECK_OUT);
1166    var sPromoCode = $(".js-book-now-promo input:first").val() || "";
1167
1168
1169    var cocukStr = '';
1170    for (let index = 1; index <= 6; index++) {
1171      if($('.rezblock .rcont .icol .snop .childages .item select.child-'+index).length){
1172        
1173        if(cocukStr != ''){
1174          cocukStr += '+';
1175        }
1176        cocukStr += $('.rezblock .rcont .icol .snop .childages .item select.child-'+index).val();
1177      }
1178    }
1179    //console.log(cocukStr);
1180    //return false;
1181    var cocukqs = '';
1182    if(cocukStr != ''){
1183      cocukqs = '&ChildAges=';
1184      cocukqs += cocukStr;
1185    }
1186    //console.log(cocukqs);
1187    //return false;
1188
1189    //var book_url = 'https://rezervasyon.bera.com.tr/?language='+lingua_int+'&currency=TRY&Checkin='+iYEAR+'-'+iMONTH+'-'+iDAY+'&Checkout='+iYEAR_CHECK_OUT+'-'+iMONTH_CHECK_OUT+'-'+iDAY_CHECK_OUT+'&Adult='+$('.data-rez-adult').val()+'&Child='+$('.data-rez-child').val()+cocukqs;
1190    var book_url = 'https://www.bera.com.tr/reservation?language='+lingua_int+'&currency=TRY&Checkin='+iYEAR+'-'+iMONTH+'-'+iDAY+'&Checkout='+iYEAR_CHECK_OUT+'-'+iMONTH_CHECK_OUT+'-'+iDAY_CHECK_OUT+'&Adult='+$('.data-rez-adult').val()+'&Child='+$('.data-rez-child').val()+cocukqs;
1191
1192    if(hotelid == 23){
1193      //var book_url = 'https://konyarezervasyon.bera.com.tr/?language='+lingua_int+'&currency=TRY&Checkin='+iYEAR+'-'+iMONTH+'-'+iDAY+'&Checkout='+iYEAR_CHECK_OUT+'-'+iMONTH_CHECK_OUT+'-'+iDAY_CHECK_OUT+'&Adult='+$('.data-rez-adult').val()+'&Child='+$('.data-rez-child').val()+cocukqs;
1194      var book_url = 'https://www.bera.com.tr/reservationkonya?language='+lingua_int+'&currency=TRY&Checkin='+iYEAR+'-'+iMONTH+'-'+iDAY+'&Checkout='+iYEAR_CHECK_OUT+'-'+iMONTH_CHECK_OUT+'-'+iDAY_CHECK_OUT+'&Adult='+$('.data-rez-adult').val()+'&Child='+$('.data-rez-child').val()+cocukqs;
1195      
1196    }
1197    window.open(book_url, "_blank");
1198
1199  });
1200
1201  
1202  
1203  $('.rezblock .rezkisimodal').clickOutside(function(){
1204      $(this).removeClass('active');
1205      //$('.childages').removeClass('active');
1206      /*$(this).css('background','red')
1207      if($(this).hasClass('.childselect')){
1208        $(this).css('background','red')
1209      }*/
1210  });
1211  $(document).on('click','.rezblock .rcont .icol .snop .desc', function(e){
1212    $('.rezblock .rezkisimodal').addClass('active');
1213    
1214  });
1215
1216  var adultnum = 1;
1217  var childnum = 0;
1218  $(document).on('click','.rezblock .rcont .icol .snop .rezkisimodal .rkmcont .item.iadult .ival .xplus a', function(e){
1219    adultnum +=1;
1220    $('.data-rez-adult').val(adultnum);
1221    $('.rezblock .rcont .icol .snop .rezkisimodal .rkmcont .item.iadult .ival .xdisplay').text(adultnum);
1222  });
1223  $(document).on('click','.rezblock .rcont .icol .snop .rezkisimodal .rkmcont .item.iadult .ival .xmin a', function(e){
1224    if(adultnum > 1){
1225      adultnum -=1;
1226      $('.data-rez-adult').val(adultnum);
1227      $('.rezblock .rcont .icol .snop .rezkisimodal .rkmcont .item.iadult .ival .xdisplay').text(adultnum);
1228    }
1229  });
1230
1231
1232  var renderYas = function(){
1233    $('.childages').removeClass('active');
1234    $('.childages .cacon').html('');
1235    if(childnum>0){
1236      $('.childages').addClass('active');
1237      for (let index = 1; index <= childnum; index++) {
1238        $('.childages .cacon').append(`
1239          <div class="item">
1240            <div class="ilab">${index}. ${lang.rezcocukyasi}</div>
1241            <div class="ival">
1242              <select class="child-${index} childselect">
1243                <option value="0">0</option>
1244                <option value="1">1</option>
1245                <option value="2">2</option>
1246                <option value="3">3</option>
1247                <option value="4">4</option>
1248                <option value="5">5</option>
1249                <option value="6">6</option>
1250                <option value="7">7</option>
1251                <option value="8">8</option>
1252                <option value="9">9</option>
1253                <option value="10">10</option>
1254                <option value="11">11</option>
1255                <option value="12">12</option>
1256              </select>
1257            </div>
1258          </div>
1259        `)
1260      }
1261    }
1262  }
1263
1264  $(document).on('click','.rezblock .rcont .icol .snop .rezkisimodal .rkmcont .item.ichild .ival .xplus a', function(e){
1265    if(childnum < 6){
1266      childnum +=1;
1267      $('.data-rez-child').val(childnum);
1268      $('.rezblock .rcont .icol .snop .rezkisimodal .rkmcont .item.ichild .ival .xdisplay').text(childnum);
1269      renderYas();
1270    }
1271  });
1272  $(document).on('click','.rezblock .rcont .icol .snop .rezkisimodal .rkmcont .item.ichild .ival .xmin a', function(e){
1273    if(childnum > 0){
1274      childnum -=1;
1275      $('.data-rez-child').val(childnum);
1276      $('.rezblock .rcont .icol .snop .rezkisimodal .rkmcont .item.ichild .ival .xdisplay').text(childnum);
1277      renderYas();
1278    }
1279  });
1280
1281  
1282
1283  /*var dates = $("#check-in, #check-out").datepicker({
1284    defaultDate: "+2d",
1285    numberOfMonths: 1,
1286    minDate: new Date(),
1287    dateFormat: "dd-mm-yy",
1288    altFormat: "dd-mm-yy",
1289    monthNames: monthNames,
1290    dayNamesMin: dayNamesMin,
1291    beforeShow: function(input, inst) {
1292        setTimeout(function(){ $(inst.dpDiv).find('.ui-state-default').removeClass('ui-state-hover') });
1293    },
1294    onSelect: function(selectedDate, inst) {
1295        var option = this.id == "check-in" ? "minDate" : "maxDate",
1296        date = $.datepicker.parseDate(inst.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, inst.settings);
1297        dates.not(this).datepicker("option", option, date);
1298        //$(this).parent().find('h2').text( ((inst.selectedDay < 10) ? "0" : "" ) + inst.selectedDay );
1299        //$(this).parent().find('p').text( inst.settings.monthNames[ inst.selectedMonth ] );
1300
1301        $(this).parent().find('.dtgun').text( ((inst.selectedDay < 10) ? "0" : "" ) + inst.selectedDay );
1302        $(this).parent().find('.dtay').text( monthNamesn[ inst.selectedMonth ] );
1303        //console.log(inst.selectedMonth);
1304        if(this.id == 'check-in'){
1305            /*console.log(selectedDate+1);
1306            var today = new Date(selectedDate);
1307            console.log(today)*/
1308            /*var date2 = $('#check-in').datepicker('getDate', '+1d'); 
1309            date2.setDate(date2.getDate()+1);
1310            /*console.log(date2.getMonth());*/
1311            /*$('#check-out').datepicker('setDate', date2);
1312            $("#check-out").datepicker("option", "minDate", date2);
1313            $('#check-out').parent().find('h2').text(((date2.getDate() < 10) ? "0" : "" ) + date2.getDate());
1314            $('#check-out').parent().find('p').text(inst.settings.monthNames[ date2.getMonth() ]);
1315        }
1316
1317    }
1318
1319  });*/
1320
1321  $('.opcont .list').on('init', function(event, slick){
1322    $(".ophome .opcont .list .slick-dots").prependTo(".ophome .opcont .head .all");
1323  });
1324  $('.opcont .list').slick({
1325    lazyLoad: 'ondemand',
1326    dots: true,
1327    infinite: true,
1328    slidesToShow: 3,
1329    slidesToScroll: 2,
1330    swipe: false,
1331    speed: 1000,
1332    autoplay: true,
1333    pauseOnFocus: false,
1334    autoplaySpeed: 3000,
1335    responsive: [
1336      {
1337        breakpoint: 992,
1338        settings: {
1339          slidesToShow: 1,
1340          slidesToScroll: 1
1341        }
1342      },
1343    ]
1344  })
1345  
1346  
1347  
1348
1349  const respMediaQuery = window.matchMedia('(max-width: 992px)');
1350  respMediaQuery.addEventListener('change', (e) => {
1351    if (respMediaQuery.matches) { // 992den ufaks
1352      ufakResponsive();
1353    }else{
1354      buyukResponsive();
1355    }
1356  });
1357
1358  if (respMediaQuery.matches) { // 992den ufaks
1359    ufakResponsive();
1360  }else{
1361    buyukResponsive();
1362  }
1363
1364
1365  function ufakResponsive(){
1366    console.log('ufak reponsive');
1367    
1368    setTimeout(() => {
1369      //$(".ophome .opcont .list").append($(".ophome .opcont .head .slick-dots"));
1370    }, 100);
1371    $('.rezblock').not('.mrezblock').remove();
1372  }
1373  function buyukResponsive(){
1374    console.log('buyuk reponsive');
1375    setTimeout(() => {
1376      //$(".ophome .opcont .list .slick-dots").prependTo(".ophome .opcont .head .all");
1377    }, 100);
1378    
1379    $('.mrezblock').remove();
1380  }
1381
1382  
1383  $(document).on('click','.pcityd .catcon .clist .item a.cata',function(e){
1384
1385    $('.pcityd .catcon .clist .item a.cata').removeClass('active');
1386    $(this).addClass('active');
1387    var id = $(this).data('id');
1388    var sid = $(this).data('sid');
1389    $.ajax({
1390      type:'POST',
1391      url: base_url + 'Ajax/gPalcesFromCityList',
1392      data:{id,sid},
1393      success: function(res){
1394        //console.log(res);
1395        var gelen = JSON.parse(res);
1396        var myhtml = '';
1397        if(gelen.mekanlar){
1398          for (const item of gelen.mekanlar) {
1399            myhtml += `
1400              <div class="item">
1401                <a href="${item.link}" >
1402                  <div class="img"><img src="${item.img}" alt=""></div>
1403                  <div class="desc">
1404                    <div class="d1">${item.title}</div>
1405                    <div class="d2">
1406                      <div class="d2img"><img src="${item.img2}" alt=""></div>
1407                      <div class="d2d">${item.semt_ilce}</div>
1408                    </div>
1409                  </div>
1410                </a>
1411              </div>
1412            `;
1413          }
1414          if(!gelen.mekanlar.length){
1415            myhtml = `<div class="notfound">Sonuç bulunamadı</div>`;
1416          }
1417        }
1418        $('.placelist').html(myhtml);
1419      },
1420    })
1421  })
1422
1423
1424
1425  $(document).on('click','.hmap .hmcont .hmctrl .chotel a',function(e){
1426    if($('.hmap .hmcont .hmctrl .chotel .chlist').hasClass('active')){
1427      $('.hmap .hmcont .hmctrl .chotel .chlist').removeClass('active')
1428    }else{
1429      $('.hmap .hmcont .hmctrl .chotel .chlist').addClass('active')
1430    }
1431  });
1432
1433  $('.hmap .hmcont .hmctrl .chotel .chlist').clickOutside(function(){
1434    $(this).removeClass('active'); // or `$(this).hide()`, if you must
1435  });
1436
1437
1438  $(document).on('click','.pbu .pbur .pburc .pburselect .chotel > a',function(e){
1439    if($('.pbu .pbur .pburc .pburselect .chotel .chlist').hasClass('active')){
1440      $('.pbu .pbur .pburc .pburselect .chotel .chlist').removeClass('active')
1441    }else{
1442      $('.pbu .pbur .pburc .pburselect .chotel .chlist').addClass('active')
1443    }
1444  });
1445  $('.pbu .pbur .pburc .pburselect .chotel .chlist').clickOutside(function(){
1446    $(this).removeClass('active'); // or `$(this).hide()`, if you must
1447  });
1448
1449
1450  $(window).on("scroll touchmove", function () {
1451    $('.header').toggleClass('fixed', $(document).scrollTop() >50);
1452    $(window).trigger('resize');
1453  });
1454
1455  $(window).trigger('scroll');
1456
1457  
1458  $(document).on('click','.removeRouteBtnOLDREMOVED',function(){
1459    //var id = $(this).data('id');
1460    var myindex = $(this).closest('.item').index();
1461    
1462    $.ajax({
1463      type: 'POST',
1464      url: base_url + 'Ajax/removeFromCartMekan',
1465      data:{myindex},
1466      success:function(res){
1467        //console.log(res)
1468        var gelen = JSON.parse(res);
1469        //$('.routeLocationHeader .icon').html(gelen.toplamMekan)
1470        //$('.routeLocationHeader .cartDisplay').html(gelen.toplamMekan)
1471        $('.hrcounter').html(gelen.toplamMekan);
1472        if(gelen.toplamMekan>0){$('.hrcounter').addClass('active');}else{$('.hrcounter').removeClass('active');}
1473        Swal.fire({
1474          //title: 'Dedeman',
1475          text: "Mekan listeniz güncellenmiştir.",
1476          icon: 'success',
1477          timer: 2000,
1478          //confirmButtonText: 'Tamam'
1479        });
1480
1481        $('.hCartWrap').addClass('active');
1482        $('.hCartWrap .hclist').html('');
1483        var itemstr = '';
1484        console.log(gelen);
1485        if(gelen.mekanlar){
1486          for (const item of gelen.mekanlar) {
1487            itemstr += `
1488              <div class="item">                        
1489                <div class="iimg"><img src="${item.mekan.img}" alt=""></div>
1490                <div class="idesc">
1491                  <div class="top">${item.mekan.title}</div>
1492                  <div class="bottom">
1493                    <div class="icon"><img src="${item.mekan.img2}" alt=""></div>
1494                    <div class="btdes">${item.mekan.semt_ilce}</div>
1495                  </div>
1496                </div>
1497                <div class="icons">
1498                  <a href="javascript:;" class="removeRouteBtn" data-id="${item.mekan.id}"><i class="far fa-times-circle"></i></a>
1499                  <a href="${item.mekan.link}"><img src="${item.mekan.img3}" alt=""></a>
1500                </div>                          
1501              </div>
1502            `;
1503            
1504          }
1505        }
1506        $('.hCartWrap .hclist').html(itemstr);
1507
1508
1509      }
1510    })
1511  });
1512
1513  function removeMekanById(kontrolEdilecekId, callback){
1514    for (var i = 0; i < mekanData.length; i++) {
1515      //console.log(arr[i]['id']);
1516      if(mekanData[i]['id'] == kontrolEdilecekId){
1517        mekanData.splice(i, 1);
1518        break;
1519      }
1520    }
1521    callback();
1522  }
1523  $(document).on('click','.removeRouteBtn',function(){
1524    var id = $(this).data('id');
1525    var myindex = $(this).closest('.item').index();
1526    
1527    //console.log(mekanData);
1528    removeMekanById(id, function(){
1529      //console.log("silindi");
1530      //console.log(mekanData);
1531      //renderAddedMekanList();
1532      renderHeaderMekanList();
1533      //$('.rotaMekanListesi .newRotaListCol a[data-id="'+id+'"]').removeClass('active');
1534      $('.crou .crcon .crobc .crol .placelist .item a.crAddRoute[data-id="'+id+'"]').removeClass('active');
1535      $('.crou .crcon .crobc .crol .placelist .item a.crAddRoute[data-id="'+id+'"]').text('+');
1536
1537      $(this).addClass('active');
1538      //mekan detay
1539      $('.addRouteButton').removeClass('active');
1540      $('.addRouteButton').html(`
1541        <div class="img"><i class="fa fa-plus-circle"></i></div>
1542        <div class="desc">ROTAMA EKLE</div>
1543      `);
1544
1545
1546      localStorage.setItem('mekanData', JSON.stringify(mekanData));
1547    });
1548
1549   
1550  });
1551
1552  $(document).on('click','.header .hcont .hright  .hroute .btncont > a',function(){
1553    if($('.header .hcont .hright  .hroute .btncont .hCartWrap').hasClass('active')){
1554      $('.header .hcont .hright  .hroute .btncont .hCartWrap').removeClass('active')
1555    }else{
1556      $('.header .hcont .hright  .hroute .btncont .hCartWrap').addClass('active')
1557    }
1558  });
1559  $('.header .hcont .hright  .hroute .btncont .hCartWrap').clickOutside(function(){
1560    $(this).removeClass('active'); // or `$(this).hide()`, if you must
1561  });
1562
1563  
1564  
1565  $(document).on('click','.addRouteButton',function(){
1566    /*var id = $(this).data('id');
1567    var tur = 'mekan';
1568    
1569    $.ajax({
1570      type: 'POST',
1571      url: base_url + 'Ajax/addToCartMekan',
1572      data:{mekanId:id,tur:tur},
1573      success:function(res){
1574        //console.log(res)
1575        var gelen = JSON.parse(res);
1576        //$('.routeLocationHeader .icon').html(gelen.toplamMekan)
1577        //$('.routeLocationHeader .cartDisplay').html(gelen.toplamMekan)
1578        $('.hrcounter').html(gelen.toplamMekan);
1579        if(gelen.toplamMekan>0){$('.hrcounter').addClass('active');}else{$('.hrcounter').removeClass('active');}
1580        Swal.fire({
1581          title: 'Dedeman',
1582          text: "Mekan listenize eklenmiştir.",
1583          icon: 'success',
1584          timer: 2000,
1585          //confirmButtonText: 'Tamam'
1586        });
1587
1588
1589        $('.hCartWrap').addClass('active');
1590        $('.hCartWrap .hclist').html('');
1591        var itemstr = '';
1592        console.log(gelen);
1593        if(gelen.mekanlar){
1594          for (const item of gelen.mekanlar) {
1595            itemstr += `
1596              <div class="item">                        
1597                <div class="iimg"><img src="${item.mekan.img}" alt=""></div>
1598                <div class="idesc">
1599                  <div class="top">${item.mekan.title}</div>
1600                  <div class="bottom">
1601                    <div class="icon"><img src="${item.mekan.img2}" alt=""></div>
1602                    <div class="btdes">${item.mekan.semt_ilce}</div>
1603                  </div>
1604                </div>
1605                <div class="icons">
1606                  <a href="javascript:;" class="removeRouteBtn" data-id="${item.mekan.id}"><i class="far fa-times-circle"></i></a>
1607                  <a href="${item.mekan.link}"><img src="${item.mekan.img3}" alt=""></a>
1608                </div>                          
1609              </div>
1610            `;
1611            
1612          }
1613        }
1614        $('.hCartWrap .hclist').html(itemstr);
1615
1616      }
1617    })*/
1618  })
1619
1620
1621  $(document).on('click','.pctrl .item.ishare a',function(e){
1622    
1623    if($('.pctrl .slist').hasClass('active')){
1624      $('.pctrl .slist').removeClass('active');
1625    }else{
1626      $('.pctrl .slist').addClass('active');
1627    }
1628
1629  });
1630  $('.pctrl .slist').clickOutside(function(){
1631    $(this).removeClass('active'); // or `$(this).hide()`, if you must
1632  });
1633
1634  $(document).on('click','.pctrl .btnPrint',function(e){
1635    window.print();
1636  });
1637  var fsize = 14;
1638  $(document).on('click','.pctrl .btnTSmall',function(e){
1639    console.log("font- : "+ fsize);
1640    fsize -= 0.3;
1641    $('.pntex *').css('font-size',fsize+'px');
1642  });
1643  
1644  
1645  $(document).on('click','.pctrl .btnTBig',function(e){
1646    con
1646sole.log("font22- : "+ fsize);
1647    fsize += 0.3;
1648    $('.pntex *').css('font-size',fsize+'px');
1649  });
1650
1651  $(document).on('click','a.langbtn',function(e){
1652    var id = $(this).data('id');
1653    var lid = $(this).data('lid');
1654    var code = $(this).data('code');
1655    var mtd = $(this).data('mtd');
1656
1657    $.ajax({
1658      type:'POST',
1659      url: base_url + 'Ajax/gslug',
1660      data:{id,code,lid,mtd},
1661      success: function(res){
1662        //console.log(res);
1663        let gelen = JSON.parse(res);
1664        //console.log(gelen);
1665        //console.log(code);
1666        
1667        let link = base_url + '' + code +'/'+ gelen.page.slug;
1668        //console.log(link);
1669        /*if(id == 1){
1670          link = base_url + code;
1671        }*/
1672        
1673        if(code == 'tr'){
1674          link = base_url + gelen.page.slug;
1675        }
1676        if(id == 1){
1677          link = base_url + code;
1678          if(code == 'tr'){
1679            link = base_url;
1680          }
1681        }
1682        
1683        location = link;
1684      }
1685    });
1686    
1687  });
1688
1689
1690  /*$(document).on('click','.header .cont .hconts .hlang > a',function(e){
1691    $('.header .cont .hconts .hlang').addClass('active');
1692  });
1693  $('.header .cont .hconts .hlang').clickOutside(function(){
1694    $(this).removeClass('active');
1695  });
1696  $(document).on('click','.hlang .list a',function(e){
1697    var id = $(this).data('id');
1698    var lid = $(this).data('lid');
1699    var code = $(this).data('code');
1700    var mtd = $(this).data('mtd');
1701
1702    $.ajax({
1703      type:'POST',
1704      url: base_url + 'Ajax/gslug',
1705      data:{id,code,lid,mtd},
1706      success: function(res){
1707        //console.log(res);
1708        let gelen = JSON.parse(res);
1709        //console.log(gelen);
1710        //console.log(code);
1711        let link = base_url + '' + code +'/'+ gelen.page.slug;
1712        //console.log(link);
1713        if(id == 1){
1714          link = base_url + code;
1715        }
1716        if(code == 'tr' && id == 1){
1717          link = base_url;
1718        }
1719        location = link;
1720      }
1721    });
1722    
1723  });
1724  */
1725
1726  
1727
1728  $(document).on('click','.header .hcont .hright .hmbtn a',function(e){
1729    $('.mnav').addClass('active');
1730  });
1731  $('.mnav').clickOutside(function(){
1732    $(this).removeClass('active');
1733  });
1734
1735
1736  /*$(document).on('click','.mnav .malt .hlang > a',function(e){
1737    $('.mnav .malt .hlang .list').addClass('active');
1738  });
1739  
1740  $('.mnav .malt .hlang .list').clickOutside(function(){
1741    $(this).removeClass('active');
1742  });*/
1743
1744
1745
1746  
1747  $(document).on('click','.mrezbtn a',function(e){
1748    $('.mrezblock').addClass('active');
1749  });
1750  $(document).on('click','.rezblock .rcont .closebtn',function(e){
1751    $('.mrezblock').removeClass('active');
1752  });
1753  
1754  
1755
1756
1757  $(document).on('click','.mob-menu-btn a',function(e){
1758    $('.page-menu').addClass('active');
1759  });
1760  $('.page-menu').clickOutside(function(){
1761    $(this).removeClass('active');
1762  });
1763
1764
1765  $(document).on('click','.pnormal .pncont .pntop .list .pMenuMobileCloseBtn',function(e){
1766    $('.pnormal .pncont .pntop .list').removeClass('active');
1767  });
1768
1769
1770  
1771
1772
1773  $('.lazy').lazy();
1774
1775  var popupVarmi = localStorage.getItem('popupOk');
1776 
1777  if(popupVarmi != 1){
1778
1779    if(is_home == 1){
1780      $.ajax({
1781        type:'POST',
1782        url: base_url + 'Ajax/popupGetir',
1783        data: {},
1784        success: function(res){
1785          if(res){
1786            var gelen = JSON.parse(res);
1787            console.log(gelen.popup)
1788            if(gelen.popup.length){
1789              $('.modal-popup').addClass('active')
1790              baslaPopup(gelen.popup)
1791
1792              localStorage.setItem('popupOk', 1);
1793            }
1794          }
1795        },
1796        error: function(res){
1797          console.log(res);
1798        }
1799      })
1800    }
1801
1802  }
1803
1804  var popupSuruyormu = 1;
1805
1806  async function baslaPopup(popupArr){
1807    for (var i = 0; i < popupArr.length; i++) {
1808      if(popupSuruyormu == 1){
1809        await nextPopup(i, popupArr[i])
1810      }
1811    }
1812  }
1813  //baslaPopup();
1814
1815  function nextPopup(i, popup){
1816    return new Promise(function(resolve, reject){
1817
1818      /*setTimeout(function(){
1819        console.log(i + " bitti");
1820        resolve();
1821      },1000)*/
1822
1823      $('.modal-popup .popup-icerik').html(popup.text);
1824      $('.modal-popup').addClass('active');
1825      var counter = popup.sure;
1826      var interval = setInterval(function() {
1827          counter--;
1828          $('.modal-popup .kapat-cont .timer').text(counter);
1829          // Display 'counter' wherever you want to display it.
1830          if (counter == 0) {
1831              // Display a login box
1832              resolve();
1833              clearInterval(interval);
1834              $('.modal-popup').removeClass('active');
1835          }
1836      }, 1000);
1837
1838
1839
1840    })
1841  }
1842  
1843  $(document).on('click', '.close-search', function (e) {
1844    $('.modal-popup').removeClass('active');
1845    popupSuruyormu = 2;
1846  });
1847  
1848
1849  $('.fancyboxgal').fancybox({
1850    idleTime: false,
1851    beforeShow : function(instance, current) {
1852      $('.fancybox-infobar').remove();
1853      $('.fancybox-toolbar').remove();
1854      $('.fancybox-navigation').remove();
1855    },
1856    afterShow : function(instance, current) {
1857      //console.log(instance);
1858      //console.log(current);
1859      var toplam = $('.galeri-detay .gcon .item').length;
1860      //console.log(toplam);
1861      //console.log(current.index);
1862      $('.fancybox-content .photoInfo').remove();
1863      $('.fancybox-content a').remove();
1864      var str = `
1865        <div class="photoInfo">
1866          <div class="solbaslik">${$('.fancybox-caption__body').text()}</div>
1867          <div class="text">
1868            ${(current.index+1)} / ${toplam} ${lang.galerifotograf}
1869          </div>
1870          <div class="closebtn">
1871            <a href="javascript:;">${lang.galerikapat} X</a>
1872          </div>
1873        </div>
1874      `;
1875      $('.fancybox-content').append(str);
1876
1877      $('.fancybox-content').append(`<a href="javascript:;" class="left-btn"><img src="${base_url}assets/img/galeri-sol.png" /></a>`);
1878      $('.fancybox-content').append(`<a href="javascript:;" class="right-btn"><img src="${base_url}assets/img/galeri-sag.png" /></a>`);
1879  
1880    }
1881  });
1882
1883  $(document).on('click','.fancybox-stage .fancybox-content .photoInfo .closebtn a',function(){
1884    jQuery.fancybox.getInstance().close();
1885  });
1886
1887  $(document).on('click','.fancybox-stage .fancybox-content .left-btn',function(){
1888    jQuery.fancybox.getInstance().previous();
1889  });
1890  $(document).on('click','.fancybox-stage .fancybox-content .right-btn',function(){
1891    jQuery.fancybox.getInstance().next();
1892  });
1893  
1894  $(document).on('click','.btnHProfile',function(){
1895    if($('.hmember-modal').hasClass('active')){
1896      $('.hmember-modal').removeClass('active');
1897    }else{
1898      $('.hmember-modal').addClass('active');
1899    }
1900    
1901  });
1902  $('.hmember-modal,.btnHProfile').clickOutside(function(){
1903    $(this).removeClass('active');
1904  });
1905
1906  var lock = 0;
1907  var formHata = 1;
1908  $(document).on('submit', '.formLogin', function (e) {
1909    e.preventDefault();
1910    if (lock == 1) return false;
1911    lock = 1;
1912    
1913    var myform = $(this);
1914    var mybtn = $(this).find('button');
1915    var btnDefaultText = mybtn.text();
1916
1917
1918    formHata = 0;
1919    if (formHata == 0) {
1920      mybtn.text('Lütfen Bekleyiniz...');
1921      var fdata = $(this).serialize();
1922      //console.log(fdata);
1923      $.ajax({
1924        url: base_url + 'Ajax/form_login',
1925        type: "POST",
1926        data: { fdata: fdata },
1927        success: function (res) {
1928          /*console.log(res);
1929          lock = 0;
1930          formHata = 1;
1931          mybtn.text(btnDefaultText);
1932          return false;*/
1933          
1934          var cevap = JSON.parse(res);
1935          if (cevap.result != 'ok') {
1936            //alert('Hata: '+cevap.sonucAciklama);
1937            
1938            Swal.fire({
1939                title: 'Hata!',
1940                text: cevap.rtext,
1941                icon: 'error',
1942            });
1943            lock = 0;
1944            formHata = 1;
1945            mybtn.text(btnDefaultText);
1946            
1947          }
1948          
1949          if (cevap.result == 'ok') {
1950            //alert('Mesajınız iletilmiştir. Yönlendiriliyorsunuz...');
1951           
1952            Swal.fire({
1953                title: 'Giriş Başarılı',
1954                text: 'Yönlendiriliyorsunuz...',
1955                icon: 'success',
1956            });
1957
1958
1959            var ct = setTimeout(function () {
1960              location = base_url + "profil";
1961              //location.reload();
1962            }, 2000);
1963          }
1964          console.log(cevap);
1965          console.log('save ok');
1966
1967        },
1968        error: function (res) {
1969          console.log(res);
1970          lock = 0;
1971          formHata = 1;
1972          mybtn.text(btnDefaultText);
1973          return false;
1974          //alert('Bir Hata Oluştu. Yönlendiriliyorsunuz...');
1975          var ct = setTimeout(function () {
1976            //location = base_url + "";
1977          }, 2000);
1978
1979        }
1980      })
1981
1982    }
1983
1984  });
1985
1986  /*var cookieOnay = localStorage.getItem("cookieOnay");
1987  if(!cookieOnay){
1988    $('.ckswa').addClass('active');
1989  }
1990  $(document).on('click','.ckswa .con .ibtn a.btnCksWa', function(e){
1991   
1992    $('.ckswa').removeClass('active');
1993    localStorage.setItem("cookieOnay",1);
1994  })*/
1995  
1996  var headerTickStatus = 0;
1997  var headerPhoneTick = function(){
1998    setTimeout(function(){
1999
2000      $('.header .hcont .hright .hmenu .htop a.header-phone span').removeClass('active');
2001
2002      if(headerTickStatus == 0){
2003        headerTickStatus = 1;
2004        $('.header .hcont .hright .hmenu .htop a.header-phone span.header-blink-desc').addClass('active');
2005      }else if(headerTickStatus == 1){
2006        headerTickStatus = 0;
2007        $('.header .hcont .hright .hmenu .htop a.header-phone span.header-blink-phone').addClass('active');
2008      }
2009      //console.log(headerTickStatus);
2010      headerPhoneTick();
2011    },2000);
2012  }
2013  headerPhoneTick();
2014
2015
2016
2017
2018
2019  $(document).on('click','.cookie-btn a',function(e){
2020    $('.cmod1').addClass('active');
2021  });
2022  $(document).on('click','.cmod1 .ccon .btn-close',function(e){
2023    $('.cmod1').removeClass('active');
2024  });
2025  $(document).on('click','.cmod1 .ccon .btn-save a',function(e){
2026    $('.cmod1').removeClass('active');
2027  });
2028  $(document).on('click','.cmod1 .ccon .btn-save-ek a.btn-accept',function(e){
2029    $('.cmod1').removeClass('active');
2030    localStorage.setItem('cookieizin', 'yes');
2031    localStorage.setItem('cerez_ekrani', 'no');
2032    $('.chk_performance').prop('checked',true);
2033  });
2034  $(document).on('click','.cmod1 .ccon .btn-save-ek a.btn-reject',function(e){
2035    $('.cmod1').removeClass('active');
2036    localStorage.setItem('cookieizin', 'no');
2037    localStorage.setItem('cerez_ekrani', 'no');
2038    $('.chk_performance').prop('checked',false);
2039    //document.cookie = '_ga_WNTJ1WE9C7=; Path=/; Domain=.bera.com.tr; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
2040    /*var gaCookies = ["_ga", "_gid", "_gat"];
2041
2042    // Her bir çerezi kontrol et ve sil
2043    gaCookies.forEach(function(cookieName) {
2044        document.cookie = cookieName + "=; Domain=.bera.com.tr; expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/";
2045    });*/
2046
2047    setInterval(function(){
2048      deleteCookiesStartingWith("_ga");
2049    },2000);
2050
2051  });
2052  $(document).on('click','.cmod1 .ccon .btn-save-ek a.btn-settings',function(e){
2053    $('.cmod1').removeClass('active');
2054    $('.cmod2').addClass('active');
2055  });
2056  $(document).on('click','.cmod1 .ccon .btn-reject a',function(e){
2057    $('.cmod1').removeClass('active');
2058  
2059  });
2060
2061  $(document).on('click','.cmod2 .cmcon .con .tab-area .tcon .tpage .tpitem .tpbtn a',function(e){
2062    if($(this).closest('.tpitem').hasClass('active')){
2063      $(this).closest('.tpitem').removeClass('active');
2064    }else{
2065      $(this).closest('.tpitem').addClass('active');
2066    }
2067  });
2068  $(document).on('click','.cmod2 .cmcon .con .tab-area .thead .item a',function(e){
2069    $('.cmod2 .cmcon .con .tab-area .thead .item').removeClass('active');
2070    $(this).parent().addClass('active');
2071    var myindex = $(this).parent().index();
2072    $('.cmod2 .cmcon .con .tab-area .tcon .tpage').removeClass('active');
2073    $('.cmod2 .cmcon .con .tab-area .tcon .tpage').eq(myindex).addClass('active');
2074  });
2075  $(document).on('click','.cmod2 .cmcon .chead .btn-close a',function(e){
2076    $('.cmod2').removeClass('active');
2077  });
2078  
2079  $(document).on('click','.cmod1 .ccon .btn-settings a',function(e){
2080    $('.cmod1').removeClass('active');
2081    $('.cmod2').addClass('active');
2082  });
2083  $(document).on('click','.cmod2 .cmcon .cfooter a',function(e){
2084    $('.cmod2').removeClass('active');
2085  });
2086
2087})  
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104

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.