armaturen = new Array()
armaturen[armaturen.length] = { code: "lvz-K-Lumis-LED", foto: "K-Lumis-LED.jpg" }
armaturen[armaturen.length] = { code: "php-DBlauw-Christalled", foto: "DBlauw-Christalled.jpg" }
armaturen[armaturen.length] = { code: "php-DGroen-ResidiumFortimo", foto: "DGroen-ResidiumFortimo.jpg" }
armaturen[armaturen.length] = { code: "php-Geel-UrbanLine", foto: "Geel-UrbanLine.jpg" }
armaturen[armaturen.length] = { code: "php-LBlauw-ST03", foto: "LBlauw-ST03.jpg" }
armaturen[armaturen.length] = { code: "php-LGroen-Altra", foto: "LGroen-Altra.jpg" }
armaturen[armaturen.length] = { code: "php-Magenta-STELA", foto: "Magenta-STELA.jpg" }
armaturen[armaturen.length] = { code: "php-MGroen-Altra", foto: "MGroen-Altra.jpg" }
armaturen[armaturen.length] = { code: "php-Oranje-BK", foto: "Oranje-BK.jpg" }
armaturen[armaturen.length] = { code: "php-Paars-CitySpirit", foto: "Paars-CitySpirit.jpg" }
armaturen[armaturen.length] = { code: "php-Rood-DisQ", foto: "Rood-DisQ.jpg" }
armaturen[armaturen.length] = { code: "php-Roze-STELA", foto: "Roze-STELA.jpg" }
armaturen[armaturen.length] = { code: "php-miniiridium", foto: "miniiridiumled.jpg" }
armaturen[armaturen.length] = { code: "php-ledwayroad", foto: "ledwayroad.jpg" }

// Constanten
var InfoWegInterval = 30000
var PlaatjesDirectory = '/Portals/0/Kaartplaatjes/'

// Variabelen
var infopaneelZichtbaar = false
var infoWegTimerId = -1

function info(code)
{
	TimerUitschakelen(infoWegTimerId)
	
	var armatuur = ArmatuurVinden(code)
	if (armatuur == null) {return;}
	
	InfopaneelTonen()
	FotoTonen(code)
}

function FotoTonen(code)
{
	var armatuur = ArmatuurVinden(code)
	if (armatuur == null) {return;}
	
	fotoImg().src = PlaatjesDirectory + armatuur.foto
}

function infoWeg()
{
	TimerUitschakelen(infoWegTimerId)
	infoWegTimerId = setInterval(infoWegTimerfunctie, InfoWegInterval)
}

function infoWegTimerfunctie()
{
	TimerUitschakelen(infoWegTimerId)
	InfopaneelVerbergen()
}

function ArmatuurVinden(code)
{
	var hit = null
	for (var index = 0; hit == null && index < armaturen.length; index++)
	{
		if (armaturen[index].code == code)
			hit = armaturen[index]
	}
	return hit
}

function InfopaneelTonen()
{
	if (!infopaneelZichtbaar)
	{
		 new Effect.Opacity('infopaneel', {duration: 1.5, from:0.0, to:1.0})
		 infopaneelZichtbaar = true
	}
}

function InfopaneelVerbergen()
{
	if (infopaneelZichtbaar)
	{
		new Effect.Opacity('infopaneel', {duration: 1.5, from:1.0, to:0.0})
		infopaneelZichtbaar = false
	}
}

function infopaneel()
{
	return document.getElementById("infopaneel")
}

function fotoImg()
{
	return document.getElementById('infofoto')
}

function TimerUitschakelen(timerID)
{
	if (timerID != -1)
	{
		clearInterval(timerID)
		timerID = -1
	}
}


