function funktion(o,a,x)
{
  o.onmouseover = '';
  addr = '';
  a = unescape(a);
  for(c =0; c < a.length; ++c)
    {
      addr+=String.fromCharCode(a.charCodeAt(c) - x);
    }
   o.parentNode.setAttribute('href', 'mailto:' + addr);
}

 var reentrant = 0, h = 0, b = 0;

 function div_blende(id, breite, hoehe, aktion)
{
 if( ! reentrant ) {
    reentrant = 1;
    var move = 0, element = document.getElementById(id);
    
    if( aktion == 'ein' ) {
       if(h < hoehe ){ h += 20; move++ }
       if(b < breite){ b += 20; move++ }
       element.style.display = 'block';
    }    
    if( move ) { 
       element.style.height =  h + 'px';
       element.style.width  =  b + 'px';
       window.setTimeout( function(){ div_blende(id,hoehe,breite,aktion) }, 20 );
    }
    reentrant = 0;
 }
}
function comment(msgkey){
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;
	}


	yScroll_n=(yScroll/2)-400;
	yScroll_n1=(yScroll/2)-425;
	xScroll_n=(xScroll/2)-250;
	
	
	document.getElementById('innerdiv').style.top= yScroll_n  + "px";
	document.getElementById('innerdiv').style.left= xScroll_n + "px";	
	
	if(navigator.userAgent.search(/msie/i)!= -1) { 
	// IE Code 
		document.getElementById('innerdiv').style.top="50%";
		document.getElementById('innerdiv').style.left= "50%";
		document.getElementById('innerdiv').style.marginTop= -175+ "px";
		document.getElementById('innerdiv').style.marginLeft= -250+"px";
		document.getElementById('schliessen_div').style.top= yScroll_n1-20 + "px";
		document.getElementById('schliessen_div').style.left= xScroll_n + "px";	
	} else { 
	// Non-IE Code 
		document.getElementById('innerdiv').style.top= yScroll_n  + "px";
		document.getElementById('innerdiv').style.left= xScroll_n + "px";
		document.getElementById('schliessen_div').style.top= yScroll_n1 + "px";
		document.getElementById('schliessen_div').style.left= xScroll_n + "px";	
		document.getElementById('schliessen_div').style.display='block';
	}
	
	document.getElementById('outer_div').style.width= xScroll + "px";
	document.getElementById('outer_div').style.height= yScroll + "px";
	document.getElementById('outer_div').style.top	=0 +"px";
	document.getElementById('outer_div').style.left	=0 + "px";
	

	document.getElementById('outer_div').style.display='block';	
	document.getElementById('innerdiv').style.display='block';
	document.getElementById('innerdiv').innerHTML = '<iframe src="_includes/popup.php?action=artikel_comment&msgkey='+msgkey+'" frameborder="0" scrolling="no" id="frame" style="position:absolute; width:500px; height:350px; left:0px; background-color:#999;" ></iframe>';
}
function schliessen(){
	document.getElementById('innerdiv').style.display='none';
	document.getElementById('outer_div').style.display='none';
	document.getElementById('schliessen_div').style.display='none';


}
function foto_comment_old(msgkey , image1){
	vsize = (document.all && !window.opera)? document.getElementsByTagName("body")[0].offsetHeight : window.innerHeight;
	hsize = (document.all && !window.opera)? document.getElementsByTagName("body")[0].offsetWidth : window.innerWidth;
		
	vpos=(vsize/2)-175;
	vpos1=(vsize/2)-200;
	hpos=(hsize/2)-250;
	
	
	document.getElementById('innerdiv').style.top= vpos  + "px";
	document.getElementById('innerdiv').style.left= hpos + "px";	
	
	if(navigator.userAgent.search(/msie/i)!= -1) { 
	// IE Code 
		document.getElementById('innerdiv').style.top="50%";
		document.getElementById('innerdiv').style.left= "50%";
		document.getElementById('innerdiv').style.marginTop= -175+ "px";
		document.getElementById('innerdiv').style.marginLeft= -250+"px";
	} else { 
	// Non-IE Code 
		document.getElementById('innerdiv').style.top= vpos  + "px";
		document.getElementById('innerdiv').style.left= hpos + "px";	
	}
	
	document.getElementById('outer_div').style.width= hsize + "px";
	document.getElementById('outer_div').style.height= vsize + "px";
	document.getElementById('outer_div').style.top	=0 +"px";
	document.getElementById('outer_div').style.left	=0 + "px";
	

	document.getElementById('outer_div').style.display='block';	
	document.getElementById('innerdiv').style.display='block';
	
	document.getElementById('schliessen_div').style.top= vpos1 + "px";
	document.getElementById('schliessen_div').style.left= hpos + "px";	
	document.getElementById('schliessen_div').style.display='block';
	document.getElementById('innerdiv').innerHTML = '<iframe src="_includes/popup.php?action=foto_comment&event='+msgkey+'&img='+image1+'" frameborder="0" scrolling="no" id="frame" style="position:absolute; width:500px; height:400px; left:0px; background-color:#999;" ></iframe>';
}
function foto_comment(msgkey , image1){
	
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;
	}


	yScroll_n=(yScroll/2)-400;
	yScroll_n1=(yScroll/2)-425;
	xScroll_n=(xScroll/2)-250;
	
	
	document.getElementById('innerdiv').style.top= yScroll_n  + "px";
	document.getElementById('innerdiv').style.left= xScroll_n + "px";	
	
	if(navigator.userAgent.search(/msie/i)!= -1) { 
	// IE Code 
		document.getElementById('innerdiv').style.top="50%";
		document.getElementById('innerdiv').style.left= "50%";
		document.getElementById('innerdiv').style.marginTop= -175+ "px";
		document.getElementById('innerdiv').style.marginLeft= -250+"px";
		document.getElementById('schliessen_div').style.top= yScroll_n1-20 + "px";
		document.getElementById('schliessen_div').style.left= xScroll_n + "px";	
	} else { 
	// Non-IE Code 
		document.getElementById('innerdiv').style.top= yScroll_n  + "px";
		document.getElementById('innerdiv').style.left= xScroll_n + "px";
		document.getElementById('schliessen_div').style.top= yScroll_n1 + "px";
		document.getElementById('schliessen_div').style.left= xScroll_n + "px";	
		document.getElementById('schliessen_div').style.display='block';
	}
	
	document.getElementById('outer_div').style.width= xScroll + "px";
	document.getElementById('outer_div').style.height= yScroll + "px";
	document.getElementById('outer_div').style.top	=0 +"px";
	document.getElementById('outer_div').style.left	=0 + "px";
	

	document.getElementById('outer_div').style.display='block';	
	document.getElementById('innerdiv').style.display='block';
	document.getElementById('innerdiv').innerHTML = '<iframe src="_includes/popup.php?action=foto_comment&event='+msgkey+'&img='+image1+'" frameborder="0" scrolling="no" id="frame" style="position:absolute; width:500px; height:400px; left:0px; background-color:#999;" ></iframe>';
}






