/*
Author: Vladimir Kharlampidi, The iDangero.us
*/
document.createElement('header');
document.createElement('footer');

$(function(){
	//Movies App
	var swiperMovies = $('.mc-posters').swiper({
		mode : "horizontal", 
		onlyExternal : true,
		speed:10
	});
	var allowMovieClick = true;
	var swiperMControl = $('.mc-control').swiper({
		mode : "horizontal", 
		scrollContainer:true,
		onTouchMove : function(){
			allowMovieClick = false	;
		},
		onTouchEnd : function() {
			setTimeout(function(){allowMovieClick = true},100);
		}
	});
	$('.mc-control img').bind('mousedown',function(e){
		e.preventDefault();
	});
	$('.mc-control img').bind('click',function(e){
		e.preventDefault();
		if (!allowMovieClick) return;
		var index = $(this).index();
		swiperMovies.swipeTo(index);
		$('.mc-control .active').removeClass('active');
		$(this).addClass('active');
		var selTel = $(this).attr("etel");
		$("a#telLink").text(selTel);
		$("a#telLink").attr("href", "tel:" + selTel);
	});

	swiperDyn.removeSlide(1);
});

//Partial Slides
$('.swiper-partial').swiper({
	slidesPerSlide:'auto'
});

//Threshold
$('.swiper-threshold').swiper({
	moveStartThreshold:100
});
