Event.observe(window, "load", function() {
	
	$$('.GreatGrandChildrenComponent > ul').each(function(i) {
		new Accordion(i);
	});
	
	$$('img[src*="assets/Supplier-logos/"]').invoke('addClassName', 'noborder');
	
	$$('img[src*="assets/Ratings-images/"]').invoke('addClassName', 'noborder');
	
	/*
	// This doesn't put them in gallery
	$$(".FlickrComponent a").each(function(i) {
		Event.observe(i, 'click', function() {
			parent.myLightWindow.activate(null, i);
		}, false);
		i.onclick = function() {return false;};
	});
	*/

	// Setup lightwindow on flickr galleries
	$$(".FlickrComponent").each(function(i) {
		i.getElementsBySelector('a').each(function(i) {
			i.rel = "Gallery['Flickr Photos']";
			i.className = "lightwindow";
		});
	});
	lightwindowInit();
	
	
		
	
	// Popup window for target=_blank
	$$('a[target="_blank"]').each(function(i) {
		i.onclick = function() {
			myLightWindow.activateWindow({
				type: 'external',
				href: i.href, 
				title: i.title,
				width: 750,
				height: 550
			});
			return false; 
		};
	});
	
});