var Controller = new Class({
	
	initialize : function(opened)
	{
		$$('.projectButton').each
		(
			function(e){
				new ProjectButton(e,this);	
			}.bind(this)
			
		);
		
		$$('.eventButton').each
		(
			function(e){
				new EventButton(e,this);	
			}.bind(this)
			
		);
		
		new NewsletterButton($('newsletterButton'),this);
		new HomeButton($('homeButton'),this);
		
		var o = opened == 'false' ? false : true ; 
		new Drawer($('projectsBodyContainer'), this, o);
		
		
		$$('.moreButton').each
		(
			function(e){
				new MoreButton(e,this);	
			}.bind(this)
			
		);
		
		Rounded("a.moreButton","transparent", "#ffffff");
		
		$$('.downloadButton').each
		(
			function(e){
				new DownloadButton(e,this);	
			}.bind(this)
			
		);
		Rounded("a.downloadButton","transparent", "#ffffff");
		
		
		$('lineContainer').setStyle('overflow','visible');
		$('lineContainer').setStyle('height','auto');
		
		
	},
	
	doEvent : function(event, instance)
	{
		switch(event)
		{
			case 'gotoLocation':
				instance.gotoLocation();
			break;
			case 'toggleProjects':
				instance.drawer.toggleDrawer();
			break;
		}
	}
})

