var scrollToFixed = new Class({
	
	options:{
		'cssClass': 'elementFixed',
		'delay' : '500'
	},
	
	initialize: function(elid,opt){
		this.elid = elid;
		this.el = $(elid);
		this.setOptions(opt);
		this.position = this.el.getTop();
		
		window.onscroll = this.check.bindAsEventListener(this);
	},
	
	check: function(){
		if(window.getSize().scroll.y >= this.position){
			if(!this.el.hasClass(this.options.cssClass)){
				this.el.addClass(this.options.cssClass);
			}
		}else{this.el.removeClass(this.options.cssClass);}
	}	
});

scrollToFixed.implement(new Options);

window.addEvent("domready",function(){
									if($("fastnav")){new scrollToFixed("fastnav");}
									});