﻿/*
Hampelman - http://www.hampelman.nl/
wishes to thank
Scott Andrew - http://scottandrew.com/
for parts of this script
*/
// Event Listener
// by Scott Andrew - http://scottandrew.com/
function addEvent(obj, evType, fn)
	{
	if (obj.addEventListener)
		{
		obj.addEventListener(evType, fn, false); 
		return true;
		}
	else if (obj.attachEvent)
		{
		var r = obj.attachEvent('on'+evType, fn);
		return r;
		}
	else
		{
		return false;
		}
	}

// from your man at http://www.kryogenix.org/

addEvent(window, "load", pushCarous);
addEvent(window, "resize", pushCarous);

function pushCarous(e)
{
	
	// check this browser can cope with what we want to do
	if (!document.getElementById) return;
	var car = document.getElementById('left');
	if (!car) return;
	var wrap = document.getElementById('top');
	if (!wrap) return;
	var left = document.getElementById('leftmenu');
	if(!left) return;
	if (!wrap.offsetWidth) return;
	// if div#top is wide enough to hold both div#carous and the picture
	if (wrap.offsetWidth >= 987)
		{
		// push carous a little down
		car.style.top = '0';
		left.style.top = '30px';
		}
	
	// if div#top is to narrow
	else
		{
		car.style.top = '120px';
		left.style.top = '-2px';
		}
}

function openPic(w, h, fold, naam, omschrijving){
	//opent een nieuw window met de foto 'naam' uit de folder 'fold' 
		fotoWin = window.open('/foto.php?fold='+fold+'&naam='+naam+'&oms='+omschrijving,'Foto','width='+w+ ', height='+h);
		fotoWin.focus();
}
