document.observe('dom:loaded', function() {
	$('bd').observe('click', showBDPage1);
});


function showBDPage1(event) {
	Event.stop(event);
	Lightview.show({
		href: '/bd1',
		rel: 'ajax',
		options: {
			topclose: true,
            //autosize: true,
            overflow: 'auto',
            height: 600,
            width: 800,
			ajax: {
				onComplete: function(){
				// once the request is complete we observe the form for a submit
				$('suite1').observe('click', showBDPage2);
				$('suite2').observe('click', showBDPage2);
				}
			}
		}
	});
}

function showBDPage2(event) {
  // block default form submit
  Event.stop(event);
  Lightview.show({
    href: '/bd2',
    rel: 'ajax',
    options: {
        topclose: true,
      //autosize: true,
      overflow: 'auto',
      height: 600,
      width: 800,
      ajax: {
        onComplete: function(){
		  // once the request is complete we observe the form for a submit
		  $('retour1').observe('click', showBDPage1);
		  $('retour2').observe('click', showBDPage1);
        }
      }
    }
  });
}
