// JavaScript Document

if ( (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/Android/i)) || (navigator.userAgent.match(/Windows Phone/i))|| (navigator.userAgent.match(/blackberry/i))) { 
		if (document.cookie.indexOf("iphone_redirect=false") == -1) window.location = "http://www.hoteleurope.mobi/"; 
	}
	
$(document).ready(function() {
						
	$('#Nivoslider').nivoSlider({
		effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
		slices:45,
		animSpeed:500,
		pauseTime:8000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:true, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
		controlNavThumbsFromRel:false, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:true, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false //Force manual transitions
	});
	
	$('.ajax').live('click', function(){
		$(".ajax-loading").stop(true, true).fadeIn();
		$('ul[rel=ulchambre]').removeClass().addClass($(this).attr('class'));
		$.get($(this).attr('rel'),{},function(data){
			$('.contenuchambres').empty().append(data);
			$(".ajax-loading").stop(true, true).fadeOut();
		});
		return false;
	});

	$("a[rel=galerie]").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'titlePosition' 	: 'over'
	});
	
	$("a[rel=carte]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none'
	});
	
	$("a[rel=googlemaps]").fancybox({
		'width'				: '75%',
		'height'			: '75%',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});

});
