function openWindow(url)
{
		openwin = this.open(url,"ctrlwindow","width=300,height=260,toolbar=no,scrollbars=no,resizable=no");
		openwin.focus();
}


function openMailinglist(id)
{
	var url = '/nieuwsbrief.php?id='+id;
	openwin = this.open(url,"ctrlwindow","width=810,height=500,toolbar=no,scrollbars=yes,resizable=no");
	openwin.focus();
}


/**
 * Swap Image
 * @param ImageID
 * @param new imagesource (optional)
 * @example <img src="myimage_up.jpg" onmouseover="swapImage(this)" />  //Swaps myimage_up.jpg voor myimage_over.jpg
 *          <a href="javascript:void();" onmouseover="swapImage('myImage', 'my_other_image.png')"><img src="myimage.jpg" id="myImage" /></a>  // Swaps myimage.jpg voor my_other_image.png
 */
function swapImage(myID, newSrc)
{
	var strOver  = "_over";
	var strOff = "_up";

	if(typeof myID != 'object')
		var oImg = document.getElementById(myID);
	else
		var oImg = myID;
   
   if(newSrc)
   {
	   oImg.src = newSrc;
	   return;
   }
   
   
	var currImg = oImg.src;

	if (currImg.indexOf(strOver) != -1)
		oImg.src = currImg.replace(strOver,strOff)
	else
		oImg.src = currImg.replace(strOff,strOver)
}


function picture(myID)
{
	var strThumb = '_thumb';
	var strLarge = '_large';
	
	if(typeof myID != 'object')
		var oImg = document.getElementById(myID);
	else
		var oImg = myID;

	var currImg = oImg.src;
	currImg = currImg.replace(strThumb, strLarge);
		

	img = new Image();
	img.src = currImg;
	setTimeout('javascript:void()', 500);
	var width = img.width;
	var height = img.height;

	if(height == 0)
		height = 320;
	if(width == 0)
			width = 426;

	var imageString = '<img src="' + currImg + '" width="' +  width + '" height="' +  height + '" alt="">';
	var openwin = this.open('',"ctrlwindow","width=" + width + ",height=" + height + ",toolbar=no,scrollbars=no,resizable=yes");
	
	openwin.document.open();
	openwin.document.write('<html><head><title>Afbeelding</title><style type="text/css">body{margin:0;padding:0;}</style></head><body>' + imageString + '</body></html>')
	openwin.document.close();
	openwin.focus();
}



/**
 * Zet menu afbeelding voor huidige pagina
 */
function setImage()
{ 
	if (!document.getElementsByTagName)
		return; 

	var currUrl = document.location.href;
	var images = document.getElementsByTagName("img"); 
	for (var i=0; i<images.length; i++)
	{ 
		var href = images[i].parentNode.getAttribute("href");
		if(currUrl.indexOf(href)!= -1)
		{
			swapImage(images[i]);
		}
	} 
}
window.onload = setImage;



function hide(hide)
{
	body = document.getElementsByTagName('body');

	if(hide == hide)
		body[0].style.visibility='hidden';
	else
		body[0].style.visibility='visible';
	
}