	var scrolled = 0;
	var currentthumb = 0;
	var currentcategory;
	var posx;
	var posy;

	Event.observe(
		window, 'load', function(e) {
			startList(e);
		}
	);

	function photo_tooltipShow(td){
		photo = td.getElementsByTagName('img');
		for (i=0; i<photo.length; i++) {
			photo[i].style.display='inline';
		}
	}
	
	function photo_tooltipHide(td){
		photo = td.getElementsByTagName('img');
		for (i=0; i<photo.length; i++) {
			photo[i].style.display='none';
		}
	}


	function moveThumbs(elmnt){
		newpic = foto_array[elmnt][0];
		var eIndex;
		var scrollAmount = 65;
		var thumbs = document.getElementById('thumbnail_container').getElementsByTagName('div');
		for(var i=0;i<thumbs.length;i++){
			if(i==elmnt){
				eIndex = i;
			}
		}
		
		var scrollBy = (-(eIndex-scrolled))*scrollAmount;
		new Effect.Move (document.getElementById('thumbnail_container'),{ x: scrollBy, mode: 'relative',queue: 'end'});
		scrolled += eIndex-scrolled;

		for(var i=0;i<thumbs.length;i++){
			if(i==eIndex) thumbs[i].className = 'thumbnail opacity_100';
			else if(i==(eIndex+1)) thumbs[i].className = 'thumbnail opacity_50';
			else if(i==(eIndex+2)) thumbs[i].className = 'thumbnail opacity_25';
			else if(i==(eIndex+3)) thumbs[i].className = 'thumbnail opacity_10';
			else if(i==(eIndex+4)) thumbs[i].className = 'thumbnail opacity_2';
			
			else if(i==(eIndex-1)) thumbs[i].className = 'thumbnail opacity_50';
			else if(i==(eIndex-2)) thumbs[i].className = 'thumbnail opacity_25';
			else if(i==(eIndex-3)) thumbs[i].className = 'thumbnail opacity_10';
			else if(i==(eIndex-4)) thumbs[i].className = 'thumbnail opacity_2';
			else thumbs[i].className = 'thumbnail opacity_0';
		}
		
		currentthumb = elmnt;
		showphoto(newpic,false);
	}
	
	function browse(where){
		if(where == 'prev'){
			if(currentthumb != 0){
				nextitem = currentthumb - 1;
				moveThumbs(nextitem);
			}
		}
		if(where == 'next'){
			if(currentthumb != (foto_array.length -1)){
				nextitem = currentthumb+1;
				moveThumbs(nextitem);
			}
		}
	}
	
	
	function showphoto(path,iswinner){
		$('mainphoto').src=path;
		if(iswinner){
			$('photosheading').update('DAGWINNAAR:');
			$('photosdescription').update(winnaar[1]+'<br/>'+winnaar[2]);
		}
		else{
			$('photosheading').update('&nbsp;');
			$('photosdescription').update(foto_array[currentthumb][1]+'<br/>'+foto_array[currentthumb][2]);
		}
	}	
	
	
	function startList(evt){
		if (document.getElementById) {
			if (document.getElementById('menu')) {
				navRoot = document.getElementById("menu").getElementsByTagName('li');
				for (i=0; i<navRoot.length; i++) {
					linode = navRoot[i];
					linode.onmouseover=function() {
						if(this.className==''){
							this.className = 'over';
						}
						else if(this.className.indexOf('over')==-1){
							this.className+=' over';
						}
						closeActive(navRoot,this);
					}
					linode.onmouseout=function() {
						if(this.className=="over"){
							this.className="";
						}
						else{
							this.className=this.className.replace(" over", "");
						}
						openActive(navRoot,this);
					}
				}
			}
		}
	}

	function closeActive(collection,elmnt){
		for (i=0; i<collection.length; i++) {
			tmpnode = collection[i];
			if (tmpnode!=elmnt && tmpnode.className.indexOf('active')!=-1){
				tmpnode.className='inactive';
			}
		}
	}

	function openActive(collection,elmnt){
		for (i=0; i<collection.length; i++) {
			tmpnode = collection[i];
			if (tmpnode!=elmnt && tmpnode.className.indexOf('inactive')!=-1){
				tmpnode.className='active';
			}
		}
	}
	
	function popwindow(strURL,windowname,popwidth,popheight,features){
		var strfeatures;
		strfeatures = 'width='+popwidth+',height='+popheight+','+features;
		if(window.screen){
			var WindowLeft = (screen.width-popwidth)/2;
			var WindowTop = (screen.height-popheight)/2;
			strfeatures = 'top='+WindowTop+',left='+WindowLeft+','+strfeatures;
		}
		var openen=window.open(strURL,windowname,strfeatures);
		openen.focus();
		return false;
	}	