if ($('eml') && $('naam'))
{
	$('eml').onfocus = function()
	{
		this.value = '';
	}
	$('naam').onfocus = function()
	{
		this.value = '';
	}
}

if ($('news'))
{
	var ads = $('news').getElementsByTagName('li');
	for (i = 0; i < ads.length; i++)
	{
		ads[i].onmouseover = function()
		{
			this.old = this.style.backgroundColor;
			this.oldi = this.style.backgroundImage;
			this.style.backgroundColor = '#4C5458';
			this.style.backgroundImage = 'none';
		}
		
		ads[i].onmouseout = function()
		{
			this.style.backgroundColor = this.old;
			this.style.backgroundImage = this.oldi;
		}
		
		ads[i].onclick = function()
		{
			document.location.href = this.getElementsByTagName('a')[0].href;
			return false;
		}
	}	
}

var ads = $('kleft').getElementsByTagName('div');
for (i = 0; i < ads.length; i++)
{
	if (ads[i].className == 'item')
	{
		ads[i].onmouseover = function()
		{
			this.old = this.style.backgroundColor;
			this.style.backgroundColor = '#4C5458';
		}
		
		ads[i].onmouseout = function()
		{
			this.style.backgroundColor = this.old;
		}
		
		ads[i].onclick = function()
		{
			document.location.href = this.getElementsByTagName('a')[0].href;
			return false;
		}
	}
}

var ads = $('kright').getElementsByTagName('div');
for (i = 0; i < ads.length; i++)
{
	if (ads[i].className == 'item')
	{
		ads[i].onmouseover = function()
		{
			this.old = this.style.backgroundColor;
			this.opic = $('pic3').src;
			if (this.getElementsByTagName('img').length != 0)
			{
				$('pic3').src = this.getElementsByTagName('img')[0].src;
			}
			this.style.backgroundColor = '#4C5458';
		}
		
		ads[i].onmouseout = function()
		{
			this.style.backgroundColor = this.old;
			$('pic3').src = this.opic;
		}
		
		ads[i].onclick = function()
		{
			document.location.href = this.getElementsByTagName('a')[0].href;
			return false;
		}
	}
}

var ads = $('ex').getElementsByTagName('div');
for (i = 0; i < ads.length; i++)
{
	if (ads[i].className == 'item')
	{
		ads[i].onmouseover = function()
		{
			this.old = this.style.backgroundColor;
			this.oldi = this.style.backgroundImage;
			this.style.backgroundColor = '#262B2C';
			this.style.backgroundImage = 'none';
		}
		
		ads[i].onmouseout = function()
		{
			this.style.backgroundColor = this.old;
			this.style.backgroundImage = this.oldi;
		}
		
		ads[i].onclick = function()
		{
			document.location.href = this.getElementsByTagName('a')[0].href;
			return false;
		}
	}
}

imgs = document.getElementsByTagName('img');
for (i = 0; i < imgs.length; i++)
{
	imgs[i].onerror = function()
	{
		this.style.display = 'none';
	}
}

if ($('pic1').src.indexOf('rub_') != -1)
{
	$('pic1').style.cursor = 'pointer';
	$('pic1').onclick = function()
	{
		this.rid = parseInt(this.src.substr(this.src.indexOf('_')+1, 2));
		document.location.href = '/reizen/' + this.rid + '/' + escape(this.alt) + '.html';
	}
}

if ($('pic2').src.indexOf('rub_') != -1)
{
	$('pic2').style.cursor = 'pointer';
	$('pic2').onclick = function()
	{
		this.rid = parseInt(this.src.substr(this.src.indexOf('_')+1, 2));
		document.location.href = '/reizen/' + this.rid + '/' + escape(this.alt) + '.html';
	}
}

$('head').onclick = function()
{
	document.location.href = '/';
}

if ($('pagenav'))
{
	$('pagenav').getElementsByTagName('h3')[0].onmouseover = function()
	{
		$('winkels').style.display = 'block'
	}
	$('winkels').onmouseover = function()
	{
		$('winkels').style.display = 'block';
		$('rubrieken').style.display = 'none';
		clearTimeout(window.wtimer);
	}

	$('winkels').onmouseout = function()
	{
		window.wtimer = setTimeout("$('winkels').style.display = 'none'",300);
	}
	
	new Ajax.Updater($('winkels'), "/engine.php?func=winkels",
	{
		method: "post"
	});	
	
	
	$('pagenav').getElementsByTagName('h3')[1].onmouseover = function()
	{
		$('rubrieken').style.display = 'block';
	}
	
	$('rubrieken').onmouseover = function()
	{
		$('rubrieken').style.display = 'block';
		$('winkels').style.display = 'none';
		clearTimeout(window.rtimer);
	}
	
	$('rubrieken').onmouseout = function()
	{
		window.rtimer = setTimeout("$('rubrieken').style.display = 'none'",300);

	}
	
	
	new Ajax.Updater($('rubrieken'), "/engine.php?func=rubrieken",
	{
		method: "post"
	});
	
	
	
	
}

if ($('kmap') || $('map'))
{
	window.onload= load;
	window.onunload = GUnload;	
}
 