window.addEvent('domready', function() {
	
	// The data for the slideshow
	var wpdata_page4 = new Hash({'index_files/FB75BAF5-May_2010 307.jpg':{caption: 'May 2010 307.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/FB75BAF5-May_2010 307-t.jpg'},'index_files/E8D17A02-May_2010 303.jpg':{caption: 'May 2010 303.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/E8D17A02-May_2010 303-t.jpg'},'index_files/75C94668-May_2010 295.jpg':{caption: 'May 2010 295.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/75C94668-May_2010 295-t.jpg'},'index_files/D0A180B3-May_2010 291.jpg':{caption: 'May 2010 291.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/D0A180B3-May_2010 291-t.jpg'},'index_files/47DB9C83-May_2010 283.jpg':{caption: 'May 2010 283.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/47DB9C83-May_2010 283-t.jpg'},'index_files/D5D7B7BD-great_room.jpg':{caption: 'great room.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/D5D7B7BD-great_room-t.jpg'},'index_files/070146B8-great_room 2.jpg':{caption: 'great room 2.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/070146B8-great_room 2-t.jpg'},'index_files/9B29C0EE-front.jpg':{caption: 'front.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/9B29C0EE-front-t.jpg'},'index_files/5F93F9CF-bedroom_3.jpg':{caption: 'bedroom 3.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/5F93F9CF-bedroom_3-t.jpg'},'index_files/FF3B38ED-bedroom_1.jpg':{caption: 'bedroom 1.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/FF3B38ED-bedroom_1-t.jpg'},'index_files/E70A50B4-bathroom_3.jpg':{caption: 'bathroom 3.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/E70A50B4-bathroom_3-t.jpg'},'index_files/E22BB037-bathroom_1.jpg':{caption: 'bathroom 1.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/E22BB037-bathroom_1-t.jpg'},'index_files/9A552DA9-bathroom_2.jpg':{caption: 'bathroom 2.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/9A552DA9-bathroom_2-t.jpg'}});
	
	// The options for the slideshow
	var wpoptions_page4 = new Hash({width: 320,height: 240,resize: 'width',captions: false,controller: true,random: false,paused: false,preload: false,overlap: true,loop: true,delay: 2000,duration: 2000,pan: 100,zoom: 50,color: '#FFFFFF',thumbnails: false,thumbnailsOnTopOrBottom: true,thumbnail_width: 60,thumbnail_height: 60,linked: false,loader: {'animate': ['index_files/loader-#.png', 12]},classes: [	 'slideshow-page4', '', '', '',	 '', '', '', '',	 '', '', '', '',	 '', '', '', '']});
	
	// If thumbnails are enabled
	var thumbnails_enabled = wpoptions_page4.thumbnails;
	
	// If thumbnails are on top
	var thumbnailsOnTopOrBottom = wpoptions_page4.thumbnailsOnTopOrBottom;
	
	// The thumbnail
	var thumbnail = $$('.slideshow-page4-thumbnails ul li')[0];
	var thumbnail_height = wpoptions_page4.thumbnail_width;
	var thumbnail_width = wpoptions_page4.thumbnail_height;
	
	// The thumbnail div
	/*var thumbnail_wrapper = $$('.slideshow-page4-thumbnails ul')[0];
	var thumbnail_wrapper_height = thumbnail_wrapper.getStyle('height').toInt();
	var thumbnail_wrapper_width = thumbnail_wrapper.getStyle('width').toInt();*/
	
	if (typeof(wpember_page4) != 'undefined') {
		wpdata_page4.combine(wpember_page4);
	}
	
	if (typeof(wpflickr_page4) != 'undefined') {
		wpdata_page4.combine(wpflickr_page4);
	}
	
	if (typeof(wplocal_page4) != 'undefined') {
		wpdata_page4.combine(wplocal_page4);
	}

	// The slideshow
	wpshow_page4 = new Slideshow.KenBurns('weaverpix-page4-slideshow', wpdata_page4.getClean(), wpoptions_page4.getClean());
	
	// The total number of images
	var count = wpdata_page4.getLength();
	$$('.slideshow-page4-thumbnails ul').each(function(el) {
	  var width = thumbnail_width;
	  var height = thumbnail_height;
	  
	  if (thumbnailsOnTopOrBottom) {
		width = width * count;
	  } else {
		height = height * count;
	  }
	  
	  el.setStyles({'width': width, 'height': height});
	});
});