

function InfoPopUp(bildUrl,text) {
	
	var objBody = document.getElementsByTagName("body").item(0);
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	
	var infoLayer = null;
	
	init();
	function init() {
		if(!document.getElementById('infoLayer')) {
			infoLayer = document.createElement("div");
			infoLayer.setAttribute('id','infoLayer');
			infoLayer.style.display = 'block';
			infoLayer.style.position = 'absolute';
			infoLayer.style.top = '0px';
			infoLayer.style.left = '0px';
			infoLayer.style.zIndex= '100';
			objBody.insertBefore(infoLayer, objBody.firstChild);
			infoLayer.onclick = function() {
				infoLayer.style.display = 'none';
			}
		}else {
			infoLayer = document.getElementById('infoLayer');
			infoLayer.style.display = 'block';
		}
		
		var data = '';
		data+= '<table width="594" border="0" cellspacing="0" cellpadding="0">';
		data+= '		  <tr>';
		data+= '			<td style="width:2px; height:2px;"><img src="../../SiteCollectionImages/bereichsstartseiten/ecke_ol.gif" width="2" height="2" /></td>';
		data+= '			<td style="background-image:url(../../SiteCollectionImages/bereichsstartseiten/balken_o.gif)"></td>';
		data+= '			<td style="width:2px; height:2px;"><img src="../../SiteCollectionImages/bereichsstartseiten/ecke_or.gif" width="2" height="2" /></td>';
		data+= '		  </tr>';
		data+= '		  <tr>';
		data+= '			<td style="background-image:url(../../SiteCollectionImages/bereichsstartseiten/balken_l.gif)"></td>';
		data+= '			<td style="background-image:url(../../SiteCollectionImages/bereichsstartseiten/back.gif); background-repeat:no-repeat; background-color:#FFFFFF;">';
		data+= '		<div style="background-color:#E7EDF5;padding:2px;">';
		data+= '		<span style="float:left;">Info</span>';
		data+= '		   <img border="0" style="float:right; cursor:pointer; "src="/SiteCollectionImages/Icons/closer.gif" onclick="document.getElementById(\'infoLayer\').style.display = \'none\'"/>';
		data+= '		   <div style="clear:right"></div>';
		data+= '		</div>';
		data+= '		<div style="position:relative; background-color:#ffffff;">';
		data+= '			<img id="loadingImage" style="padding:5px;" src="'+bildUrl+'" />';
		data+= '			<div style="padding:5px;">'+text+'</div>';
		data+= '		</div>';
		data+= '			</td>';
		data+= '			<td style="background-image:url(../../SiteCollectionImages/bereichsstartseiten/balken_r.gif)"></td>';
		data+= '		  </tr>';
		data+= '		  <tr>';
		data+= '			<td style="width:2px; height:2px;"><img src="../../SiteCollectionImages/bereichsstartseiten/ecke_ul.gif" width="2" height="2" /></td>';
		data+= '			<td style="background-image:url(../../SiteCollectionImages/bereichsstartseiten/balken_u.gif)"></td>';
		data+= '			<td style="width:2px; height:2px;"><img src="../../SiteCollectionImages/bereichsstartseiten/ecke_ur.gif" width="2" height="2" /></td>';
		data+= '		  </tr>';
		data+= '</table>';
		
		infoLayer.innerHTML = data;
		
		
		var objLoadingImage = document.getElementById('loadingImage');
		
		objLoadingImage.onload = function() {
			// center loadingImage if it exists
			infoLayer.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.height) / 2) + 'px');
			infoLayer.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
	}
	
	
	//
	// getPageScroll()
	// Returns array with x,y page scroll values.
	// Core code from - quirksmode.org
	//
	function getPageScroll(){
	
		var yScroll;
	
		if (self.pageYOffset) {
			yScroll = self.pageYOffset;
		} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
			yScroll = document.documentElement.scrollTop;
		} else if (document.body) {// all other Explorers
			yScroll = document.body.scrollTop;
		}
	
		arrayPageScroll = new Array('',yScroll) 
		return arrayPageScroll;
	}	

	//
	// getPageSize()
	// Returns array with page width, height and window width, height
	// Core code from - quirksmode.org
	// Edit for Firefox by pHaez
	//
	function getPageSize(){
		
		var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		if (self.innerHeight) {	// all except Explorer
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = windowWidth;
		} else {
			pageWidth = xScroll;
		}
	
	
		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
		return arrayPageSize;
	}	
	
}