  // decrypt helper function
function decryptCharcode(n,start,end,offset) {
	n = n + offset;
	if (offset > 0 && n > end)	{
		n = start + (n - end - 1);
	} else if (offset < 0 && n < start)	{
		n = end - (start - n - 1);
	}
	return String.fromCharCode(n);
}
  // decrypt string
function decryptString(enc,offset) {
	var dec = "";
	var len = enc.length;
	for(var i=0; i < len; i++)	{
		var n = enc.charCodeAt(i);
		if (n >= 0x2B && n <= 0x3A)	{
			dec += decryptCharcode(n,0x2B,0x3A,offset);	// 0-9 . , - + / :
		} else if (n >= 0x40 && n <= 0x5A)	{
			dec += decryptCharcode(n,0x40,0x5A,offset);	// A-Z @
		} else if (n >= 0x61 && n <= 0x7A)	{
			dec += decryptCharcode(n,0x61,0x7A,offset);	// a-z
		} else {
			dec += enc.charAt(i);
		}
	}
	return dec;
}
  // decrypt spam-protected emails
function linkTo_UnCryptMailto(s)	{
	location.href = decryptString(s,-1);
}


var newWin, dispImg, dispTitle, dispWidth, dispHeight;


function display_img(newImg,newTitle,newWidth,newHeight)
{
   dispImg    = newImg;   
   dispTitle  = newTitle;
   dispWidth  = newWidth;
   dispHeight = newHeight;
   newWinClose();
   setTimeout("show()",1000);
}

function show()
{  
   display_height = dispHeight + 30;
   display_width = dispWidth + 40;
   parameter = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,height='+display_height+',width='+display_width;
   newWin = window.open('','',parameter);
   
   with (newWin) 
   {
   	  document.writeln('<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">');
      document.writeln('<html>\n<head>\n<title>' + dispTitle + '</title>\n</head>');
	  document.writeln('<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">');
	  document.writeln('<link rel=stylesheet type="text/css" href="layout/bild.css">');
      document.writeln('<body>\n<div>');
      document.writeln('<img src="'+dispImg+'" width='+dispWidth+' height='+dispHeight+' border=0 alt="'+dispTitle+'">');
      document.writeln('</div>\n</body>\n</html>');
   }
}

function newWinClose()
{
   if (newWin != null)
     if (!newWin.closed)
        if (newWin.close)
           newWin.close(); 
}


function openPic(url,winName,winParams)	{	//
		var theWindow = window.open(url,winName,winParams);
		if (theWindow)	{theWindow.focus();}
	}
	
function openPopUp(url,winName,winParams)	{	//
		var theWindow = window.open(url,winName,winParams);
		if (theWindow)	{theWindow.focus();}
	}
	
function openMap(url,winWidth,winHeight)	{	//   
		if (newWin) {
			newWin.close();
		}
		// simple string without special characters for IE
		var winName = 'PopUp';
        var winParams = 'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=0,resizable=1,height='+winHeight+',width='+winWidth;
		// do not write var newWin here, but write var newWin outside of the function, then first if(newWin) causes no error
		newWin = window.open(url,winName,winParams);
		if (newWin)	{
			newWin.focus();
		}
	}




// ++++++++++ resize Bug: Netscape 4 and IE www.keine-gentechnik.de ++++++++++++++

var x = 0;
var y = 0;

	function viewport(){
		if (self.innerHeight) // all except Explorer
		{
			x = self.innerWidth;
			y = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight)
			// Explorer 6 Strict Mode
		{
			x = document.documentElement.clientWidth;
			y = document.documentElement.clientHeight;
		}
		else if (document.body) // other Explorers
		{
			x = document.body.clientWidth;
			y = document.body.clientHeight;
		}			
	}


	function loadHandler() {	
			viewport();	
			origWidth  = x;
			origHeight = y;
	}

	function resizeHandler() {
  		if(document.layers || IE){	
		    //Style !
			if(IE) maxWidthIE();
			viewport();
			if (x != origWidth || y != origHeight) {				
				location.reload();
			}
		}
	}
	
	function docID(id){
		if (document.getElementById)
		{
			d = document.getElementById(id);
		}
		else if (document.all)
		{
			d = document.all[id];
		}
		return d;		
	}
	
	function maxWidthIE() {
		docID('MaxWidth').style.width = (document.body.clientWidth > 1000)? "1000px" : "auto";
	}
	
if (window.location.host.indexOf("gentechnik")>-1){
	var IE = (navigator.appName.indexOf("Microsoft")> -1) ? true : false;
	onload = loadHandler;	
	onresize = resizeHandler;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	