if(typeof sIFR == "function"){
    sIFR.replaceElement("h1", named({sFlashSrc: "/images/Barmeno_bold.swf", sColor: "#ED2667", sCase: "normal", sWmode: "transparent"}));
    sIFR.replaceElement("h2", named({sFlashSrc: "/images/Barmeno_bold.swf", sColor: "#DDDDDD", sCase: "normal", sWmode: "transparent"}));
    //sIFR.replaceElement("span", named({sFlashSrc: "/images/Barmeno.swf", sColor: "#404040", sCase: "normal", sWmode: "transparent"}));
    
};

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

function get_land(vid) { // requires vid=div id, vfunc = function, vvars=vars

	var xmlhttp = getHTTPObject();
	xmlhttp.open("GET", "/engine.php?func=get_land&id="+vid,true); // Open verbinding via GET, via deze URL en communiceer asynchroon
	xmlhttp.onreadystatechange = function()  { 
    	if (xmlhttp.readyState == 4) 
    	{
        	document.getElementById('landen' + vid).innerHTML =  xmlhttp.responseText; // geef de data weer in een dialoogvenster
   			eval('do_best(' + vid + ')');
    	}
    }
	xmlhttp.send(null) // Verstuur de request
}



function get_best(vid) { // requires vid=div id, vfunc = function, vvars=vars

	var xmlhttp = getHTTPObject();
	xmlhttp.open("GET", "/engine.php?func=get_best&id="+vid,true); // Open verbinding via GET, via deze URL en communiceer asynchroon
	xmlhttp.onreadystatechange = function()  { 
    	if (xmlhttp.readyState == 4) 
    	{
        	document.getElementById('bests' + vid).innerHTML =  xmlhttp.responseText; // geef de data weer in een dialoogvenster
   			//eval('do_best()');
    	}
    }
	xmlhttp.send(null) // Verstuur de request
}



var landen = document.getElementById('menu').getElementsByTagName('a');

for (i = 1; i < landen.length; i++)
{
	if (landen[i].id.indexOf('land') != -1)
	{
		landen[i].onclick = function()
		{
			return false;
		}
		landen[i].onmouseover = function()
		{
			this.style.cursor = 'normal';
		}		
		if (landen[i].className != 'current')
		{
			get_land(landen[i].id.substr(4,landen[i].id.length));
		}
	}
}
do_best();
function do_best()
{
	var bests = document.getElementById('menu').getElementsByTagName('a');
	
	for (i = 0; i < bests.length; i++)
	{
		if (bests[i].id.indexOf('best') != -1)
		{
			bests[i].onclick = function()
			{
				this.rid = this.id.substr(4,this.id.length);
				//alert(this.rid);
				get_best(this.rid);
				if (document.getElementById('bests'+this.rid).style.display == 'block')
				{
					document.getElementById('bests'+this.rid).style.display = 'none';
				}
				else
				{
					document.getElementById('bests'+this.rid).style.display = 'block';
				}
				return false;
			}
		}
	}	
	
}

if (document.getElementById('tos'))
{
	var tobs = document.getElementById('tos').getElementsByTagName('div');
	var isIE = (navigator.userAgent.indexOf("MSIE") > -1);

	for (i = 0; i < tobs.length; i++)
	{
		if (tobs[i].className == 'blok')
		{
			
			tobs[i].onmouseover = function ()
			{
				window.status = 'Boek nu bij ' + this.getElementsByTagName('a')[0].title;
				this.style.cursor = 'pointer';
				this.oldi = this.getElementsByTagName('div')[0].innerHTML;
				this.oldbg = this.style.backgroundColor;
				this.style.backgroundColor = '#FFFFFF';
				this.getElementsByTagName('a')[0].style.color = '#ED2667';
				return true;
			}
			tobs[i].onmouseout = function ()
			{
				window.status = '';
				this.style.backgroundColor = this.oldbg;
				this.getElementsByTagName('a')[0].style.color = this.style.backgroundColor;
			}
			tobs[i].onclick = function()
			{
				window.open(this.getElementsByTagName('a')[0].href);
				return false;
			}
		}
	}
}
