window.addEvent('domready', function() {
	
	// The data for the slideshow
	var wpdata_page36 = new Hash({'files/block_8/EFA8ADC2-image2.jpg':{caption: 'Welcome to Bob Piva Roofing.', href: 'http://elmspub.net/piva/roofing/bob-piva-roofing/index.html', thumbnail: 'files/block_8/EFA8ADC2-image2-t.jpg'},'files/block_8/6387D089-image3.jpg':{caption: 'We now offer Solar Solutions to San Diego County.', href: 'http://www.elmspub.net/piva/solar/home/', thumbnail: 'files/block_8/6387D089-image3-t.jpg'},'files/block_8/D0ADBBFB-image5.jpg':{caption: 'Searching for a new look? We offer a wide sellection of replacement windows and doors.  ', href: 'http://www.elmspub.net/piva/windows_doors/home/', thumbnail: 'files/block_8/D0ADBBFB-image5-t.jpg'},'files/block_8/4A92372E-image7.jpg':{caption: 'Single roofs or whole complexes. We\'ve got you covered.', href: 'http://elmspub.net/piva/roofing/bob-piva-roofing/page26/page26.html', thumbnail: 'files/block_8/4A92372E-image7-t.jpg'},'files/block_8/CCE2EDA0-image6.jpg':{caption: 'Need a roof? We\'ve got you covered.', href: 'http://elmspub.net/piva/roofing/bob-piva-roofing/residential-roofs/residential-roofs.html', thumbnail: 'files/block_8/CCE2EDA0-image6-t.jpg'},'files/block_8/12AF6212-image8.jpg':{caption: 'Ask us how tile roof recoating can raise your home\'s value for a fraction of the cost of a new roof.', href: 'http://elmspub.net/piva/roofing/bob-piva-roofing/Roof-Tile-Recoating/page5.html', thumbnail: 'files/block_8/12AF6212-image8-t.jpg'},'files/block_8/D51DEABE-image9.jpg':{caption: 'Need a commercial building reroofed? No problem.', href: 'http://elmspub.net/piva/roofing/bob-piva-roofing/Commercial-Roofs/Commercial-Roofs.html', thumbnail: 'files/block_8/D51DEABE-image9-t.jpg'}});
	
	// The options for the slideshow
	var wpoptions_page36 = new Hash({width: 900,height: 300,resize: false,captions: true,controller: true,random: false,paused: false,preload: true,overlap: true,loop: true,delay: 7000,duration: 1000,pan: 100,zoom: 50,color: '#FFFFFF',thumbnails: false,thumbnailsOnTopOrBottom: true,thumbnail_width: 60,thumbnail_height: 60,linked: false,loader: {'animate': ['files/block_8/loader-#.png', 12]},classes: [	 'slideshow-page36', '', '', '',	 '', '', '', '',	 '', '', '', '',	 '', '', '', '']});
	
	// If thumbnails are enabled
	var thumbnails_enabled = wpoptions_page36.thumbnails;
	
	// If thumbnails are on top
	var thumbnailsOnTopOrBottom = wpoptions_page36.thumbnailsOnTopOrBottom;
	
	// The thumbnail
	var thumbnail = $$('.slideshow-page36-thumbnails ul li')[0];
	var thumbnail_height = wpoptions_page36.thumbnail_width;
	var thumbnail_width = wpoptions_page36.thumbnail_height;
	
	// The thumbnail div
	/*var thumbnail_wrapper = $$('.slideshow-page36-thumbnails ul')[0];
	var thumbnail_wrapper_height = thumbnail_wrapper.getStyle('height').toInt();
	var thumbnail_wrapper_width = thumbnail_wrapper.getStyle('width').toInt();*/
	
	if (typeof(wpember_page36) != 'undefined') {
		wpdata_page36.combine(wpember_page36);
	}
	
	if (typeof(wpflickr_page36) != 'undefined') {
		wpdata_page36.combine(wpflickr_page36);
	}
	
	if (typeof(wplocal_page36) != 'undefined') {
		wpdata_page36.combine(wplocal_page36);
	}

	// The slideshow
	wpshow_page36 = new Slideshow('weaverpix-page36-slideshow', wpdata_page36.getClean(), wpoptions_page36.getClean());
	
	// The total number of images
	var count = wpdata_page36.getLength();
	$$('.slideshow-page36-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});
	});
});
