var imgArray = new Array(12);
var activeLink = '';

function switchPic(handle, pic)
{	
		if (activeLink != handle)
			document.getElementById(handle).src = 'pictures/'+pic;
};

function preLoadImg()
{
	imgArray[0] = "pictures/up_index.png";
	imgArray[1] = "pictures/over_index.png";
	imgArray[2] = "pictures/down_index.png";
	imgArray[3] = "pictures/up_cartoons.png";
	imgArray[4] = "pictures/over_cartoons.png";
	imgArray[5] = "pictures/down_cartoons.png";
	imgArray[6] = "pictures/up_totaal.png";
	imgArray[7] = "pictures/over_totaal.png";
	imgArray[8] = "pictures/down_totaal.png";
	imgArray[9] = "pictures/up_atelier.png";
	imgArray[10] = "pictures/over_atelier.png";
	imgArray[11] = "pictures/down_atalier.png";
	imgArray[11] = "pictures/up_gastenboek.png";
	imgArray[11] = "pictures/over_gastenboek.png";
	imgArray[11] = "pictures/down_gastenboek.png";

	if (document.images )
	{
		tmp_image = new Image(80,80);
		
		for (i=0; i<imgArray.length; i++)
		{
			tmp_image.src = imgArray[i];
		}
	}
};

function setActive(handle)
{
	activeLink = '';
	preLoadImg();
	switchPic(handle, 'down_' + handle + '.png');
	activeLink = handle;
};

function clicked(handle)
{
	if(handle != 'atelier')
	{
		var tmp = activeLink; //vorige aangelikte item
		activeLink = ""; 
		switchPic(tmp, 'over_'+tmp+'.png'); //plaats grijs plaatje terug
		switchPic(handle, 'down_'+handle+'.png'); // maak nieuwe blauw
		if (handle == "gastenboek") {
			document.location.replace(handle + '.html');
		}
		else {
						document.location.replace(handle + '.php');
		}
		activeLink = handle;	//pas na het verwisselen doen want anders wordt niet gewisseld!
	}
	else
	{
		document.location.replace(handle + '.php');
		activeLink = handle;
	}		
};


