function init() {
	Zubehoer.init();
}

function showPopupPicture(picture) {
  document.getElementById('elementPopupPicture').style.display = 'block';
  document.getElementById('elementPopupPictureSrc').style.visibility = 'hidden';

  document.getElementById('elementPopupPictureSrc').src = picture;

  document.getElementById("elementPopupPictureSrc").style.height = "";
  document.getElementById("elementPopupPictureSrc").style.width = "";
  document.getElementById("elementPopupPictureSrc").style.marginTop = "";
  document.getElementById("elementPopupPictureSrc").style.marginLeft = "";

  window.setTimeout(showPopupPicture2, 1000);

  return false;
}

function showPopupPicture2() {
  window.clearTimeout();
  picture = window.nextPicutre;
  imgWidthMax = 480;
  imgHeightMax = 340;
  imgWidthIs = document.getElementById("elementPopupPictureSrc").width;
  imgHeightIs = document.getElementById("elementPopupPictureSrc").height;

  imgWidthNew = imgWidthMax;
  imgRatio = imgWidthIs / imgHeightIs;
  imgHeightNew = imgWidthNew / imgRatio;
  if (imgHeightNew > imgHeightMax) {
    imgHeightNew = imgHeightMax;
    imgWidthNew = imgHeightNew * imgRatio;
  }
  document.getElementById("elementPopupPictureSrc").style.height = imgHeightNew+"px";
  document.getElementById("elementPopupPictureSrc").style.width = imgWidthNew+"px";

  marginTopNew =  Math.floor((imgHeightMax - imgHeightNew) / 2);
  marginLeftNew =  Math.floor((imgWidthMax - imgWidthNew) / 2);

  document.getElementById("elementPopupPictureSrc").style.marginTop = marginTopNew+"px";
  document.getElementById("elementPopupPictureSrc").style.marginLeft = marginLeftNew+"px";
  document.getElementById('elementPopupPictureSrc').style.visibility = 'visible';

  return false;
}
function changeImg(newImg, subholder) {
	if (subholder=="") {
		slash = "";
	} else {
		slash = "/";
	}
	document.getElementById("laenderkarte").src = "/schneidesysteme_de/img/karten/"+subholder+slash+ newImg + ".jpg";
}

function showInformation(country) {
	document.getElementById(country).style.display = "block";
}

function hideInformation(country) {
	alert (country);
}

window.onload = init;