function direct(id, type)
{
	if(type == 'show')
	{
		document.getElementById(id).style.display = 'block';
	} else
	{
		document.getElementById(id).style.display = 'none';
	}
}

/*var selectbox = function(input, value, option) {
	
	this.input = input;
	this.value = value;
	this.option = option;
	this.action = '';
	
	this.box = function(method) {
		this.action = method;
	}
	
	this.choice = function(label, value) {
		document.getElementById(this.value).innerHTML = label;
		document.getElementById(this.input).value = value;
		
		this.action = 'hide';
	}
	
	this.hyperlink = function(label, url) {
		location.href = url;
	}
	
	this.show = function() {
		
		if(this.action == 'show') {
			document.getElementById(this.option).style.display = 'block';
			this.action = 'hide';
		}
		else if(this.action == 'hide') {
			document.getElementById(this.option).style.display = 'none';			
		}
	}
	
}*/

var action = true;
var active = new Array('');

function showmenu(id, niveau)
{
	if(action)
	{		
		action = false;
		delay = 0;
		down = true;
		
		for(i = 0; i < active.length; i++)
		{						
			if(niveau <= i && active[i] && active[i] != null)
			{				
				if(active[i] == id)
				{
					down = false;					
				}
				
				new Effect.BlindUp(active[i], 
				{
					delay: delay,
					duration:0.1,
					beforeStart: function() 
					{
						delay += 0.1;
					}
				});
				if(i == 0)
				{
					Event.stopObserving(document.body, 'click');
				}
				active[i] = null;
			}
		}
		
		if(down)
		{
			new Effect.BlindDown(id, 
			{
				duration:0.1,
				delay: delay,
				afterFinish: function() 
				{
					active[niveau] = id;
					action = true;
					if(niveau == 0)
					{
						Event.observe(document.body, 'click', function() { showmenu(id, niveau); });
					}
				}
			});
		}
		else
		{
			action = true;
		}
	}
}


var actief = '';

function plaats(id) {
	
	if(actief == '') {
		if(id == 'dordrecht') {
			$('route-dordrecht').style.display = 'block';
		}
		$('afbeelding_container').style.styleFloat = "right";
		$('afbeelding_container').style.cssFloat = "right";
		$(id).style.display = 'block';
		$('pand').src = 'images/template/pand_'+id+'.jpg';
		actief = id;
	} else {
		if(id == 'dordrecht') {
			$('route-dordrecht').style.display = 'block';
		} else {
			$('route-dordrecht').style.display = 'none';
		}
		$('afbeelding_container').style.styleFloat = "right";
		$(actief).style.display = 'none';
		$(id).style.display = 'block';
		$('pand').src = 'images/template/pand_'+id+'.jpg';
		actief = id;
	}
	
}

function src(afbeelding,actie) {
	
	if(actie == 'show') {
	
		$('vestiging').src = 'images/template/'+afbeelding+'.jpg';
	
	} else if(actie == 'hide') {
	
		$('vestiging').src = 'images/template/vestigingen.jpg';
	
	}
	
}

/* OTHER LANGUAGES */
de_actief = '';
function plaats2(id) {
	
	if(de_actief == '') {
		$('afbeelding_container').style.styleFloat = "right";
		$('afbeelding_container').style.cssFloat = "right";
		$(id).style.display = 'block';
		$('pand').src = '../images/template/pand_'+id+'.jpg';
		de_actief = id;
	} else {
		$(de_actief).style.display = 'none';
		$(id).style.display = 'block';
		$('pand').src = '../images/template/pand_'+id+'.jpg';
		de_actief = id;
	}
	
}

function src2(afbeelding,actie) {
	
	if(actie == 'show') {
	
		$('vestiging').src = '../images/template/'+afbeelding+'.jpg';
	
	} else if(actie == 'hide') {
	
		$('vestiging').src = '../images/template/vestigingen.jpg';
	
	}
	
}

en_actief = '';
function plaats3(id) {
	
	if(en_actief == '') {
		$('afbeelding_container').style.styleFloat = "right";
		$('afbeelding_container').style.cssFloat = "right";
		$(id).style.display = 'block';
		$('pand').src = '../images/template/pand_'+id+'.jpg';
		en_actief = id;
	} else {
		$(en_actief).style.display = 'none';
		$(id).style.display = 'block';
		$('pand').src = '../images/template/pand_'+id+'.jpg';
		en_actief = id;
	}
	
}

function src3(afbeelding,actie) {
	
	if(actie == 'show') {
	
		$('vestiging').src = '../images/template/'+afbeelding+'.jpg';
	
	} else if(actie == 'hide') {
	
		$('vestiging').src = '../images/template/vestigingen.jpg';
	
	}
	
}

