window.addEvent('domready', function(){
	// get all anchors
	var allAnchors = $$('a');
	
	// get url as a string
	var page = window.location.toString();
	
	//if only directory is given, append 'index.html'
	if(page.charAt(page.length -1) == '/'){
		page = page.concat('index.html');
	}
	
	// set the class of all anchors to none and
	// compare anchors to url to determine which is/are active
	
	for(i=0; i<allAnchors.length; i++){
		allAnchors[i].erase('class');
		if(allAnchors[i].match(page)){
			//alert('Found one! ' + allAnchors[i]);
			allAnchors[i].set('class', 'active');
		}
	}
});
