$(".galeri").css({"height":$(".galeri").css("width")});

$(function(){
	var $gallery = $('.gallery a').simpleLightbox();

	$gallery.on('show.simplelightbox', function(){
		console.log('Requested for showing');
	})
	.on('shown.simplelightbox', function(){
		console.log('Shown');
	})
	.on('close.simplelightbox', function(){
		console.log('Requested for closing');
	})
	.on('closed.simplelightbox', function(){
		console.log('Closed');
	})
	.on('change.simplelightbox', function(){
		console.log('Requested for change');
	})
	.on('next.simplelightbox', function(){
		console.log('Requested for next');
	})
	.on('prev.simplelightbox', function(){
		console.log('Requested for prev');
	})
	.on('nextImageLoaded.simplelightbox', function(){
		console.log('Next image loaded');
	})
	.on('prevImageLoaded.simplelightbox', function(){
		console.log('Prev image loaded');
	})
	.on('changed.simplelightbox', function(){
		console.log('Image changed');
	})
	.on('nextDone.simplelightbox', function(){
		console.log('Image changed to next');
	})
	.on('prevDone.simplelightbox', function(){
		console.log('Image changed to prev');
	})
	.on('error.simplelightbox', function(e){
		console.log('No image found, go to the next/prev');
		console.log(e);
	});
});

var swiper = new Swiper('.slider', {
    spaceBetween: 0,
    pagination: {
      el: '.slider-pagination',
      clickable: true,
    },
	loop: true,
    autoplay: {
        delay: 400000000,
		disableOnInteraction: false,
    },
  });
  var swiper = new Swiper('.mobilslider', {
    spaceBetween: 0,
    pagination: {
      el: '.mobilslider-pagination',
      clickable: true,
    },
	loop: true,
    autoplay: {
        delay: 4000,
		disableOnInteraction: false,
    },
  });
  var haberler = new Swiper('.haberler', {
	slidesPerView:2,
	spaceBetween:30,
	paginationClickable: true,
	centeredSlides: false,
	loop: true,
    autoplay: {
        delay: 4000,
		disableOnInteraction: false,
    },
	autoplayDisableOnInteraction: true,
    pagination: {
		el: '.haberler-pagination',
		clickable: true,
	  },
	  loop: true,
	 	breakpoints: {
			1200: {
  			slidesPerView:2,
		},
		800: {
  			slidesPerView: 2,
		},
		600: {
			slidesPerView:1,
	  	}
  	}
});
var kampanyalar = new Swiper('.kampanyalar', {
	slidesPerView:3,
	spaceBetween:30,
	paginationClickable: true,
	centeredSlides: false,
	loop: true,
    autoplay: {
        delay: 4000,
		disableOnInteraction: false,
    },
	autoplayDisableOnInteraction: true,
    pagination: {
		el: '.kampanyalar-pagination',
		clickable: true,
	  },
	  loop: true,
	 	breakpoints: {
			1200: {
  			slidesPerView: 3,
		},
		800: {
  			slidesPerView: 2,
		},
		600: {
			slidesPerView:1,
	  	}
  	}
});
var referanslar = new Swiper('.referanslar', {
	slidesPerView:6,
	spaceBetween:30,
	paginationClickable: true,
	centeredSlides: false,
	loop: true,
    autoplay: {
        delay: 4000,
		disableOnInteraction: false,
    },
	autoplayDisableOnInteraction: true,
	  loop: true,
	 	breakpoints: {
			1200: {
  			slidesPerView:5,
		},
		800: {
  			slidesPerView:4,
		},
		600: {
			slidesPerView:3,
	  	}
  	}
});
var bayilikler = new Swiper('.bayilikler', {
	slidesPerView:4,
	spaceBetween:30,
	paginationClickable: true,
	centeredSlides: false,
	 	breakpoints: {
			1200: {
  			slidesPerView:4,
		},
		800: {
  			slidesPerView: 2,
		},
		600: {
			slidesPerView:1,
	  	}
  	}
});











var swiperhizmet = new Swiper('.hizmetler-icerik', {
	pagination: {
	  el: '.hizmetler-pagination',
	  clickable:'false',
	  hideOnClick:'false',
	},
	  spaceBetween: 0,
	  autoplay: {
		  delay: 5000,
	  },
  });
  
  var swiperNusha = new Swiper('.hizmetler-resim', {
	  spaceBetween: 0
  });
  
  swiperNusha.on('slideChange', function () {
	  swiperhizmet.slideTo(swiperNusha.activeIndex, 300, false);
  });
	  
  swiperhizmet.on('slideChange', function () {
	  swiperNusha.slideTo(swiperhizmet.activeIndex, 300, false);
  });

