
function showMsgBox () {
	document.getElementById("LayerMessageBoxBackground").style.width = Fensterweite()+"px";
	document.getElementById("LayerMessageBoxBackground").style.height = Fensterhoehe()+"px";
	document.getElementById("LayerMessageBoxBackground").style.visibility = "visible";
	document.getElementById("LayerMessageBox").style.left = Fensterweite()/2-225+"px";
	document.getElementById("LayerMessageBox").style.top = Fensterhoehe()/2-125+"px";
	document.getElementById("LayerMessageBox").style.visibility = "visible";
	transparency("LayerMessageBoxBackground", 70);
}

function hideMsgBox () {
	document.getElementById("LayerMessageBox").style.visibility = "hidden";
	document.getElementById("LayerMessageBoxBackground").style.visibility = "hidden";
}

function showMsgBoxPress (popupTitel,popupSubTitel,popupText) {
	document.getElementById("LayerMessageBoxBackground").style.width = Fensterweite()+"px";
	document.getElementById("LayerMessageBoxBackground").style.height = Fensterhoehe()+"px";
	document.getElementById("LayerMessageBoxBackground").style.visibility = "visible";
	document.getElementById("LayerMessageBoxPress").style.left = Fensterweite()/2-335+"px";
	document.getElementById("LayerMessageBoxPress").style.top = Fensterhoehe()/2-252+"px";
	document.getElementById("LayerMessageBoxPress").style.visibility = "visible";
	transparency("LayerMessageBoxBackground", 70);

	document.getElementById("popupTitel").innerHTML = popupTitel;
	document.getElementById("popupSubTitel").innerHTML = popupSubTitel;
	document.getElementById("popupText").innerHTML = popupText;
}

function hideMsgBoxPress () {
	document.getElementById("LayerMessageBoxPress").style.visibility = "hidden";
	document.getElementById("LayerMessageBoxBackground").style.visibility = "hidden";
}

function transparency(element,percentage) {
 var i, count, objStyle, filterValue, opacityValue;
 if(document.getElementById) {
  if(typeof(element)=="object" && element) { obj=element; }
  else if (document.getElementsByName(element) && document.getElementsByName(element)[0]) { obj=document.getElementsByName(element); }
  else if (document.getElementById(element)) { obj=document.getElementById(element); }
  else if (document.getElementsByTagName && document.getElementsByTagName(element) && document.getElementsByTagName(element)[0]) { obj=document.getElementsByTagName(element); }
  else { obj=false; }
  if(obj) {
   percentage=(typeof(percentage)=="undefined")?50:100-percentage;
   filterValue="Alpha(opacity="+percentage+")";
   opacityValue=""+percentage/100;
   count=(obj.length)?obj.length:1;
   for(i=0;i<count;i++) {
    objStyle=(obj.length)?obj[i].style:obj.style;
    objStyle.filter=filterValue;
    objStyle.MozOpacity=opacityValue;
    objStyle.KhtmlOpacity=opacityValue;
    objStyle.opacity=opacityValue;
   }
  }
 }
}

function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else if (document.body && document.body.clientWidth) {
    return document.body.clientWidth;
  } else if (document.documentElement && document.documentElement.clientWidth) {
    return document.documentElement.clientWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else if (document.body && document.body.clientHeight) {
    return document.body.clientHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) {
    return document.documentElement.clientHeight;
  } else {
    return 0;
  }
}
