window.addEvent('domready', function() {
	
	// The slideshow
	if (typeof(wpshow_page8) == 'undefined'){
	
		// The options for the slideshow
		wpoptions_page8 = new Hash({width: 830,height: 370,resize: 'fill',replace: [/(\.[^\.]+)$/, '$1'],captions: false,controller: false,random: false,paused: false,preload: false,overlap: false,loop: true,delay: 3000,duration: 1000,pan: 100,zoom: [80, 100],color: '#CCCCCC',thumbnails: false,thumbnailsOnTopOrBottom: true,thumbnail_width: 40,thumbnail_height: 40,thumbnail_offset: 20,linked: false,loader: {'animate': ['files/block_6/loader-#.png', 12]},classes: [	 'slideshow-page8', '', '', '',	 '', '', '', '',	 '', '', '', '',	 '', '', '', '']});
	
		// If thumbnails are enabled
		var thumbnails_enabled = wpoptions_page8.thumbnails;
	
		// If thumbnails are on top
		var thumbnailsOnTopOrBottom = wpoptions_page8.thumbnailsOnTopOrBottom;
	
		// The thumbnail
		var thumbnail = $$('.slideshow-page8-thumbnails ul li')[0];
		var thumbnail_height = wpoptions_page8.thumbnail_height;
		var thumbnail_width = wpoptions_page8.thumbnail_width;
		var toffset = wpoptions_page8.thumbnail_offset;

		wpshow_page8 = new Slideshow.Flash('weaverpix-page8-slideshow', false, wpoptions_page8.getClean());
	
		// The total number of images
		if (thumbnails_enabled) {
			var count = wpshow_page8.data.images.length;
			$$('.slideshow-page8-thumbnails ul').each(function(el) {
			  var width = thumbnail_width + toffset;
			  var height = thumbnail_height + toffset;
	  
			  if (thumbnailsOnTopOrBottom) {
				width = width * count;
			  } else {
				height = height * count;
			  }
	  
			  el.setStyles({'width': width, 'height': height});
			});
		}
	}
});
