
function ClassResultaatlijst()
{
	this.Interval = false
	this.Overlay = false
	this.ZoomToFit = true
	
	this.Initialize = function(oKaart)
	{
		this.Kaart = oKaart
		if (document.getElementById('MarkerSpan') && document.getElementById('NumbersSpan'))
		{
			this.SetResultaatlijstFromAtlas()
		}
		this.Interval = setInterval("Resultaatlijst.CheckPagina()", 250)
	}
	
	this.Set = function(xMin, xMax, yMin, yMax, sHTML)
	{
		this.xMin = xMin
		this.xMax = xMax
		this.yMin = yMin
		this.yMax = yMax

		var rectBounds = new GLatLngBounds
		(
			new GLatLng(yMin, xMin),
			new GLatLng(yMax, xMax)
		
		)
		
		//alert(this.xMin + ', ' + this.yMin + ' - ' + this.xMax + ', ' + this.yMax)
		//alert(sHTML)

        this.Clear()
        this.Overlay = new ClassRectangle(rectBounds, sHTML)
		GoogleMap.addOverlay(this.Overlay)

        if (this.ZoomToFit == true)		
        {
    		vlak = new GLatLngBounds(new GLatLng(yMin, xMin), new GLatLng(yMax, xMax))
    		z = GoogleMap.getBoundsZoomLevel(vlak);
    		GoogleMap.setCenter(new GLatLng((yMin + yMax)/2, (xMin + xMax)/2), z)
		}
        this.ZoomToFit = false

		this.Loaded = true
        document.getElementById('Loading').style.display = 'none'
	}
	
	this.Clear = function()
	{
        if (this.Overlay) this.Overlay.remove()
	}

	this.SetResultaatlijstFromAtlas = function()
	{
		Tooltip.Close()
		var html = document.getElementById('MarkerSpan').innerHTML
		var nummers = document.getElementById('NumbersSpan').innerHTML.split(',')
		yMin = nummers[0]*1
		yMax = nummers[1]*1
		xMin = nummers[2]*1
		xMax = nummers[3]*1
		this.Set(xMin, xMax, yMin, yMax, html)
		this.versieNummer = document.getElementById('VersienummerSpan').innerHTML
	}
	
	this.CheckPagina = function()
	{
		if (this.versieNummer != document.getElementById('VersienummerSpan').innerHTML)
		{
			this.SetResultaatlijstFromAtlas()
		}
	}
		
}