
var Controller = new Class({

	initialize: function()
	{
		
		//$$('body .ttfLink').each(function(e){new ttfLink(e);});
		$$('body .imageLink').each(function(e){new imageLink(e);});	
		if($('slideshowMain'))new Slideshow($('slideshowMain'));
		//preload(PATH.root + '/_img/logo_stjoost_over.gif');
		//preload(PATH.root + '/_img/logo_avans_over.gif');
	},
	
	doAction: function(action, instance)
	{
		VO.action =  action;
		this.instance = instance;
		this.url = PATH.root + PATH.site + 'php/do.php';

		switch(action)
		{
			case 'doSomething':
			break;
			default:
				alert(action);
		}
	},
	
	afterRequest:function(rT, rE, rH, rJ)
	{
		VO.checkSession = false;

		switch(VO.action)
		{
			case 'doSomething':
			break;
			default:
			alert(rH);
		}
	},
	
	doRequest:function(type)
	{
		switch(type)
		{
			case 'html':
				new Request.HTML({url:this.url, update:this.update, data:VO, onComplete:function(rT, rE, rH, rJ){this.afterRequest(rT, rE, rH, rJ);}.bind(this) }).send();
				break;
			default:
				new Request({url:this.url, data:VO, onComplete:function(rT, rE){this.afterRequest(rT, rE);}.bind(this) }).send();
		}
	}
	
})


function preload(s)
{
	i = new Image();
	i.src = s;
}



function swap(e, s)
{
	e.src = s;
}
