function showPic(foto) {
x=10;
y=10;
width=400;
height=298;
if(window.screen){
 per_ancho=(width/800)*100;//porcentaje screen-ancho
 per_alto=(height/width)*100;//porcentaje de ancho-alto
 win_ancho=(screen.width*per_ancho)/100;//ancho de la ventana
 win_alto=(win_ancho*per_alto)/100;//alto de la ventana
 x=(screen.width-win_ancho)/2;//centra x
 y=(screen.height-win_alto)/2;//centra y
 y=y-40;
 if (y<0) {
  y=0;
  }
 }
 s="showpic2.html?pic="+foto;
w=window.open(s,"picshow","width="+width+",height="+height+",left="+x+",top="+y+",resizable=0,status=1,toolbar=0,scrollbars=0");
if (window.screen) {
 w.focus();
 }
}


function rnd(wat) {
 return Math.floor(wat * Math.random());
}

var nextSmallBol = "";
var nextBigBol = "";
var nextKantBol = "";

function startBollen() {
 nextSmallBol = bollen[0];
 nextBigBol = bollen[1];
 if (bolvid == "") {
  nextKantBol = bollenkant[1];
 } else {
  setVidBol();
 }
 setInterval("changeBollen()", 7000);
}

function changeBollen() {
 var simg = new Image();
 var bimg = new Image();
 var kimg = new Image();

 var smallfoto = bollen[rnd(7)];
 var bigfoto = bollen[rnd(7)];
 var kantfoto = bollenkant[rnd(7)];

 if (smallfoto == nextSmallBol) smallfoto = bollen[rnd(7)];
 if (bigfoto == nextBigBol) bigfoto = bollen[rnd(7)];
 if (bolvid == "") {
  if (kantfoto == nextKantBol) kantfoto = bollenkant[rnd(7)];
 }
 if (bigfoto == smallfoto) bigfoto = bollen[rnd(7)];

 nextBigBol = bigfoto;
 nextSmallBol = smallfoto;
 if (bolvid == "") {
  nextKantBol = kantfoto;
 }

 simg.src = "assets/images/bollen/klein/"+smallfoto;
 bimg.src = "assets/images/bollen/groot/"+bigfoto;
 if (bolvid == "") {
  kimg.src = "assets/images/kantoren/groot/"+kantfoto;
 }

 bimg.onload = setBigBol;
 simg.onload = setSmallBol;

 if (bolvid == "") {
  kimg.onload = setKantBol;
 }
}

function setBigBol() {
 document.getElementById("bigbol").src = "assets/images/bollen/groot/"+nextBigBol;
}

function setSmallBol() {
 document.getElementById("smallbol").src = "assets/images/bollen/klein/"+nextSmallBol;
}

function setKantBol() {
 document.getElementById("kantbol").src = "assets/images/kantoren/groot/"+nextKantBol;
}


function setVidBol() {
 insertFlashMovie("assets/swf/bolplayer.swf", "swfbol", "swfbol", 271, 271, "#FFFFFF", "defilm=/assets/images/kantoren/"+bolvid, "menu=false;loop=false;quality=high;allowScriptAccess=sameDomain;salign=lt;wmode=opaque");
}
