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

		wpshow_page6 = new Slideshow('weaverpix-page6-slideshow', false, wpoptions_page6.getClean());
	
		// The total number of images
		if (thumbnails_enabled) {
			var count = wpshow_page6.data.images.length;
			$$('.slideshow-page6-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});
			});
		}
	}
});
