/* _____________________________________________ */
function showRandomFoto() {
  fotosMax = 11;
  // fotos
  fotos = new Array();
  for (f=0; f<=fotosMax; f++) {
    if (f<10) 
      img_prelude = "0";
    else
      img_prelude = "";
    fotos[f] = "'images/header_" + img_prelude + f + ".jpg'";
  }  
  // Get cookies
  randomFotoCookie = Get_Cookie('randomFotoz');
  // check for cookie
  if(randomFotoCookie == null) {
    // no randomFoto set yet, random begin:
    randomFotoz = Math.floor(Math.random() * fotos.length);
  } else {
    randomFotoz = randomFotoCookie*1 + 1;
    if (randomFotoz > fotosMax)
      randomFotoz = 0;
  }
  // set cookie
  var today = new Date();
  var zero_date = new Date(0,0,0);
  today.setTime(today.getTime() - zero_date.getTime());
  var cookie_expire_date = new Date(today.getTime() + (8 * 7 * 86400000)); 
	Set_Cookie('randomFotoz',randomFotoz,cookie_expire_date);
  // finally write img random foto
  randomFotoImg = fotos[randomFotoz];
  document.getElementById('header').style.backgroundImage = "url(" + randomFotoImg + ")";
  return;
}

/* _____________________________________________ */
function openAfd(id) {
	extra = document.getElementById(id+'-extra');
	openup = document.getElementById(id+'-openup');
	if (extra.style.display == "none") {
		// openup!
		openup.innerHTML = "minder";
		openup.className = "openup close";
		extra.style.display = "";
	} else {
		// close
		openup.innerHTML = "meer";
		openup.className = "openup";
		extra.style.display = "none";
	}
}

/* _____________________________________________ */
function showSpecialismeFoto(specialisme) {
	var cleaned = specialisme;
	// remove "../" and "..\" from specialisme; 
	// also remove any leading '/' or '\' signs
	while (cleaned.indexOf('..')>-1) {
		cleaned = cleaned.replace(/\.\./, "");
	}
	while ((cleaned.substring(0, 1)=='/') || (cleaned.substring(0, 1)=='\\')) {
		cleaned = cleaned.substring(1, cleaned.length);
	}
	var path = "images/specialismen/" + cleaned + ".jpg";
	document.getElementById('header').style.backgroundImage = "url('" + path + "')";
}

function showFoto(url) {
        document.getElementById('header').style.backgroundImage = "url('" + url +"')";
}