	hs.graphicsDir = 'highslide1/graphics/';
	hs.transitions = ['expand', 'crossfade'];
	hs.fadeInOut = true;
	hs.outlineType = 'glossy-dark';
	hs.wrapperClassName = 'dark';
	hs.align = 'center';
	hs.restoreCursor = null;
	hs.lang.restoreTitle = 'Click to close';
	// Add the controlbar for the regular gallery
	if (hs.addSlideshow) hs.addSlideshow({
		slideshowGroup: 'gallery',
		interval: 1000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: .06,
			position: 'bottom center',
			hideOnMouseOut: true
		}
	});
	// Add the slideshow for the in-page gallery
	hs.addSlideshow({
		slideshowGroup: 'inPageGallery',
		interval: 15000,
		repeat: true,
		useControls: false
	});
	// Options for the in-page items
	var inPageOptions = {
		slideshowGroup: 'inPageGallery',
		allowSizeReduction: false,
		wrapperClassName: 'in-page',
		useBox: true,
		width: 600,
		height: 320,
		targetX: 'inner1 null',
		targetY: 'inner1 29px',
  autoplay: true,
   captionOverlay: {
      position: 'rightpanel',
      width: '360px'
 }}
	// Open the first thumb on page load
	hs.addEventListener(window, 'load', function() {
		document.getElementById('thumb1').onclick();
	});
	// 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);
			}
		}
	});
	
	// 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))   {
         this.wrapper.style.zIndex = this.slideshow.zIndex;
         if (this.outline) this.outline.table.style.zIndex = this.slideshow.zIndex - 1;

      }
   }

   hs.Expander.prototype.onInit = function() {
      // if the href of the a tag contains the word rotator...
      if (/rotator/.test(this.a.href)) hs.transitionDuration = 0;
      // else, revert to the regular duration
      else hs.transitionDuration = 500;
   }

