var bdover = Class.create();
Object.extend(bdover.prototype,
{
	initialize: function(el,yto) {
		this.els=$A(document.getElementsByClassName("activearea"));
		this.yto=yto;
		this.activate();
	},
	activate: function (){
		this.els.each((function(e) {
			e._url=e.up("a").href;
			if(e.up(".bgsel")==undefined){
				e.observe('click', this.getUrl.bindAsEventListener(e));
				e.observe('mouseover', this.up.bindAsEventListener(this));
				e.observe('mouseout', this.dw.bindAsEventListener(this));
			}else{
				var el=e.next(".menuboxinner");
				el.setStyle({top:-this.yto+"px"});
			}
		}).bind(this));
	},
	up_: function (){
		var t=parseInt(this.elemToMove.getStyle("top"));
		if(t>-this.yto){
			t-=3;
			this.elemToMove.setStyle({top:t+"px"});
		}else{
			clearInterval(this.intup);
		}
	},
	up: function (e){
		var el = Event.element(e);
		el.elemToMove=el.parentNode.next(".menuboxinner");
		el.yto=this.yto;
		clearInterval(el.intdw);
		el.intup=setInterval((this.up_).bind(el),10);
	},
	dw: function (e){
		var el = Event.element(e);
		clearInterval(el.intup);
		el.intdw=setInterval((this.dw_).bind(el),10);
	},
	dw_: function(){
		t=parseInt(this.elemToMove.getStyle("top"));
		if(t<0){
			t+=3;
			this.elemToMove.setStyle({top:t+"px"});
		}else{
			clearInterval(this.intdw);
		}
		
	},
	getUrl: function(e){
		document.location.href=this._url;
	}
}); 

