// void
var landen = document.getElementById('index').getElementsByTagName('a');
var landdone = new Array();
for (i=0; i< landen.length; i++)
{
	landen[i].onclick = function ()
	{
		var landid = this.href.substr(this.href.lastIndexOf('-')+1,this.href.length-this.href.lastIndexOf('-')-6);
		var bestdisplay = document.getElementById('land'+landid).style;
		
		if (bestdisplay.display != 'block')
		{
			if (!landdone[landid])
			{
				document.getElementById('wintersport').src = '/_engine.php?s_page_id=' + landid;
			}
			bestdisplay.display = 'block';
			landdone[landid] = true;
		}
		else
		{
			bestdisplay.display = 'none'
		}
		return false;
	}
	
	landen[i].onmouseover = function() 
	{	
		window.status = '';
		return true;
	}
}


function getHTTPObject() {
    var xmlhttp = false;

    
 	if (window.ActiveXObject)
 	{
     	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 	}
 	else
    {
        xmlhttp = new XMLHttpRequest();
    }
    return xmlhttp;
}

function update(vid) { 
	var xmlhttp = getHTTPObject();
	xmlhttp.open("GET", "/_update.php?id="+vid,true); // Open verbinding via GET, via deze URL en communiceer asynchroon
	xmlhttp.send(null) // Verstuur de request
}


if (document.getElementById('accolist') && document.getElementById('accolist').getElementsByTagName('div').length > 0)
{
	var adivs = document.getElementById('accolist').getElementsByTagName('div');
	for (i = 0; i < adivs.length; i++)
	{
		if (adivs[i].className == 'accolistitem')
		{
			adivs[i].onmouseover = function ()
			{
				this.style.cursor = 'pointer';
				this.oldbg = this.style.backgroundColor;
				this.style.backgroundColor = '#55B8F2';
				this.title = "Klik voor reisorganisaties die " + this.getElementsByTagName('a')[0].innerHTML + " aanbieden";
			}
			adivs[i].onmouseout = function ()
			{
				this.style.backgroundColor = this.oldbg;
			}
			adivs[i].onclick = function ()
			{
				if (this.getElementsByTagName('a')[0])
				{

					document.location.href = this.getElementsByTagName('a')[0].href;
				}
				if (this.getElementsByTagName('img').length != 0 && this.getElementsByTagName('u').length != 0)
				{
					update(this.id.substr(4,this.id.length));
				}
			}
		}
	}
}

if (document.getElementById('watisqr'))
{
	document.getElementById('watisqr').onclick = function()
	{
		document.getElementById('popup').innerHTML = '<div id="qr">Dit is een QR code. Met de meeste moderne mobiele telefoons (met camera) kunt u met een barcode reader deze code lezen. U kunt zo als u op werk of elders zit en een leuke aanbieding ziet, de url snel opslaan in uw telefoon om vervolgens thuis rustig te boeken.	<br />Beschikt uw telefoon nog niet over een barcode scanner? Download deze dan <a href="http://reader.kaywa.com/getit" target="_blank"><u>hier</u></a><br /><br /><a href="#" onclick = "close_pop();return false">sluiten</a></div>';
		document.getElementById('popup').style.display = 'block';
		document.getElementById('popup').style.top = document.body.clientHeight - 200 +'px';
				
		return false;
	}
}

function close_pop()
{
	document.getElementById('popup').style.display = 'none';
	return false;
}



//document.getElementById('reacties').style.display = 'none';