﻿     var resizeIntervalId = null;
     var nodewidth = new Array()
     function isInt(numIn)
{
	var checknum = parseInt(numIn);
	alert(checknum);
	return !isNaN(checknum);
}
     function delay(prmSec)
{
 prmSec *= 1000;
 
 var eDate = null;
 var eMsec = 0;
 
 var sDate = new Date();
 var sMsec = sDate.getTime();
 
 do {
 eDate = new Date();
 eMsec = eDate.getTime();
 
 } while ((eMsec-sMsec)<prmSec);
} 
var displayWaitMessage=true;	// Display a please wait message while images are loading?
  	
   		
	var activeImage = false;
	var imageGalleryLeftPos = false;
	var imageGalleryWidth = false;
	var imageGalleryObj = false;
	var maxGalleryXPos = false;
	var slideSpeed = 0;
	var imageGalleryCaptions = new Array();
		
String.prototype.htmlEntities = function()
{
  var chars = new Array ('&','à','á','â','ã','ä','å','æ','ç','è','é',
                         'ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô',
                         'õ','ö','ø','ù','ú','û','ü','ý','þ','ÿ','À',
                         'Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë',
                         'Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö',
                         'Ø','Ù','Ú','Û','Ü','Ý','Þ','€','\"','ß','<',
                         '>','¢','£','¤','¥','¦','§','¨','©','ª','«',
                         '¬','­','®','¯','°','±','²','³','´','µ','¶',
                         '·','¸','¹','º','»','¼','½','¾');

  var entities = new Array ('amp','agrave','aacute','acirc','atilde','auml','aring',
                            'aelig','ccedil','egrave','eacute','ecirc','euml','igrave',
                            'iacute','icirc','iuml','eth','ntilde','ograve','oacute',
                            'ocirc','otilde','ouml','oslash','ugrave','uacute','ucirc',
                            'uuml','yacute','thorn','yuml','Agrave','Aacute','Acirc',
                            'Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute',
                            'Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde',
                            'Ograve','Oacute','Ocirc','Otilde','Ouml','Oslash','Ugrave',
                            'Uacute','Ucirc','Uuml','Yacute','THORN','euro','quot','szlig',
                            'lt','gt','cent','pound','curren','yen','brvbar','sect','uml',
                            'copy','ordf','laquo','not','shy','reg','macr','deg','plusmn',
                            'sup2','sup3','acute','micro','para','middot','cedil','sup1',
                            'ordm','raquo','frac14','frac12','frac34');

  newString = this;
  for (var i = 0; i < chars.length; i++)
  {
    myRegExp = new RegExp();
    myRegExp.compile(chars[i],'g')
    newString = newString.replace (myRegExp, '&' + entities[i] + ';');
  }
  return newString;
}
function htmlent(newString){
						 
	 var chars = new Array ('&','à','á','â','ã','ä','å','æ','ç','è','é',
                         'ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô',
                         'õ','ö','ø','ù','ú','û','ü','ý','þ','ÿ','À',
                         'Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë',
                         'Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö',
                         'Ø','Ù','Ú','Û','Ü','Ý','Þ','€','\"','ß','<',
                         '>','¢','£','¤','¥','¦','§','¨','©','ª','«',
                         '¬','­','®','¯','°','±','²','³','´','µ','¶',
                         '·','¸','¹','º','»','¼','½','¾');

  var entities = new Array ('amp','agrave','aacute','acirc','atilde','auml','aring',
                            'aelig','ccedil','egrave','eacute','ecirc','euml','igrave',
                            'iacute','icirc','iuml','eth','ntilde','ograve','oacute',
                            'ocirc','otilde','ouml','oslash','ugrave','uacute','ucirc',
                            'uuml','yacute','thorn','yuml','Agrave','Aacute','Acirc',
                            'Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute',
                            'Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde',
                            'Ograve','Oacute','Ocirc','Otilde','Ouml','Oslash','Ugrave',
                            'Uacute','Ucirc','Uuml','Yacute','THORN','euro','quot','szlig',
                            'lt','gt','cent','pound','curren','yen','brvbar','sect','uml',
                            'copy','ordf','laquo','not','shy','reg','macr','deg','plusmn',
                            'sup2','sup3','acute','micro','para','middot','cedil','sup1',
                            'ordm','raquo','frac14','frac12','frac34');

  for (var i = 0; i < chars.length; i++)
  {
    myRegExp = new RegExp();
    myRegExp.compile(chars[i],'g')
    newString = newString.replace (myRegExp, '&' + entities[i] + ';');
  }
  return newString;					 

}
var Utf8 = {

	// public method for url encoding
	encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";

		for (var n = 0; n < string.length; n++) {

			var c = string.charCodeAt(n);

			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}

		}

		return utftext;
	},

	// public method for url decoding
	decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;

		while ( i < utftext.length ) {

			c = utftext.charCodeAt(i);

			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}

		}

		return string;
	}

}	
	function showImage(obj)
	{

		if(activeImage){
			activeImage.style.filter = 'alpha(opacity=50)';	
			activeImage.style.opacity = 0.5;
		}	
		obj.style.filter = 'alpha(opacity=100)';
		obj.style.opacity = 1;	
		activeImage = obj;	
	}
	

	

			function bigimg(bild,txt,w,h)
			{
				
				if(w>h)
				{
					nw=400;
					fr=400/w;
					nh=h*fr;
				}
				else
				{
					nh=550;
					fr=550/h;
					nw=w*fr;
				}
				bh=nh + 30;
				bw=nw + 10;
				tw=bw-20;
				
				dl=(window.innerWidth - bw) / 2;
				dt=(window.innerHeight - bh) / 2;
				if(isNaN(dl)){dl=(document.body.offsetWidth - bw) / 2;} 
				if(isNaN(dt)){dt=(document.body.offsetWidth - bh) / 2;} 
				document.getElementById('img').style.top=dt;
				document.getElementById('img').style.left=dl;
				document.getElementById('img').style.width=bw;
				document.getElementById('img').style.height=bh;
				document.getElementById('img').innerHTML="<img src='" + bild + "' width=" + nw + " height=" + nh + " onclick=document.getElementById('img').style.display='none'><br><table><tr><td width=" + tw + ">" + txt + "</td><td align=right><a href='#' onclick=document.getElementById('img').style.display='none'>schlie&szlig;en</a></td></tr></table>";
				document.getElementById('img').style.display="block";
				
			}
     function startResize(id, height)
     {
          clearInterval(resizeIntervalId);
          if(height!=1){document.getElementById(id).style.display="block";}
          resizeIntervalId = setInterval("resize('" + id + "', " + height + ");", 1);
     }
     function startResize2(id, height,id2,height2)
     {
          clearInterval(resizeIntervalId);
          if(height!=1){document.getElementById(id + "a").style.display="block";}
          resizeIntervalId = setInterval("resize2('" + id + "', " + height + ",'" + id2 + "', " + height2 + ");", 1);
          
     }
     function resize2(id, height,id2,height2)
     {
          var element = document.getElementById(id);

          var nextSize;

          if(parseInt(element.style.height) == height)
          {
               clearInterval(resizeIntervalId);
               if(height==0){element.style.display="none";}
               resizeIntervalId = setInterval("resize('" + id2 + "', " + height2 + ");", 1);
               return;
          }
          else if(parseInt(element.style.height) > height)
          {
               nextSize = parseInt(element.style.height) - 5;
               if (nextSize<1) nextSize=1;
          }
          else
          {
               nextSize = parseInt(element.style.height) + 5;
               if (nextSize>height)nextSize=height;
          }
          //alert(nextSize);
 
          
          element.style.height = nextSize + "px";
     }
     function resize(id, height)
     {
          var element = document.getElementById(id);

          var nextSize;

          if(parseInt(element.style.height) == height)
          {
               clearInterval(resizeIntervalId);
               if(height==1){element.style.display="none";}
               return;
          }
          else if(parseInt(element.style.height) > height)
          {
               nextSize = parseInt(element.style.height) - 5;
               if (nextSize<1) nextSize=1;
          }
          else
          {
               nextSize = parseInt(element.style.height) + 5;
               if (nextSize>height)nextSize=height;
          }
          //alert(nextSize);
 
          
          element.style.height = nextSize + "px";
     }
  function switchimg(eid,img1,img2){
  	if ( document.getElementById )
    { 
    	if (document.getElementById( eid ).src == img1){
		    document.getElementById( eid ).src = img2 ;
		  }
		  else {
		    document.getElementById( eid ).src = img1 ;
		  } 
    	
    }
  }   
	function switchvis(eid,maxh){
    if ( document.getElementById )
    { 
    	if (document.getElementById( eid ).style.height == "1px"){
    		//alert("dran");
		    startResize(eid, maxh) ;
		  }
		  else {
		  //	alert("weg");
		    startResize(eid, 1) ;
		  } 
    	
    }
  }
  function simpleswitchvis(eid){
    if ( document.getElementById )
    { 
		var ele=document.getElementById('editfoot');
		for(i=0;i<ele.childNodes.length;i++)
		{
	
			if(ele.childNodes[i].nodeName=="DIV")
			{
				ele.childNodes[i].style.display = "none";
			}
		}
		document.getElementById( eid ).style.display = "block";
    	
    }
  }
  	function maxvis(eid,maxh,maxnodes,nodecount){
    if ( document.getElementById )
    { 

		    var i;
		    for(i=1;i<=maxnodes;i++)
		    {
		    	if(i!=nodecount)
		    	{
		    		document.getElementById("node" + i).style.height = "32px";
		    	}
		    }
		    document.getElementById( eid ).style.height = maxh + "px";

    	
    }
  }
  
    	function minvis(eid,maxh){
    if ( document.getElementById )
    { 

		    document.getElementById( eid ).style.height = "32px";
	
    	
    }
  }
  function getformabove(ele){
  	var tg = ele;
  	while (tg.nodeName != 'FORM'){
	    tg = tg.parentNode;}
		return tg
  }
  function getdivabove(ele){
  	var tg = ele;
  	while (tg.nodeName != 'DIV'){
	    tg = tg.parentNode;}
		return tg.id
  }
  	function switchvis2(eid,maxh,eid2){
    if ( document.getElementById )
    { 
    	 //alert('1');
    	if (document.getElementById( eid ).style.height == "1px"){
    		//alert("dran");
		    startResize2(eid, maxh, eid2, 1) ;
		  }
		  else {
		  	//alert("weg");
		    startResize2(eid, 1, eid2, maxh) ;
		  } 

    	
    }
  }

var bn_who="";
var bn_div="";

function kalender(s,div)
{	//document.getElementById('bn_frame').style.top=yPos + "px";
	//document.getElementById('bn_frame').style.left=xPos + "px";
	//document.getElementById('md_frame').style.display='none';	
	document.getElementById('bn_frame').style.display='none';	
	document.getElementById(div).style.display='block';	
	bn_who=s;
	bn_div=div;
}

init_mousemove();

var xPos="";
var yPos="";
var docEl = (   typeof document.compatMode != "undefined" && 
                 document.compatMode        != "BackCompat"
                )? "documentElement" : "body";

function init_mousemove() 
{    if(document.layers) document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove =	dpl_mouse_pos;
}

function dpl_mouse_pos(e) 
{   xPos    =  e? e.pageX : window.event.x;
  	yPos    =  e? e.pageY : window.event.y;

	
	if (document.all && !document.captureEvents && docEl) 
	{   xPos    += document[docEl].scrollLeft;
	    yPos    += document[docEl].scrollTop;
	}
    
    if (document.layers) routeEvent(e);
}


