window.addEvent('domready', function(){
	
	new SmoothScroll();

	var szNormal = 167, szSmall = 120, szFull = 260;
	var kwicks = $$("#kwick .kwick");
	var fx = new Fx.Elements(kwicks, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut});
	kwicks.each(function(kwick, i) {
		kwick.addEvent("mouseenter", function(event) {
			var o = {};
			o[i] = {width: [kwick.getStyle("width").toInt(), szFull]}
			kwicks.each(function(other, j) {
				if(i != j) {
					var w = other.getStyle("width").toInt();
					if(w != szSmall) o[j] = {width: [w, szSmall]};
				}
			});
			fx.start(o);
		});
	});
	
	$("kwick").addEvent("mouseleave", function(event) {
		var o = {};
		kwicks.each(function(kwick, i) {
			o[i] = {width: [kwick.getStyle("width").toInt(), szNormal]}
		});
		fx.start(o);
	})
	
	var box = $('dynamic_box');
	var fx2 = box.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('cfp_button').addEvent('click', function(e) {
		e = new Event(e).stop();
		fx2.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 300,
				'height': 315
			});
		}).chain(function(){
			var url = "/Rome2008/cfp.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box'),
				evalScripts: true
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').addClass('gor_options_selected');

			this.start({
			});
		});
   });

	var box2 = $('dynamic_box');
	var fx3 = box2.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('papabst_button').addEvent('click', function(e) {
		e = new Event(e).stop();
		fx3.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 570,
				'height': 300
			});
		}).chain(function(){
			var url = "/Rome2008/abstract.php";
			new Ajax(url, { 
				method: 'get',
				update: $('dynamic_box'),
				evalScripts: true
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').addClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });
	var box3 = $('dynamic_box');
	var fx4 = box3.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('booking_button').addEvent('click', function(e) {
		e = new Event(e).stop();
		fx4.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 600,
				'height': 660
			});
		}).chain(function(){
			var url = "/Rome2008/booking.php";
			new Ajax(url, { 
				method: 'get',
				update: $('dynamic_box'),
				evalScripts: true
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').addClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });
	var box4 = $('dynamic_box');
	var fx5 = box4.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('sched_button').addEvent('click', function(e) {
		e = new Event(e).stop();
		
		fx5.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 590,
				'height': 475 
			});
		}).chain(function(){
			var url = "/Rome2008/schedule.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box')
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').addClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });

   var box6 = $('dynamic_box');
	var fx7 = box6.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('loc_button').addEvent('click', function(e) {
		e = new Event(e).stop();
		fx7.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 590,
				'height': 465
			});
		}).chain(function(){
			var url = "/Rome2008/location.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box')
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').addClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });

   /*buttons in bottom roll-out*/

   	var box_b1 = $('dynamic_box');
	var fx_b1 = box_b1.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('cfp_button2').addEvent('click', function() {
		fx_b1.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 300,
				'height': 315
			});
		}).chain(function(){
			var url = "/Rome2008/cfp.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box'),
				evalScripts: true
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').addClass('gor_options_selected');

			this.start({
			});
		});
   });

	var box_b2 = $('dynamic_box');
	var fx_b2 = box_b2.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('papabst_button3').addEvent('click', function() {
		fx_b2.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 570,
				'height': 300
			});
		}).chain(function(){
			var url = "/Rome2008/abstract.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box'),
				evalScripts: true
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').addClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });
	var box_b3 = $('dynamic_box');
	var fx_b3 = box_b3.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('booking_button2').addEvent('click', function() {
		fx_b3.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 600,
				'height': 660
			});
		}).chain(function(){
			var url = "/Rome2008/booking.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box'),
				evalScripts: true
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').addClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });
	var box_b4 = $('dynamic_box');
	var fx_b4 = box_b4.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('sched_button2').addEvent('click', function() {
		fx_b4.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 590,
				'height': 475
			});
		}).chain(function(){
			var url = "/Rome2008/schedule.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box')
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').addClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });
   var box_b5 = $('dynamic_box');
	var fx_b5 = box_b5.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('loc_button2').addEvent('click', function() {
		fx_b5.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 590,
				'height': 465
			});
		}).chain(function(){
			var url = "/Rome2008/location.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box')
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').addClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });

   /* buttons along top */

   	var box_t1 = $('dynamic_box');
	var fx_t1 = box_t1.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('cfp_button3').addEvent('click', function() {
		fx_t1.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 300,
				'height': 315
			});
		}).chain(function(){
			var url = "/Rome2008/cfp.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box'),
				evalScripts: true
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').addClass('gor_options_selected');

			this.start({
			});
		});
   });

	var box_t2 = $('dynamic_box');
	var fx_t2 = box_t2.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('papabst_button4').addEvent('click', function() {
		fx_t2.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 570,
				'height': 300
			});
		}).chain(function(){
			var url = "/Rome2008/abstract.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box'),
				evalScripts: true
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').addClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });
	var box_t3 = $('dynamic_box');
	var fx_t3 = box_t3.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('booking_button3').addEvent('click', function() {
		fx_t3.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 600,
				'height': 660
			});
		}).chain(function(){
			var url = "/Rome2008/booking.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box'),
				evalScripts: true
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').addClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });
	var box_t4 = $('dynamic_box');
	var fx_t4 = box_t4.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('sched_button3').addEvent('click', function() {
		fx_t4.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 590,
				'height': 475
			});
		}).chain(function(){
			var url = "/Rome2008/schedule.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box')
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').addClass('gor_options_selected');
			$('loc_button').removeClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });
   var box_t5 = $('dynamic_box');
	var fx_t5 = box_t5.effects({duration: 350, transition: Fx.Transitions.Quad.easeIn});
 
	$('loc_button3').addEvent('click', function() {
		fx_t5.start({
			'opacity': 0 // fades out div
		}).chain(function(){
			this.start({
				'width': 590,
				'height': 465
			});
		}).chain(function(){
			var url = "/Rome2008/location.php";
			new Ajax(url, {
				method: 'get',
				update: $('dynamic_box')
			}).request();
	 
			this.start({
	 
			});
		}).chain(function() {
			this.start({
				'opacity': 1 // fades in div
			});
	 	}).chain(function(){
			//toggle the selected class to make this tab look 'selected'
			$('sched_button').removeClass('gor_options_selected');
			$('loc_button').addClass('gor_options_selected');
			$('booking_button').removeClass('gor_options_selected');
			$('papabst_button').removeClass('gor_options_selected');
			$('cfp_button').removeClass('gor_options_selected');

			this.start({
			});
		});
   });
}); 