document.observe("dom:loaded", function() {
	
		projects.each(function(pair){
			a = new Element('a', {href: pair.value.href, onclick: 'return false; '}).update(pair.value.shortname);
			li = new Element('li', {id: 'li-project-' + pair.value.shortname}).update(a);
		
			a.observe('click', function(){
				loadProject(pair.key);
			});
		
			$('list-projects').insert(li);				
		});
	
		people.each(function(pair){
			a = new Element('a', {href: pair.value.href, onclick: 'return false; '}).update(pair.value.name);
			li = new Element('li', {id: 'li-person-' + pair.key}).update(a);
		
			a.observe('click', function(){
				loadPerson(pair.key);
				return false;
			});
		
			$('list-people').insert(li);
		});
		
		
		$('navigation').observe('list:loaded', function(){
			this.stopObserving();
			initUIFromHash();
		});

		$$('#list-hosted li a').each(function(s){
			s.observe('click', function(){
				createModalWindow({text: "We don't have a page for that yet, but you can visit the site at: <a target='_blank' href='" + s.readAttribute('href') + "'>" + s.readAttribute('href') + "</a>"});
			});
		});	

		if (fragment[0] != ''){
			revealList(fragment[0]);
		} else {
			revealList('people');
		}
	 
	
	
	
	$$('#navigation li span').each(function(s){
		s.observe('click', function(){
			revealList(this.readAttribute('target'));
		});
	});
	
/*	$$('a.person').each(function(s){
		s.observe('click', function(){
			loadPerson(s.readAttribute('loads'));
		});	
	}); */
	
/*	$('logo').observe('click', function(){
		location.href="/";
	});*/
	
	
	
	
	
});
