﻿    hs.align = 'center';
    hs.transitions = ['expand', 'crossfade'];
    hs.fadeInOut = true;
    hs.dimmingOpacity = 0.8;
    hs.outlineType = 'rounded-white';
    hs.captionEval = 'this.thumb.alt';
    hs.marginBottom = 105 // make room for the thumbstrip and the controls
    hs.numberPosition = 'caption';
    hs.showCredits = false;
    hs.wrapperClassName = 'dark';
    hs.showCredits = 0;
    hs.padToMinWidth = true;

    //hs.align = 'center';
    if (hs.registerOverlay) {
	    // The white controlbar overlay
	    hs.registerOverlay({
		    thumbnailId: 'thumb3',
    	    overlayId: 'controlbar',
    	    position: 'top right',
    	    hideOnMouseOut: true
	    });
	    // The simple semitransparent close button overlay
	    hs.registerOverlay({
		    thumbnailId: 'thumb2',
		    html: '<div class="closebutton"	onclick="return hs.close(this)" title="Close"></div>',
		    position: 'top right',
		    fade: 2 // fading the semi-transparent overlay looks bad in IE
	    });
    }
    if (hs.addEventListener && hs.Outline) hs.addEventListener(window, 'load', function () {
	    new hs.Outline('rounded-white');
	    new hs.Outline('glossy-dark');
    });
        // The gallery example on the front page
    var galleryOptions = {
	    slideshowGroup: 'gallery',
	    wrapperClassName: 'dark',
	    outlineType: 'rounded-white',
	    dimmingOpacity: 0.8,
	    align: 'center',
	    transitions: ['expand', 'crossfade'],
	    fadeInOut: true,
	    /*wrapperClassName: 'borderless floating-caption',*/
	    marginLeft: 100,
	    marginBottom: 80,
	    numberPosition: 'caption'
	    //premium : <%= context.member.premium ? 1 : 0 %>
    };

    if (hs.addSlideshow) hs.addSlideshow({
        slideshowGroup: 'gallery',
        interval: 5000,
        repeat: false,
        useControls: true,
        overlayOptions: {
    	    className: 'text-controls',
		    position: 'bottom center',
		    relativeTo: 'viewport',
		    offsetY: -60
	    },
	    thumbstrip: {
		    position: 'bottom center',
		    mode: 'horizontal',
		    relativeTo: 'viewport'
	    }

    });
    hs.Expander.prototype.onInit = function() {
	    hs.marginBottom = (this.slideshowGroup == 'gallery') ? 150 : 15;
    }

    // focus the name field
    hs.Expander.prototype.onAfterExpand = function() {

	    if (this.a.id == 'contactAnchor') {
		    var iframe = window.frames[this.iframe.name],
			    doc = iframe.document;
    	    if (doc.getElementById("theForm")) {
        	    doc.getElementById("theForm").elements["name"].focus();
    	    }

	    }
    }
