        function centerContent(){                             
                var margin = (getHeight() - document.getElementById("container").clientHeight)/2;
                               
                if ( margin < 50 ){
                      margin = 50;
                }                
                                                    
                document.getElementById("container").style.marginTop = margin + "px";    
        }
          
        function getHeight(){                          
                if (window.innerHeight) {
                      return window.innerHeight;
                } else if (document.body && document.body.offsetHeight) {
                          return document.body.offsetHeight;                          
                } else {
                      return 0;
                }
        }
	  
        var _printPreview;
		var _contact;
        var _id;
		
		var _address;
		
        function printPreview(id){
				_id = id;		
                _printPreview = window.open("fileadmin/templates/printPreview.html", "_blank", "width = 530, height = 560, scrollbars=yes, status=yes");
                if(window.addEventListener){
	                 _printPreview.addEventListener('load', insertHTML, false);
                }
                else {
	                 _printPreview.attachEvent('onload', insertHTML);
                }
		}
	
		function insertHTML(){
                _printPreview.document.getElementById("preview").innerHTML = document.getElementById(_id).innerHTML;
                _printPreview.document.getElementById("contact_" + _id).style.display = "none";
                _printPreview.document.getElementById("print_" + _id).href = "javascript:window.print()";
                _printPreview.document.getElementById("print_" + _id).style.fontSize = "14px";
		_printPreview.document.getElementById("print_" + _id).style.fontWeight = "bold";                
		}
		
		function contact(id, url){
				_id = id;
				_address = document.getElementById("address_" + _id).innerHTML;
				_contact = window.open( url , "_blank", "width = 380, height = 560, scrollbars=no, status=no");
                if(window.addEventListener){
	                 _contact.addEventListener('load', setAddressScoutID, false);
                }
                else {
	                 _contact.attachEvent('onload', setAddressScoutID);
                }				
		}
		
		function setAddressScoutID(){
				_contact.document.getElementById("address").innerHTML = _address;
				_contact.document.getElementById("mailformAdresse").value = _address.replace(/&nbsp;/g,' ');
				_contact.document.getElementById("mailformScoutID").value = _id.substr(3, _id.length);
		}
