// JavaScript Document
function rescaleImage()
{	for(var a=0; a<arrayImages.length; a++)
	{	myImage = new Image();
		myImage.src = "http://www.interforcecms.nl"+arrayImages[a];
		
		width = myImage.width;
		height = myImage.height;
		
		var documentImg = document.getElementById("imageNr"+a);
		
		if(myImage.width>120)
		{	documentImg.style.display = 'none';
			documentImg.src = myImage.src;
			getFactor();				
			documentImg.width= newWidth();
			documentImg.height= newHeight();			
		
		}else
		{	documentImg.src = myImage.src;	
			documentImg.width = width;
			documentImg.height = height;
		}
		document.getElementById("imageNr"+a).style.display = 'block';
	}	
}

function openWindow(image)
{	myImage = new Image();
	var url = "http://www.andrevanzoest.nl/";
	myImage.src = url+image;
	
	var myWindow = window.open("", "", 'toolbar=0, width='+(myImage.width+20)+ ', height='+(myImage.height+20)+ ''); 
	myWindow.document.write('<img src="'+url+image+'" border="0" />');
	myWindow.document.close();
}
function getFactor()
{	factor = ((120*100)/width)/100; }

function newWidth()
{	var wd = Math.round(width * factor);
	return wd;
}
function newHeight()
{	var ht = Math.round(height * factor);
	return ht;
}