/*
	Author: Alexander Albrecht alexanderalbrecht.ch
	Client: GUTDEUBELBEISS gutdeubelbeiss.ch
	© 2011–2012

	Scripts
	– Hide URL bar on iPhone
	– Flexslider
	Version 1.0
	09.12.2011
*/

/* Hide URL bar on iPhone */
if (navigator.userAgent.indexOf('iPhone') != -1) {
	addEventListener("load", function() {
		setTimeout(hideURLbar, 0);
	}, false);
}
function hideURLbar() {
	window.scrollTo(0, 1);
}

/* Flexslider */
$('.flexslider').flexslider({
	animation: "fade",              //String: Select your animation type, "fade" or "slide"
	slideshow: false,               //Boolean: Animate slider automatically
	slideshowSpeed: 7000,           //Integer: Set the speed of the slideshow cycling, in milliseconds
	animationDuration: 350,         //Integer: Set the speed of animations, in milliseconds
	directionNav: true,             //Boolean: Create navigation for previous/next navigation? (true/false)
	controlNav: false,              //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
	keyboardNav: true,              //Boolean: Allow slider navigating via keyboard left/right keys
	prevText: "Zurück",             //String: Set the text for the "previous" directionNav item
	nextText: "Vor",                //String: Set the text for the "next" directionNav item
	animationLoop: true,            //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
	pauseOnAction: true,            //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
	pauseOnHover: true,             //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
	start: function(slider) {
		$('.total-slides').text(slider.count);
		$('.current-slide').text(slider.currentSlide + 1);
	},
	after: function(slider) {
		$('.current-slide').text(slider.currentSlide + 1);
	}
});

/* Flexslider */
$('.flexslider-index').flexslider({
	animation: "fade",              //String: Select your animation type, "fade" or "slide"
	slideshow: true,                //Boolean: Animate slider automatically
	slideshowSpeed: 4500,           //Integer: Set the speed of the slideshow cycling, in milliseconds
	animationDuration: 350,         //Integer: Set the speed of animations, in milliseconds
	directionNav: false,            //Boolean: Create navigation for previous/next navigation? (true/false)
	controlNav: false,              //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
	keyboardNav: true,              //Boolean: Allow slider navigating via keyboard left/right keys
	randomize: true,                //Boolean: Randomize slide order
	animationLoop: true,            //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
	pauseOnHover: false              //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
});