$(document).ready(function () {
	$("#popupkapat").click(function () {
		$(".ortu2").trigger("click");
	});
	
	$(".ortu2").click(function () {
		$(".ortu2").hide();
		$(".popup").hide();
		$(".popup").slideUp(200, function(){
			$(".ortu2").slideUp();
		});
		$("#video").removeAttr("src");
	});


	$(".videoac").click(function(){
		$(".ortu2").slideDown(200, function(){
			$(".popup").slideDown();
		});
	
	
		$("#video").attr("src", $(this).attr("yol"));
		//$("#popupbaslik").text($(this).attr("bas")).show();
	});

	
	
	
});
$(document).ready(function () {
	$("#tikla").click(function () {
		$(".resport").css("display", "block");
		$(".respmen").css("display", "block");
		$(".respmen").animate({ left: '0px' });

	});
	$("#tikla1").click(function () {
		$(".resport").css("display", "none");
		$(".respmen").animate({ left: '-75%' });
	});

	$(window).scroll(function () {
		if ($(document).scrollTop() > 99) {
			$(".mobmen").css("position","fixed");
		} else {
			$(".mobmen").css("position", "relative");
		}
	});
   var a = 0;
   $("#arrowclk").click(function (){
	   if (a == 0) {
			$("#listslidde").slideDown();
			$("#arrowclk").css({ "transform": "rotate(180deg)" });
			a++;
		}
		else if (a == 1) {
			$("#listslidde").slideUp();
			$("#arrowclk").css({ "transform": "rotate(0deg)" });
			a = 0;

		}
	   
	   });



   $("#mobmen1").click(function (){
	   if (a == 0) {
			$("#mobmenac1").slideDown();
			a++;
		}
		else if (a == 1) {
			$("#mobmenac1").slideUp();
			a = 0;

		}
	   
	   });
   $("#mobmen2").click(function (){
	   if (a == 0) {
			$("#mobmenac2").slideDown();
			a++;
		}
		else if (a == 1) {
			$("#mobmenac2").slideUp();
			a = 0;

		}
	   
	   });









	   
});	
/*
const list = document.querySelectorAll('.list');

function accordion(e){
    e.stopPropagation(); 
    if(this.classList.contains('active')){
        this.classList.remove('active');
    }
    else if(this.parentElement.parentElement.classList.contains('active')){
        this.classList.add('active');
    }
    else{
        for(i=0; i < list.length; i++){
          list[i].classList.remove('active');
        }
            this.classList.add('active');
        }
}
for(i = 0; i < list.length; i++ ){
    list[i].addEventListener('click', accordion);
}
*/

/*
$(".solmenu>li").click(function(){
	$(this).find("ul").eq(0).slideDown();
});
$(".list").click(function(){
	
	$(this).find("ul.items").eq(0).slideDown()
});
*/

var yol = window.location.href;
var secili = $(".solmenu").find("a[href='" + yol +"']").closest("ul.items");
var secilia = $(".solmenu").find("a[href='" + yol +"']");
$(secilia).addClass("aktif");
$("ul.items").each(function(i){
	if($(this).find(secilia).length == 1){
		$(this).show();
		$(this).show();
		
		
	}
});
$(secilia).closest("li.list").find("ul.items").eq(0).show();

/*$(".menuac").click(function(event){
	event.stopPropagation();
	$(this).toggleClass("active");
	$(".items").toggleClass("active");
});*/





function shareFacebook() { window.open('https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(window.location.href), '', 'left=0,top=0,width=550,height=450,personalbar=0,toolbar=0,scrollbars=0,resizable=0'); }
function shareTwitter() { window.open('https://twitter.com/share?url=' + encodeURIComponent(window.location.href) + '&text=' + document.title, '', 'left=0,top=0,width=550,height=450,personalbar=0,toolbar=0,scrollbars=0,resizable=0'); }
function shareLinkedin() { window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(window.location.href) + '&title=' + document.title, '', 'left=0,top=0,width=650,height=420,personalbar=0,toolbar=0,scrollbars=0,resizable=0'); }
function shareWhatsApp() { window.open('https://api.whatsapp.com/send?text="' + document.title + '" ' + window.location.href + '', '', 'left=0,top=0,width=550,height=450,personalbar=0,toolbar=0,scrollbars=0,resizable=0'); }
