var YouAreHere = new Class({
						   
	options:{
		on: 'on'
	},

	initialize: function(collection){
		this.collection = collection;
		this.idx = null;
	},

	getDirectoryIndex: function(){
                p = window.location.href.indexOf(window.location.host)+window.location.host.length+1;
		if (window.location.href.length > p && window.location.href.lastIndexOf('.html')<0) {
			this.idx = 0;
		}
		this.collection.each(function(e, i){
			if( new RegExp(e.rel).test(window.location) ) this.idx = i;
		}, this);
		return this.idx;
	},
	
	setTab: function(idx){
		if(idx != null) this.collection[idx].addClass(this.options.on);
	},
	
	setNav: function(){
		this.setTab(this.getDirectoryIndex());
	}

});

YouAreHere.implement(new Options);