$(document).ready(function(){
    $(function() {
            $("img").bind("contextmenu", function(e) {
                e.preventDefault();
            });
        }); 
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
    
    $(".thumbnail").bind('touchstart', function(){
	   $(this).css({'z-index' : '999', 'position' : 'absolute'});


	$(this).addClass("hover").stop()
		.animate({
			height: '600px',

		}, 200);
	
	} , function() {
	$(this).css({'z-index' : '0', 'position' : 'static'});
	$(this).removeClass("hover").stop()
		.animate({
			marginTop: '0', 
			marginLeft: '0',
			height: '200px',

		}, 400);
    });
    $("ul#mycarousel li img").bind('touchstart', function(){
    	 $("ul#mycarousel li a").click(function(event) {
  				event.preventDefault();
  		});
    	addMarker($(this).data('lat'),$(this).data('long'));
        newImage = '<li style="margin:0px;padding:0px;"><a href="' + $(this).attr("rel") + '" rel="thisImage"><img src="' + $(this).attr("rel") + '" title="' + $(this).attr("title") + '" width="'+ $(this).data('width') +'" height="'+ $(this).data('height') +'" /></a></li><li style="margin:0px;padding:0px;"><a href="/deutsch/bilder-der-seychellen#"><img src="' + $(this).attr("rel") + '" title="' + $(this).attr("title") + '" width="'+ $(this).data('width') +'" height="'+ $(this).data('height') +'" /></a></li>'; 
	   $('#animated-panorama').empty().append(newImage);
	$("a[rel=thisImage]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">' + title + '</span>';
		}
	});
	$('ul#animated-panorama').animatedinnerfade({
						speed: 500,
						timeout: '40000',
						type: 'sequence',
						containerheight: '348px',
						containerwidth: '960px',
						animationSpeed: '40000',
						animationtype: 'slide',
						bgFrame: 'none',
	                                        controlBox: 'none',
						controlBoxClass: 'none',
	                                        controlButtonsPath: 'img',
                                                displayTitle: 'yes' 
					});
        
    });
	

} else {
    
    $(".thumbnail").hover(function() {
	$(this).css({'z-index' : '999', 'position' : 'absolute', 'width' : null, 'height' : null});


	$(this).addClass("hover").stop()
		.animate({
			width: '400px',

		}, 200);
	
	} , function() {
	$(this).css({'z-index' : '0', 'position' : 'static'});
	$(this).removeClass("hover").stop()
		.animate({
			marginTop: '0', 
			marginLeft: '0',
			width: '200px',

		}, 400);
    });
     
    $("ul#mycarousel li").hoverIntent(function() {
   
       newImage = '<li style="margin:0px;padding:0px;"><a href="' + $(this).find('img').attr("rel") + '" rel="thisImage"><img src="' + $(this).find('img').attr("rel") + '" title="' + $(this).find('img').attr("title") + '" width="'+ $(this).find('img').data('width') +'" height="'+ $(this).find('img').data('height') +'" /></a></li><li style="margin:0px;padding:0px;"><a href="/deutsch/bilder-der-seychellen#"><img src="' + $(this).find('img').attr("rel") + '" title="' + $(this).find('img').attr("title") + '" width="'+ $(this).find('img').data('width') +'" height="'+ $(this).find('img').data('height') +'" /></a></li>'; 
	   $('#animated-panorama').empty().append(newImage);
	$("a[rel=thisImage]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">' + title + '</span>';
		}
	});
	addMarker($(this).find('img').data('lat'),$(this).find('img').data('long'));
	$('ul#animated-panorama').animatedinnerfade({
						speed: 500,
						timeout: '40000',
						type: 'sequence',
						containerheight: '348px',
						containerwidth: '960px',
						animationSpeed: '40000',
						animationtype: 'slide',
						bgFrame: 'none',
	                                        controlBox: 'none',
						controlBoxClass: 'none',
	                                        controlButtonsPath: 'img',
                                                displayTitle: 'yes' 
					});
					$("a.next-button").css("visibility", "hidden"); //on masque la flèche su image
					$("a.back-button").css("visibility", "hidden");
					$("a.pause-button").css("visibility", "hidden");
	} ,function() {});

        
    $(".thumbDiv").hover(function() {
	$(this).css({'z-index' : '999'});
	$(this).addClass("hover").stop()
		.animate({
			marginTop: '-110px', 
			marginLeft: '-110px', 
			width: '300px',
			height: '300px', 
            padding: '20px' 
		}, 200);
	
	} , function() {
	$(this).css({'z-index' : '0',});
	$(this).removeClass("hover").stop()
		.animate({
		    marginTop: '5px', 
			marginLeft: '5px',
			width: '100px', 
			height: '100px',			
			padding: '5px'
		}, 400);
    });

    
}

});
function startAnimation()
				{
									}

