/**
*	Site-specific configuration settings for Highslide JS
*/
$(document).ready(function() {
hs.graphicsDir = 'http://www.didierferry-galerie.com/highslide/graphics/';
hs.outlineType = 'custom';
hs.dimmingOpacity = 0.75;
hs.fadeInOut = true;
hs.align = 'center';
hs.maxHeight = 500;
hs.marginBottom = 70;
hs.marginLeft = 100;
hs.captionEval = 'this.thumb.alt';
hs.captionOverlay.position = 'below';
hs.headingEval = 'this.thumb.title';
hs.registerOverlay({
	html: '<div class="closebutton" onclick="return hs.close(this)" title="Fermer"></div>',
	position: 'top right',
	useOnHtml: true,
	fade: 2 // fading the semi-transparent overlay looks bad in IE
});



// Add the slideshow controller
hs.addSlideshow({
	slideshowGroup: (function() {
    var groups = [];
    $('.gallery').each(function(i, $item) {
        groups.push($item.id);
    });
    return groups;
})(),
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: false,
	overlayOptions: {
		className: 'text-controls',
		opacity: 1,
		position: 'bottom center',
		offsetX: 20,
		offsetY: -10,
		relativeTo: 'viewport',
		hideOnMouseOut: false
	},
	thumbstrip: {
		mode: 'vertical',
		position: 'middle left',
		relativeTo: 'viewport'
	}

});

hs.numberPosition = 'caption';
hs.transitions = ['expand', 'crossfade'];

// French language strings
hs.lang = {
	cssDirection: 'ltr',
	loadingText: 'Chargement...',
	loadingTitle: 'Cliquer pour annuler',
	focusTitle: 'Cliquer pour amener au premier plan',
	fullExpandTitle: 'Afficher à la taille réelle',
	creditsText: '',
	creditsTitle: 'Site Web de Highslide JS',
	previousText: 'Précédente',
	nextText: 'Suivante',
	moveText: 'Déplacer',
	closeText: 'Fermer',
	closeTitle: 'Fermer (esc ou Échappement)',
	resizeTitle: 'Redimensionner',
	playText: 'Lancer',
	playTitle: 'Lancer le diaporama (barre d\'espace)',
	pauseText: 'Pause',
	pauseTitle: 'Suspendre le diaporama (barre d\'espace)',
	previousTitle: 'Précédente (flèche gauche)',
	nextTitle: 'Suivante (flèche droite)',
	moveTitle: 'Déplacer',
	fullExpandText: 'Taille réelle',
	number: '',
	restoreTitle: 'Cliquer pour fermer l\'image, cliquer et faire glisser pour déplacer, utiliser les touches flèches droite et gauche pour suivant et précédent.'
};




// for gallery
$('.gallery-item a').addClass('highslide');
$('.gallery-item a').each(function() {
    this.onclick = function() {
        return hs.expand(this, {
            slideshowGroup: this.parentNode.parentNode.parentNode.id
        });
    };
});

// For single images
hs.onSetClickEvent = function(sender, e) {
    e.element.onclick = function() {
        return hs.expand(this, singleConfig);
    }
    return false;
};

var singleConfig = {
    slideshowGroup: 'single-image',
    outlineType: 'drop-shadow',
    wrapperClassName: 'borderless',
    numberPosition: null,
    dimmingOpacity: 0
};

hs.registerOverlay({
    slideshowGroup: 'single-image',
    html: ' <div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
    position: 'top right',
    fade: 2
    });

});


