﻿	function openCurtain(){
		try{
			/*alert(getDocHeight());*/
			myKmCurtain=document.getElementById("kmCurtain");
			myKmCurtain.style.height=getDocHeight() + "px";
			myKmCurtain.style.display="block";
			
		}
		catch(e){};
		
		/*customObject*/
		//document.getElementById("divTPPLogin").style.bottom="300px";
		
		supercenter("divTPPLogin");
		//alert(getSize());
		
		
	}
function getSizeOfUserScreen() {
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
    return [ myWidth, myHeight ];
}

	function supercenter(theDiv){
		userWindowWidth=getSizeOfUserScreen()[0];
		userWindowHeight=getSizeOfUserScreen()[1];
		//alert("breite: " + userWindowWidth + " - hoehe: " + userWindowHeight);
		
		theElement=document.getElementById(theDiv);
		
		theElementWidth=parseInt(theElement.style.width);
		theElementHeight=parseInt(theElement.style.height);
		
		
		
		if(document.all){theElement.style.top=(userWindowHeight/2) - (theElementHeight/2) + document.body.parentNode.scrollTop + "px" ;}
		
		else{theElement.style.top=(userWindowHeight/2) - (theElementHeight/2) + window.scrollY + "px" ;}
		
		theElement.style.left=(userWindowWidth/2) - (theElementWidth/2) + "px" ;
		/*ich kenne die Regel punkt vor Strichrechnung!!!*/
		
		/*
		theElement.style.left='50%';
		theElement.style.marginLeft = "-" + parseInt(div.offsetWidth / 2) + "px";
		theElement.style.marginTop = parseInt(div.offsetHeight / 2) + window.document.documentElement.scrollY + "px";
		*/
	
	}

	function hideCurtain(){
		try{
		document.getElementById("kmCurtain").style.display="none";
		}
		catch(e){};
	}
	
	getDocHeight = function(){
		var D = document;
		return Math.max(Math.max(D.body.scrollHeight,    D.documentElement.scrollHeight), Math.max(D.body.offsetHeight, D.documentElement.offsetHeight), Math.max(D.body.clientHeight, D.documentElement.clientHeight));
	};				
	
	function posPopupElement(){
		document.getElementById("closeButton").style.left="5px";
		document.getElementById("closeButton").style.top="30px";

		try{
			document.getElementById("kmCurtain").style.height = getDocHeight() + "px";
			document.getElementById("closeButton").style.marginLeft=document.getElementById("popupContent").offsetLeft+ document.getElementById("popupContent").offsetWidth -  20 +  "px";
			/*document.getElementById("closeButton").offsetWidth*/
		}
		catch(e){
			
			};

	}
	
	function setPopupCloseButton(){
		document.write("<div id='closeButton' class='closeButton' style='display:block'><a href='javascript:hideCurtain();' class='closeButtonLink'><img src='/css/close.png' border='0' alt='' /></a></div>");		
	}
