window.addEvent('domready', function() {
									 
	//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'
	});




									 
	//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);
		}
	});
	
	$('callPanel0').addEvent('click', function() {
		req0.send();
	});
	
		//We can use one Request object many times.
	var req1 = new Request.HTML({
		method: 'get',
		url:demo_path+'panel-1.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);
		}
	});
	
	$('callPanel1').addEvent('click', function() {
		req1.send();
	});
	
/*		We can use one Request object many times.
	var req2 = new Request.HTML({
		method: 'get',
		url:demo_path+'panel-2.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);
		}
	});
	
	$('callPanel2').addEvent('click', function() {
		req2.send();
	});
*/

	/* ====== SCROLLER ===== */
	
	var scroll = new Fx.Scroll('demo-wrapper', {
				wait: false,
				duration: 2500,
				offset: {'x': 0, 'y': 0},
				transition: Fx.Transitions.Quad.easeInOut
			});
			
			$('link1').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('content1');
			});
			
			$('link3').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('content3');
			});
			
			$('link4').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('content4');
			});
			
			$('link5').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('content5');
			});
			
			$('link6').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('content6');
			});
			
			$('link7').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('content7');
			});
			
			//$('link7').addEvent('click', function(event) {
			//	event = new Event(event).stop();
			//	scroll.toElement('content7');
			//});

});



