window.addEvent('domready', function() {
									 								 
	//request.HTML ---------------------------------
	
	if (!window.demo_path) window.demo_path = '';
	var demo_path = window.demo_path;
	
	//We can use one Request object many times.
	var req0 = new Request.HTML({
		method: 'get',
		url:demo_path+'panel-0.html',
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('galleryCol').set('text', '');
			//Inject the new DOM elements into the results div.
			$('galleryCol').adopt(html);
		},
		onComplete: function(responseTree, responseElements, responseHTML, responseJavaScript){
			//here i test the response elements and put them in array 'links'
			var links = responseElements.filter(function(el) {
				return el.rel && el.rel.test(/^lightbox/i);
			});
			//now i pass that array into the slimbox startup function
			Slimbox.scanPage(links);
		},
		onFailure: function() {
			$('galleryCol').set('text', 'The request failed.');
		}
	});
	
	$('callPanel0').addEvent('click', function() {
		req0.send();
	});
	
	
	
			
				//Squeezbox ------------------------------------
	
			/**
			 * That CSS selector will find all <a> elements with the
			 * class boxed
			 *
			 * The example loads the options from the rel attribute
			 */
			SqueezeBox.assign($$('a.boxed'), {
				parse: 'rel'
			});

});



