window.addEvent('domready', function() {
	
	// The data for the slideshow
	var wpdata_page4 = new Hash({'index_files/54C45458-May_2010 307.jpg':{caption: 'May 2010 307.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/54C45458-May_2010 307-t.jpg', target: '_self'},'index_files/01C4E0E8-May_2010 303.jpg':{caption: 'May 2010 303.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/01C4E0E8-May_2010 303-t.jpg', target: '_self'},'index_files/B5823E0F-May_2010 295.jpg':{caption: 'May 2010 295.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/B5823E0F-May_2010 295-t.jpg', target: '_self'},'index_files/32A007DD-May_2010 291.jpg':{caption: 'May 2010 291.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/32A007DD-May_2010 291-t.jpg', target: '_self'},'index_files/B52D7BDC-May_2010 283.jpg':{caption: 'May 2010 283.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/B52D7BDC-May_2010 283-t.jpg', target: '_self'},'index_files/A7E25C91-great_room.jpg':{caption: 'great room.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/A7E25C91-great_room-t.jpg', target: '_self'},'index_files/34145906-great_room 2.jpg':{caption: 'great room 2.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/34145906-great_room 2-t.jpg', target: '_self'},'index_files/16667245-front.jpg':{caption: 'front.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/16667245-front-t.jpg', target: '_self'},'index_files/42182FD7-bedroom_3.jpg':{caption: 'bedroom 3.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/42182FD7-bedroom_3-t.jpg', target: '_self'},'index_files/6C25F839-bedroom_1.jpg':{caption: 'bedroom 1.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/6C25F839-bedroom_1-t.jpg', target: '_self'},'index_files/42876A93-bathroom_3.jpg':{caption: 'bathroom 3.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/42876A93-bathroom_3-t.jpg', target: '_self'},'index_files/4D902F8A-bathroom_1.jpg':{caption: 'bathroom 1.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/4D902F8A-bathroom_1-t.jpg', target: '_self'},'index_files/993CB567-bathroom_2.jpg':{caption: 'bathroom 2.jpg', href: '#weaverpix-page4-slideshow', thumbnail: 'index_files/993CB567-bathroom_2-t.jpg', target: '_self'}});
	
	// The options for the slideshow
	var wpoptions_page4 = new Hash({width: 320,height: 240,resize: 'fill',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);
	}
	
	if (typeof(wppicasa_page4) != 'undefined') {
		wpdata_page4.combine(wppicasa_page4);
	}
	// The slideshow
	wpshow_page4 = new Slideshow.KenBurns('weaverpix-page4-slideshow', wpdata_page4.getClean(), wpoptions_page4.getClean());
	
	// The total number of images
	if (thumbnails_enabled) {
		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});
		});
	}
});
