	
	hs.graphicsDir = '/Sito/Js/highslide/graphics/';
	hs.transitions = ['expand', 'crossfade'];
	hs.fadeInOut = true;
	hs.outlineType = 'rounded-white';
	hs.align = 'center';
	hs.restoreCursor = null;
	hs.lang.restoreTitle = 'Click for next image';
	hs.expandDuration = 0;
	hs.restoreDuration = 0;
	hs.showCredits = false;
	hs.captionEval = 'this.a.title';
	hs.captionOverlay.position = 'below';
	

    /* ------ SEZIONE DA CUSTOMIZZARE POPUP GALLERY ----- */

	// Add the controlbar for the popup gallery
	if (hs.addSlideshow) hs.addSlideshow({
		slideshowGroup: 'gallery',
		interval: 5000,
		repeat: true,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
		    className: 'large-dark',
		    opacity: 0.75,
		    position: 'bottom center',
		    offsetX: 0,
		    offsetY: -10,
		    hideOnMouseOut: false
		},
		thumbstrip: {
		    mode: 'horizontal',
		    position: 'above',
		    relativeTo: 'image'
		}
    });

    /* ------ SEZIONE DA CUSTOMIZZARE PER LA GALLERY "IN PAGE" ----- */

	// Add the slideshow for the in-page gallery
	hs.addSlideshow({
		slideshowGroup: 'inPageGallery',
		interval: 5000,
		repeat: true,
		useControls: true,
		overlayOptions: {
		    position: 'bottom right',
	            offsetY: 30
		},
		thumbstrip: {
		    position: 'above',
		    mode: 'horizontal',
		    relativeTo: 'expander'
		}
    });

	var inPageOptions = {
        slideshowGroup: 'inPageGallery',
        outlineType: null,
        allowSizeReduction: true,
        wrapperClassName: 'in-page controls-in-heading',
        thumbnailId: 'gallery-area',
        useBox: true,
        width: 600,
        height: 400,
        targetX: 'gallery-area 10px',
        targetY: 'gallery-area 10px',
        captionEval: 'this.a.title',
        numberPosition: 'caption'
    }

	// Open the first thumb on page load
	/* hs.addEventListener(window, 'load', function() {
		document.getElementById('thumb1').onclick();
	});
	*/


    /* ------ SEZIONE DEDICATA ALLA SOLA GALLERY IN PAGE ----- */
    // Cancel the default action for image click and do next instead
    hs.Expander.prototype.onImageClick = function () {
        if (/in-page/.test(this.wrapper.className)) return hs.next();
    }

    /*
    // Under no circumstances should the static popup be closed
    hs.Expander.prototype.onBeforeClose = function () {
        if (/in-page/.test(this.wrapper.className)) return false;
    }

    */


    // ... nor dragged
    hs.Expander.prototype.onDrag = function () {
        if (/in-page/.test(this.wrapper.className)) return false;
    }

    // Keep the position after window resize
    hs.addEventListener(window, 'resize', function () {
        var i, exp;
        hs.getPageSize();

        for (i = 0; i < hs.expanders.length; i++) {
            exp = hs.expanders[i];
            if (exp) {
                var x = exp.x,
					y = exp.y;

                // get new thumb positions
                exp.tpos = hs.getPosition(exp.el);
                x.calcThumb();
                y.calcThumb();

                // calculate new popup position
                x.pos = x.tpos - x.cb + x.tb;
                x.scroll = hs.page.scrollLeft;
                x.clientSize = hs.page.width;
                y.pos = y.tpos - y.cb + y.tb;
                y.scroll = hs.page.scrollTop;
                y.clientSize = hs.page.height;
                exp.justify(x, true);
                exp.justify(y, true);

                // set new left and top to wrapper and outline
                exp.moveTo(x.pos, y.pos);
            }
        }
    });


    /* ------ SEZIONE DEDICATA ALLA CONVIVENZA DELLE DUE GALLERY ----- */
    // Start in-page focus mod - prevent in-page gallery to focus above other expanders
    hs.Expander.prototype.onAfterExpand = function () {
        if (/in-page/.test(this.wrapper.className) && this.slideshow && this.slideshow.zIndex === undefined) {
            this.slideshow.zIndex = this.wrapper.style.zIndex;
        }
    };
    hs.Expander.prototype.onFocus = function () {
        if (/in-page/.test(this.wrapper.className)) {
            if (this.slideshow && this.slideshow.zIndex) {
                this.wrapper.style.zIndex = this.slideshow.zIndex;
            }
            if (this.outline) {
                this.outline.table.style.zIndex = this.slideshow.zIndex - 1;
            }
        }
    };
    // End in-page focus mod

    hs.Expander.prototype.onInit = function () {
        // in-page focus mod requires transitionDuration set to 0. Set different transitionDuration for the two galleries
        if (this.slideshowGroup == 'inPageGallery') hs.transitionDuration = 0;
        else hs.transitionDuration = 500;
    };




