/* init photo swipe */

//jQuery version

$(document).ready(function(){

var options = {
	enableMouseWheel                  : false , 
	enableKeyboard                    : false,
	captionAndToolbarHide             : false,
	captionAndToolbarAutoHideDelay    : 0,
	loop                              : false,
	allowUserZoom                     : false,
	margin                            : 0,
	captionAndToolbarFlipPosition     : true,
	captionAndToolbarShowEmptyCaptions: false,
	preventSlideshow                  : true
};
	
//create on reload
if ($("ul.gallery a").length != 0) {
  $('body').addClass('bottom');
  $('body').removeClass('not-bottom');
  $("body").removeClass("black");
  
  
	myPhotoSwipe = $("ul.gallery a").photoSwipe(options);
	if (typeof myPhotoSwipe != "undefined" && myPhotoSwipe != null) {
		//$(".gallery").show();
	}
}

//show if page is created
$('div.gallery-page').live('pagecreate', function(e){
  $('body').addClass('bottom');
  $('body').removeClass('not-bottom');
  $("body").removeClass("black");
  
	myPhotoSwipe = $("ul.gallery a").photoSwipe(options);
});


});
		
function confirmation() 
{
  var answer = confirm("Wollen Sie die mobile Version dieser Website besuchen?")
  if (answer)
  {
    $.cookie("mobile", 1);
  }
  else
  {
	$.cookie("mobile", 0);
  }
  
  if($.cookie('mobile') != null)
  {
	window.location = window.location;
  }
}


/*
(function(window, $, PhotoSwipe){
	
	$(document).ready(function(){
		
		$('div.gallery-page')
			.live('pageshow', function(e){
				
				var 
					currentPage = $(e.target),
					options = {
						'captionAndToolbarHide'              : false,
						'captionAndToolbarAutoHideDelay'     : 0,
						'loop'                               : false,
						'allowUserZoom'                      : false,
						'margin'                             : 0,
						'captionAndToolbarFlipPosition'      : true,
						'captionAndToolbarShowEmptyCaptions' : false
	
					},
					photoSwipeInstance = $("ul.gallery a", e.target).photoSwipe(options,  currentPage.attr('id'));
					
				return true;
				
			})
			
			.live('pagehide', function(e){
				
				var 
					currentPage = $(e.target),
					photoSwipeInstance = PhotoSwipe.getInstance(currentPage.attr('id'));

				if (typeof photoSwipeInstance != "undefined" && photoSwipeInstance != null) {
					PhotoSwipe.detatch(photoSwipeInstance);
				}
				
				return true;
				
			});
		
	});

}(window, window.jQuery, window.Code.PhotoSwipe));
*/

