var site = {

	initialize: function(page){
		$('header-nav').getElements('a').each(function(a){
			if (page == a.innerHTML.trim()) a.addClass('active');
		});
		
		if (this[page]) this[page]();
	},

	welcome: function(){
		$('content-left').getElements('span.title').each(function(span){
			span.setOpacity(0.6);
		});
	},

	services: function(){
		var search = document.location.search,
		    show = search && search.substr(1).toInt(),
		    links = $('content-left').getLast().getChildren();
		if (!show || show > links.length) show = 1;
		new Accordion(links, $('content-right').getChildren(), { show: show - 1 });
	}

};

site.fleet = site.services;
site.links = site.services;

window.addEvent('domready', function(){
	var href = document.location.href.split('/');
	site.initialize(href[href.length-1].split('.')[0]);
});

function launch(loc){ document.location = loc + '.php'; }

