if (document.getElementById('submenu'))
{
	var plinks = document.getElementById('submenu').getElementsByTagName('div');
	
	// iets te veel divs
	
	for (i = 0; i < plinks.length; i++)
	{
		if (plinks[i].id.indexOf('pakket') != -1) // alleen pakket divs pakken
		{
			plinks[i].onclick = function ()
			{
				document.location.href = this.getElementsByTagName('a')[0].href;
				return false;
			}
			
			plinks[i].onmouseover = function ()
			{
				this.style.cursor = 'pointer';
				this.getElementsByTagName('div')[0].style.backgroundColor = '#FCB814';
			}
			plinks[i].onmouseout = function ()
			{
				if (this.className != 'current')
				{
					this.getElementsByTagName('div')[0].style.backgroundColor = '#FFFFFF';
				}
			}			
		}
	}
}

document.getElementById('infolink').onclick = function ()
{
	if (document.getElementById('infosubmenu').style.display == 'block')
	{
		document.getElementById('infosubmenu').style.display = 'none';
		this.className = '';
	}
	else
	{
		document.getElementById('infosubmenu').style.display = 'block';
		this.className = 'current';
	}
	return false;
}

var imgs = document.getElementById('kolright').getElementsByTagName('img');
for (i = 0; i < imgs.length; i++)
{
	if (document.getElementById('content').getElementsByTagName('img')[0] && imgs[i].className == 'bbpic')
	{
		imgs[i].onclick = function ()
		{
			if (document.getElementById('content').getElementsByTagName('img')[0])
			{
				document.getElementById('content').getElementsByTagName('img')[0].src = this.src;
				window.scrollTo(0, 0);
			}
		}
		imgs[i].onmouseover = function () 
		{
			if (document.getElementById('content').getElementsByTagName('img')[0])
			{
				this.style.cursor = 'pointer';
				this.title = 'Klik voor grotere versie';
			}
		}
	}
	if (imgs[i].src.indexOf('cover') != -1)
	{
		imgs[i].onclick = function ()
		{
			var gids = this.id.substr(5,this.id.length);
			dogids(gids,'innercontent');
		}
		
		imgs[i].onmouseover = function () 
		{
			this.style.cursor = 'pointer';
			this.title = 'Klik om de brochure aan te vragen';
		}
	}
}

function show_boekknop ()
{
	if (document.getElementById('prijstab').innerHTML.length > 100)
	{
		document.getElementById('boekknop').style.display = 'block';
	}
}


if (document.getElementById('prijstab'))
{
	// hier ff regelen dat prijstab geladen wordt
	var soid = document.getElementById('placeholderprijstab').innerHTML; // s_pakket_id hebben we in de div staan
	document.getElementById('placeholderprijstab').innerHTML = ''; // div leeg maken
	
	tn_xml2div('prijstab','print_prijstab','spid='+soid,'show_boekknop()'); // request doen :)
	document.getElementById('placeholderprijstab').style.visibility='hidden';
	
// Zorgen dat rechter kolom over de prijstab valt bij hover	
	document.getElementById('kolright').onmouseover = function ()
	{
		if (document.getElementById('prijstab'))
		{
			if (document.getElementById('prijstab').offsetWidth +24 > document.getElementById('kolmid').offsetWidth)
			{
				document.getElementById('prijstab').style.width = document.getElementById('kolmid').offsetWidth -24;
				document.getElementById('prijstab').style.overflowX = 'hidden';
			}
			if (navigator.userAgent.indexOf("MSIE") == -1) // FF snapt bovenstaande niet
			{
				document.getElementById('prijstab').style.display = 'none';
				document.getElementById('placeholderprijstab').style.visibility='visible';
			}
		}	
	}
// en weer terugkomt	
	document.getElementById('kolright').onmouseout = function ()
	{
		if (document.getElementById('prijstab'))
		{
			document.getElementById('prijstab').style.overflowX = 'visible';
			document.getElementById('prijstab').style.width = document.getElementById('placeholderprijstab').style.width;
			if (navigator.userAgent.indexOf("MSIE") == -1)
			{
				document.getElementById('prijstab').style.display = 'block';
				document.getElementById('placeholderprijstab').style.visibility='hidden';
			}
		}
	}
}

document.getElementById('logo').onclick = function ()
{
	document.location.href='/';
}

if (document.getElementById('pakketten'))
{
	var plijst = document.getElementById('pakketten').getElementsByTagName('div');
	for (i = 0; i < plijst.length; i++)
	{
		if (plijst[i].className == 'pakketlijstitem')
		{
			plijst[i].onmouseover = function ()
			{
				this.oldbgc = this.style.backgroundColor;
				this.style.backgroundColor = '#FCB814';
				this.style.cursor = 'pointer';
			}
			
			plijst[i].onmouseout = function ()
			{
				this.style.backgroundColor = this.oldbgc;
			}
			
			plijst[i].onclick = function () 
			{
				if (this.getElementsByTagName('a')[0])
				{
					document.location.href= this.getElementsByTagName('a')[0].href;
				}
			}
			
			
		}
	}
}


