var tm;
var tm1;
function showCol(refNum,naam){
	document.getElementById('flashBanner').style.visibility="hidden";
	document.getElementById('fotoCol').style.visibility = "visible";
	document.getElementById('fotoCol1').style.visibility = "visible";

	var topH =  document.body.scrollTop;
	//document.body.scroll = "no";
	//if(topH==25){
		//topH = 197
	//}
	document.getElementById('fotoCol').style.top = topH;
	var w = ""+document.getElementById('fotoCol1').style.width;
	w=w.substring(0,w.length-2)
	w = w*1;
	w=w+25;
	if(w>=800){
		clearTimeout(tm);
		document.getElementById('btn_close').style.display='block';
		document.getElementById('fotoPage1').src = '/extrabladen.asp?num='+refNum+'&naam='+naam+'';
		document.getElementById('fotoBgId').className = "bgWait";
		var h = document.body.scrollHeight;
		document.getElementById('overlay').style.height = h;
		document.getElementById('overlay').style.display = "block";		
	}else{
		var h = ""+document.getElementById('fotoCol1').style.height;
		h=h.substring(0,h.length-2)
		h=h*1;
		h=h+25;
		if(h<=600){
			document.getElementById('fotoCol1').style.height = h;
			}

		document.getElementById('fotoCol1').style.width = w;
		tm = setTimeout('showCol("'+refNum+'","'+naam+'")',1);
		}
	}
	
function closeCol(){
	document.getElementById('fotoBgId').className = "";
	document.getElementById('btn_close').style.display='none';
			document.getElementById('overlay').style.display = "none";
	var w = ""+document.getElementById('fotoCol1').style.width;
	w=w.substring(0,w.length-2)
	w = w*1;
	w=w-25;
	if(w<=0){
		//document.body.scroll = "yes";
		clearTimeout(tm1);
		document.getElementById('fotoCol').style.visibility = "hidden";
		document.getElementById('fotoCol1').style.visibility = "hidden";
		document.getElementById('flashBanner').style.visibility="visible";
		document.getElementById('fotoPage1').src = '/extrabladen.asp';
	}else{
		var h = ""+document.getElementById('fotoCol1').style.height;
		h=h.substring(0,h.length-2)
		h=h*1;
		h=h-25;
		if(h>0){
			document.getElementById('fotoCol1').style.height = h;
			}

		document.getElementById('fotoCol1').style.width = w;
		tm1 = setTimeout('closeCol()',1);
		}
	}
	


var smallWidth = 150;
var bigWidth = 400;
var interval;
var snelheid = 5;
var activeNum = 0;
var closingNum = 0;


function showBig(num){
	if(activeNum!=0){
		document.images['foto'+activeNum].style.zIndex = 99;
		//document.images['foto'+activeNum].style.position = "relative";
		if(closingNum!=0 && closingNum!=num){
			document.images['foto'+closingNum].style.width = smallWidth;
			}
		}
	activeNum = num;
	document.images['foto'+num].style.zIndex = 100;
	document.images['foto'+num].style.position = "absolute";
	var tmpW = ""+document.images['foto'+num].style.width;
	
	tmpW = tmpW.substring(0,tmpW.length-2)*1;
	if(tmpW<bigWidth){
		tmpW = tmpW+snelheid;
		document.images['foto'+num].style.width = tmpW;
		clearTimeout(interval);
		}
	interval = setTimeout("showBig("+num+")",1);	
}

function closeBig(num){
	closingNum = num;
	var tmpW = ""+document.images['foto'+num].style.width;
	tmpW = tmpW.substring(0,tmpW.length-2)*1;
	if(tmpW>smallWidth){
		clearTimeout(interval);
		tmpW = tmpW-snelheid;
		document.images['foto'+num].style.width = tmpW;
	}
	interval = setTimeout("closeBig("+num+")",1);	
}

function chgImg(){
	document.getElementById('actie_icon').style.display='none';
	var fName = ""+actieArr[telImg];
	if(actieStr.indexOf("|"+fName+"|")!=-1){
		document.getElementById('actie_icon').style.display='block';
	}
	
	
	document.getElementById('foto_actiegeschenk').src = 'http://call.kvsoft.nl/zoeker/img/'+fName+'_g.jpg';
	if(telImg==aantalGeschenken-1)telImg=0;
	telImg++;
	setTimeout('chgImg()',5000);
}
