var li_height = new Array();

var event_scroll = Class.create({

	initialize: function() {
		//get a list of all child
		this.li_list = $('event_list').childElements();
		this.li_count = this.li_list.size();

		this.li_list.each(function(s){
			li_height[s.id] = $(s.id).getHeight();
		});

		//current li//
		this.current_li = 1;
	},

	up: function () {

		//lets first see if we are at the first li//
		if(this.current_li != 1){
			this.current_li--;
			Effect.Appear('event'+this.current_li);
		}

	},

	down: function () {

		//lets first get the height of each li//
		total_height = 0;
		for(i=this.current_li;i<=this.li_count;i++){

			//lets add up the height of all the li's to see if we still need to scroll...
			total_height += li_height['event'+i];

		}

		if(total_height > $('event_list').getHeight()){
			//then lets scroll...
			Effect.DropOut('event'+this.current_li);

			this.current_li++;
			if(this.current_li > this.li_count){
				this.current_li = this.li_count;
				$('event'+this.current_li).show();
			}
		}

	}

});

var event_s = '';

scroll_init = function(){
	event_s = new event_scroll();
}
