<!--
function kalender(adresse)
{
    kal_win = window.open(adresse,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,dependent=yes')
	kal_win.focus()
}
function oeffnen(fenster,breite,hoehe)
{
  x = (screen.width - breite)/2;
  y = (screen.height - hoehe)/2;
  imgwindow = window.open(fenster,"imgwindow","width="+breite+", height="+hoehe+", screenX="+x+", screenY="+y+", dependent=yes, scrollbars=no");
  imgwindow.focus();
}
function openslide(adresse,breite,hoehe)
{
  x = (screen.width - breite)/2;
  y = (screen.height - hoehe)/2;
  imgwindow = window.open(adresse,"SlideShow","width="+breite+", height="+hoehe+", screenX="+x+", screenY="+y+", dependent=yes");
  imgwindow.focus();
}
function oeffnenx(fenster,breite,hoehe)
{
  x = (screen.width - breite)/2;
  y = (screen.height - hoehe)/2;
  adrwindow = window.open(fenster,"adrwindow","width="+breite+", height="+hoehe+", screenX="+x+", screenY="+y+", dependent=yes, scrollbars=yes");
  adrwindow.focus();
}

function openwindow(adresse, titel)
{
	f = window.open(adresse,titel,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,dependent=no')
	f.focus()
}

function yesorno(txt,parameter)
{
	Check = confirm(txt);
	if(Check == true)
	{
   		document.location=parameter;
	}
}

function deletepicture(txt,parameter) 
{ 
  Check = confirm(txt); 
  if(Check == true) 
  { 
    oeffnen(parameter,1,1); 
    self.close();
  } 
}

function removefile(txt,parameter) 
{ 
  Check = confirm(txt); 
  if(Check == true) 
  { 
    oeffnen(parameter,1,1); 
  } 
}

function wordCounter(_form, _field, maxlimit)
{
  var _string="";
  var _wordCount=0;
  var _obj=eval("_form."+_field);
  var _IsSpace=false;
  var _WasSpace=false;
  for (var _x=0;_x<_obj.value.length;_x++)
  {
    _WasSpace=_IsSpace;
    _IsSpace=(_obj.value.charAt(_x) == " ");
    
    if(_IsSpace && ! _WasSpace)
    {
      _wordCount++;
      if(_wordCount<maxlimit)
        _string+=" ";
    }
    else if(!_IsSpace)
    {
      if(_wordCount<maxlimit)
        _string+=_obj.value.charAt(_x);
    }
  }
  _obj.value=_string;
  _form.wordCount.value=_wordCount;
}

function charCounter(_form, _field, maxlimit)
{
  var _string="";
  var _charCount=0;
  var _obj=eval("_form."+_field);
  for (var _x=0;_x<_obj.value.length;_x++)
  {
      if((maxlimit-_charCount)>0)
      {
		_charCount++;
        _string+=_obj.value.charAt(_x);
	  }
  }
  _obj.value=_string;
  //_form.charCount.value=_charCount;
  document.getElementById('charCount').innerHTML=maxlimit-_charCount;
}

function URLEncode(plaintext)
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";
	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '"
                        + ch
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for
	return plaintext;
}

function URLDecode(encoded)
{
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef";
   var plaintext = "";
   var i = 0;
   while (i < encoded.length) {
       var ch = encoded.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (encoded.length-2)
					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1
					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				alert( 'Bad escape combination near ...' + encoded.substr(i) );
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	} // while
   return plaintext;
}

// Get the HTTP Object
//global
var httpObject = null;
var globalMID = null;

function getHTTPObject()
{
    if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
    else if (window.XMLHttpRequest) return new XMLHttpRequest();
    else 
	{
      alert("Your browser does not support AJAX.");
      return null;
    }
}
//tracker menu
function setTrackerMenu()
{
	if(httpObject.readyState == 4)
	{
		document.getElementById('trackermenu').innerHTML = httpObject.responseText;
	}
}
function loadTrackerMenu(mid)
{
	httpObject = getHTTPObject();
	if (httpObject != null) 
	{
	  httpObject.open("GET", "menu"+mid+".php?mid="+mid, true);
	  httpObject.send(null);
	  httpObject.onreadystatechange = setTrackerMenu;
	}
	else
	{
		document.getElementById('trackermenu').innerHTML = 'AXJAX error !';
	}
}

//main content
function setMainContent()
{
	if(httpObject.readyState == 4)
	{
		//document.getElementById('contentmain').innerHTML = httpObject.responseText+"<div id=contentsub>&nbsp;</div><div><a href=#top>Seitenanfang</a></div>";
	    document.getElementById('contentmain').innerHTML = httpObject.responseText+"<div id=contentsub>&nbsp;</div>";		
		if(globalMID == 9)
		{
			document.loginform.name.focus();
		}
		//document.getElementById('footer').style.top=document.getElementById('contentmain').offsetTop+document.getElementById('contentmain').offsetHeight+'px';
	}
}
function loadMainContent(id,mid,limit)
{
	httpObject = getHTTPObject();
	globalMID = mid;
	if (httpObject != null) 
	{
	  httpObject.open("GET", "content"+mid+".php?id="+id+"&mid="+mid+"&limit="+limit, true);
	  httpObject.send(null);
	  httpObject.onreadystatechange = setMainContent;
	}
	else
	{
		document.getElementById('contentmain').innerHTML = 'AXJAX error !';
	}
}
//sub content
function setSubContent()
{
	if(httpObject.readyState == 4)
	{
		document.getElementById('contentsub').innerHTML = httpObject.responseText;
		document.getElementById('img_content').style.display = 'none';
	}
}
function loadSubContent(id,mid,smid)
{
	httpObject = getHTTPObject();
	if (httpObject != null) 
	{
	  httpObject.open("GET", "subcontent"+smid+".php?id="+id+"&mid="+mid+"&smid="+smid, true);
	  httpObject.send(null);
	  httpObject.onreadystatechange = setSubContent;
	}
	else
	{
		document.getElementById('contentsub').innerHTML = 'AXJAX error !';
	}
}

//content detail
function setContentDetail()
{
	if(httpObject.readyState == 4)
	{
		document.getElementById('contentsub').innerHTML = httpObject.responseText;
	}
}
function loadContentDetail(id,mid,smid,aid)
{
	httpObject = getHTTPObject();
	if (httpObject != null) 
	{
	  httpObject.open("GET", "contentdetail.php?id="+id+"&mid="+mid+"&smid="+smid+"&aid="+aid, true);
	  httpObject.send(null);
	  httpObject.onreadystatechange = setContentDetail;
	}
	else
	{
		document.getElementById('contentsub').innerHTML = 'AXJAX error !';
	}
}
//news bar left
function setNewsBar()
{
	if(httpObject.readyState == 4)
	{
		document.getElementById('contentnews').innerHTML = httpObject.responseText;
	}
}
function loadNewsBar()
{
	httpObject = getHTTPObject();
	if (httpObject != null) 
	{
	  httpObject.open("GET", "contentnews.php", true);
	  httpObject.send(null);
	  httpObject.onreadystatechange = setNewsBar;
	}
	else
	{
		document.getElementById('contentnews').innerHTML = 'AXJAX error !';
	}
}
//meeting bar left
function setMeetingBar()
{
	if(httpObject.readyState == 4)
	{
		document.getElementById('contentmeeting').innerHTML = httpObject.responseText;
	}
}
function loadMeetingBar()
{
	httpObject = getHTTPObject();
	if (httpObject != null) 
	{
	  httpObject.open("GET", "contentmeeting.php", true);
	  httpObject.send(null);
	  httpObject.onreadystatechange = setMeetingBar;
	}
	else
	{
		document.getElementById('contentmeeting').innerHTML = 'AXJAX error !';
	}
}
//-->

