/* aus ajax.js */
// --- Homepage and Sections
// ---
function makeRequestSiteFast(link) {
  var http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
      http_request = new XMLHttpRequest();
      if (http_request.overrideMimeType) {
          http_request.overrideMimeType('text/xml');
      }
  } else if (window.ActiveXObject) { // IE
      try {
          http_request = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
          try {
            http_request = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (e) {}
      }
  }

  if (!http_request) {
    //alert('XML Object konnte nicht erstellt werden!');
    return false;
  }

	http_request.onreadystatechange = function() { alertContentSiteFast(http_request); };
  http_request.open('GET', link, true);
  http_request.send(null);
}

function alertContentSiteFast(http_request) {
	if (http_request.readyState == 4) {
  	if (http_request.status == 200) {
  		var htmltext = new String;
  		htmltext = http_request.responseText;
  		if ( htmltext != "" ) {
  			var aContent = htmltext.split("*|*");
  			var part_num = 0;
  			document.getElementById('testajax').innerHTML = '';
				while (part_num < aContent.length) {
					var aTmp = aContent[part_num].split("#|#");

					//document.getElementById('ajaxKenner').innerHTML = document.getElementById('ajaxKenner').innerHTML + '-' + aTmp[0];
					if ( document.getElementById(aTmp[0]) ) {
						var Datum = new (Date);
						var Stunde = Datum.getHours();
						var Minute = Datum.getMinutes();
						var Sekunde = Datum.getSeconds();
						//document.getElementById('testajax').innerHTML = Stunde + ":" + Minute + ":" + Sekunde + "<br />" + document.getElementById('testajax').innerHTML + "<br />" + aTmp[0] + "<br>" + aTmp[1];
						//document.getElementById('testajax').innerHTML = Stunde + ":" + Minute + ":" + Sekunde + "<br />";
						document.getElementById(aTmp[0]).innerHTML = aTmp[1];
					}
					part_num++;
				}
      }
    } else {
      //alert('FEHLER: Server konnte nicht erreicht werden. Versuche sie es sp�ter noch einmal!');
    }
  }
}

function makeRequestSite(link) {
  var http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
      http_request = new XMLHttpRequest();
      if (http_request.overrideMimeType) {
          http_request.overrideMimeType('text/xml');
      }
  } else if (window.ActiveXObject) { // IE
      try {
          http_request = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
          try {
            http_request = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (e) {}
      }
  }

  if (!http_request) {
    //alert('XML Object konnte nicht erstellt werden!');
    return false;
  }

	http_request.onreadystatechange = function() { alertContentSite(http_request); };
  http_request.open('GET', link, true);
  http_request.send(null);
}

function alertContentSite(http_request) {
	if (http_request.readyState == 4) {
  	if (http_request.status == 200) {
  		var htmltext = new String;
  		htmltext = http_request.responseText;
  		if ( htmltext != "" ) {
  			var aContent = htmltext.split("#|#");
  			//alert(aContent[1]);
  			if ( document.getElementById(aContent[0]) ) {
  				document.getElementById(aContent[0]).innerHTML = aContent[1];
  			}
      }
    } else {
      //alert('FEHLER: Server konnte nicht erreicht werden. Versuche sie es sp�ter noch einmal!');
    }
  }
}

// --- RESET
function makeRequestSiteReset(link) {
	var http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
      http_request = new XMLHttpRequest();
      if (http_request.overrideMimeType) {
          http_request.overrideMimeType('text/xml');
      }
  } else if (window.ActiveXObject) { // IE
      try {
          http_request = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
          try {
            http_request = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (e) {}
      }
  }

  if (!http_request) {
    //alert('XML Object konnte nicht erstellt werden!');
    return false;
  }

	http_request.onreadystatechange = function() { alertContentSiteReset(http_request); };
  http_request.open('GET', link, true);
  http_request.send(null);
}

function alertContentSiteReset(http_request) {
	if (http_request.readyState == 4) {
  	if (http_request.status == 200) {
  		var htmltext = new String;
  		htmltext = http_request.responseText;
  		if ( htmltext != "" ) {
  			var aContent = htmltext.split("|");
  			var part_num = 0;
				while (part_num < aContent.length) {
					//alert(aContent[part_num]);
					if ( document.getElementById(aContent[part_num]) ) {
						document.getElementById(aContent[part_num]).style.backgroundColor = '';
					}
					part_num++;
				}
	  	}
    } else {
      //alert('FEHLER: Server konnte nicht erreicht werden. Versuche sie es sp�ter noch einmal!');
    }
  }
}

/* aus reload.js */
// --- SITE aktualisieren
var countDownIntervalSite = 8;
var countDownTimeSite = countDownIntervalSite;
function countDownSite() {
    --countDownTimeSite;

    host = location.host;

    //document.getElementById('countDownSite').innerHTML = document.getElementById('countDownSite').innerHTML + '*';
    //document.getElementById('ajaxKenner').innerHTML = countDownTimeSite;

    if (countDownTimeSite == countDownIntervalSite - 1) {
    	//document.getElementById('countDownSite').innerHTML = '';
    	document.getElementById('ajaxKenner').innerHTML = '';
    	link = "http://" + host + "/ajaxSite3Seconds.html";
    	makeRequestSiteFast(link);
    }

    if (countDownTimeSite < 0) {
    	//document.getElementById('countDownSite').innerHTML = '-----';
    	countDownTimeSite = countDownIntervalSite;
    }

    setTimeout("countDownSite()", 1000);
}


// --- SITE zur�cksetzen
var countDownIntervalSiteReset = 3;
var countDownTimeSiteReset = countDownIntervalSiteReset;

function countDownSiteReset() {
    --countDownTimeSiteReset;

    host = location.host;

		if (countDownTimeSiteReset < 0) {
  		countDownTimeSiteReset = countDownIntervalSiteReset;
    	link = "http://" + host + "/ajaxSiteReset.html";
	    makeRequestSiteReset(link);
    }

    setTimeout("countDownSiteReset()", 1000);
}

// ---

/* aus script.js */
function popupticker(site) {
 var breite=250;
 var hoehe=420;
 var positionX=((screen.availWidth / 2) - breite / 2);
 var positionY=((screen.availHeight / 2) - hoehe / 2);
 var url = site;
 pop = window.open('','xkt111','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,fullscreen=0,width='+breite+',height='+hoehe+',top=0,left=0');
 pop.resizeTo(breite,hoehe);
 pop.moveTo(positionX,positionY);
 pop.location=url;
}

onerror = stopError;

function stopError() { return true; }

function Flexfenster(mypage, myname, w, h, scroll) {
	// Quellfenstergr��e ermittlen und PopUp positionieren
	var size = new Array();
	size = browsersize();
	// size["breite"]+" "+size["hoehe"]);
	var left = size["breite"] - w;
	var top = 0;

	var toolbar = 0;
	var status = 0;
	var directories = 0;
	var win = window.open(mypage, myname, 'toolbar='+toolbar+',location=0,directories='+directories+',status='+status+',menubar=0,scrollbars=1,resizable=1,width='+w+',height='+h+',top='+top+',left='+left+'');
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}

function browsersize() {
	var size = new Array();
	size["hoehe"] = new Object();
	//size["hoehe"] = document.body.offsetHeight;
	size["hoehe"] = screen.availHeigt;
	size["breite"] = new Object();
	//size["breite"] = document.body.offsetWidth;
	size["breite"] = screen.availWidth;
	//alert(size["breite"]+" "+size["hoehe"]);
	return size;
}

var ok=false;
var URL = false;
function CheckFenster(link) {
	URL = link;
	var win=window.open("popupcheck.html", "win", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=0, height=0, top=0,left=0");
	setTimeout("Check()", 500);
}

function Check() {
	//alert(URL);
	if (ok==true) {
		var RichtigesFenster=window.open(URL, "win2", "toolbar=yes, location=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, width=820, height=560, top=0,left=1000");
		} else {
		//alert(unescape("Schade.%0AIhr Browser l%E4%DFt mein PopUp-Fenster nicht zu...%0ABitte richten Sie das in Ihren Einstellungen%21"));
	}
}

// MouseOver Effekt

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// --------------------------------------- TICKER -------------------------------------------- //

/***********************************************
* Memory Scroller script- � Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var memorywidth="600px" //scroller width
var memoryheight="20px" //scroller height
var memorybgcolor="#E7EFF1" //scroller background
var memorypadding="2px" //padding applied to the scroller. 0 for non.
var borderCSS="border: 0px solid black;" //Border CSS, applied to scroller to give border.

var memoryspeed=1 //Scroller speed (larger is faster 1-10)
var pauseit=1 //Pause scroller onMousever (0=no. 1=yes)?

var persistlastviewedmsg=1 //should scroller's position persist after users navigate away (1=yes, 0=no)?
var persistmsgbehavior="onload" //set to "onload" or "onclick".

//Specify the scroller's content (don't delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

var memorycontent='<nobr> +++ +++ +++ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +++ +++ +++ &nbsp;&nbsp;&nbsp;&nbsp; +++ +++ +++ &nbsp;&nbsp;&nbsp;&nbsp; +++ +++ +++</nobr>'


////NO NEED TO EDIT BELOW THIS LINE////////////
var combinedcssTable="width:"+(parseInt(memorywidth)+6)+"px;background-color:"+memorybgcolor+";padding:"+memorypadding+";"+borderCSS+";"
var combinedcss="width:"+memorywidth+";height:"+memoryheight+";"

var divonclick=(persistlastviewedmsg && persistmsgbehavior=="onclick")? 'onClick="savelastmsg()" ' : ''
memoryspeed=(document.all)? memoryspeed : Math.max(1, memoryspeed-1) //slow speed down by 1 for NS
var copyspeed=memoryspeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-10000px">'+memorycontent+'</span>')
var actualwidth=''
var memoryscroller

function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function savelastmsg(){
document.cookie="lastscrollerpos="+memoryscroller.style.left
}

function revivelastmsg(){
lastscrollerpos=parseInt(get_cookie("lastscrollerpos"))
memoryscroller.style.left=parseInt(lastscrollerpos)+"px"
}

if (persistlastviewedmsg && persistmsgbehavior=="onload")
window.onunload=savelastmsg

function scrollmarquee(){
if (parseInt(memoryscroller.style.left)>(actualwidth*(-1)+8))
memoryscroller.style.left=parseInt(memoryscroller.style.left)-copyspeed+"px"
else
memoryscroller.style.left=parseInt(memorywidth)+8+"px"
}

function hidden(tagid) {
			document.getElementById(tagid).style.display = "none";
		}

function show(tagid) {
			document.getElementById(tagid).style.display = "block";
		}

	function show10sec(tagid1, tagid2) {
			document.getElementById(tagid1).style.display = "block";
			document.getElementById(tagid2).style.display = "none";
		}

function neuesFenster(Ziel) {
	Fenster = window.open(Ziel, "neuesFenster");
	Fenster.focus();
}

function ausklappen(elementid) {
   document.getElementById(elementid).className = 'rsserkl�rung';
   document.getElementById('e'+elementid).className = 'sichtbar';
   document.getElementById('a'+elementid).className = 'unsichtbar';
   return false;
}

function einklappen(elementid) {
  document.getElementById(elementid).className = 'unsichtbar';
  document.getElementById('a'+elementid).className = 'sichtbar';
  document.getElementById('e'+elementid).className = 'unsichtbar';
  return false;
}

function alleeinklappen() {
  var i;
  for(i = 1; i<=48; i++) {
    document.getElementById(i).className = 'unsichtbar';
    document.getElementById('a'+i).className = 'sichtbar';
    document.getElementById('e'+i).className = 'unsichtbar';
  }
}

function alleausklappen() {
  var i;
  for(i = 1; i<=48; i++) {
    document.getElementById(i).className = 'rsserkl�rung';
    document.getElementById('e'+i).className = 'sichtbar';
    document.getElementById('a'+i).className = 'unsichtbar';
  }
}

/* Anfang Flash */
function runMyFlashGlobal(id,w,h) {
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+w+'" HEIGHT="'+h+'" id="'+id+'" ALIGN=""><PARAM NAME=movie VALUE="http://mdb.poppress.de/downloads/'+id+'.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="http://mdb.poppress.de/downloads/'+id+'.swf" quality=high bgcolor=#FFFFFF WIDTH="'+w+'" HEIGHT="'+h+'" NAME="'+id+'" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>\n');
}
function runMyFlashTicker() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="720" height="26" id="ticker" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/ticker.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="/flash/ticker.swf" quality="high" bgcolor="#ffffff" width="720" height="26" name="ticker" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>\n');
}

function runMyFlashTickerDemo() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="714" height="12" id="ad-hoc-ticker" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="/flash/ad-hoc-ticker.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="/flash/ad-hoc-ticker.swf" quality="high" bgcolor="#ffffff" width="714" height="12" name="ad-hoc-ticker" align="top" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>\n');
}

function runChartmailer() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="234" height="60" id="cm_01_234x60" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/cm_01_234x60.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#8b9c09" /><embed src="/flash/cm_01_234x60.swf" quality="high" bgcolor="#8b9c09" width="234" height="60" name="cm_01_234x60" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>\n');
}
/* Ende Flash */
window.onload=beginrefresh

function checkmail() {
	if (document.getElementsByName("aForm[termin]").length > 0) {
		if(getButtonValue("aForm[termin]") == '') {
			alert("Bitte w�hlen sie einen Termin!");
		  return false;
		}
	}
	if ( document.getElementsByName("aForm[vorname]")[0].value == '' ) {
		alert("Bitte geben Sie Ihren Vornamen ein!");
		return false;
	}
	if ( document.getElementsByName("aForm[nachname]")[0].value == '' ) {
		alert("Bitte geben Sie Ihren Nachnamen ein!");
		return false;
	}
  if ( document.getElementsByName("aForm[telefon]")[0].value == '' ) {
		alert("Bitte geben Sie eine Telefonnummer an!");
		return false;
	}
	if ( document.getElementsByName("aForm[email]")[0].value == '' ) {
		alert("Bitte geben Sie Ihre Email-Adresse ein!");
		return false;
	}
	if ( document.getElementsByName("aForm[plz]")[0].value == '' ) {
		alert("Bitte geben Sie Ihre Postleitzahl ein!");
		return false;
	}
	if ( document.getElementsByName("aForm[ort]")[0].value == '' ) {
		alert("Bitte geben Sie Ihren Wohnort ein!");
		return false;
	}
  if(document.getElementsByName("aForm[land]")[0].value == '') {
		alert("Bitte geben Sie das Land an, in dem Sie leben!");
	  return false;
	}

	if (tester() == false) {
		return false;
	}
}

function checkmailFactsheet() {

	if ( document.getElementsByName("aForm[vorname]")[0].value == '' ) {
		alert("Bitte geben Sie Ihren Vornamen ein!");
		return false;
	}
	if ( document.getElementsByName("aForm[nachname]")[0].value == '' ) {
		alert("Bitte geben Sie Ihren Nachnamen ein!");
		return false;
	}
  if ( document.getElementsByName("aForm[telefon]")[0].value == '' ) {
		alert("Bitte geben Sie eine Telefonnummer an!");
		return false;
	}
	if ( document.getElementsByName("aForm[email]")[0].value == '' ) {
		alert("Bitte geben Sie Ihre Email-Adresse ein!");
		return false;
	}
	if ( document.getElementsByName("aForm[strasse]")[0].value == '' ) {
		alert("Bitte geben Sie Ihre Stra�e ein!");
		return false;
	}
	if ( document.getElementsByName("aForm[plz]")[0].value == '' ) {
		alert("Bitte geben Sie Ihre Postleitzahl ein!");
		return false;
	}
	if ( document.getElementsByName("aForm[ort]")[0].value == '' ) {
		alert("Bitte geben Sie Ihren Wohnort ein!");
		return false;
	}
  if(document.getElementsByName("aForm[land]")[0].value == '') {
		alert("Bitte geben Sie das Land an, in dem Sie leben!");
	  return false;
	}

	if (tester() == false) {
		return false;
	}
}

function runMyFlashSound() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="1" height="1" id="bell" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/bell.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="/flash/bell.swf" quality="high" bgcolor="#ffffff" width="1" height="1" name="bell" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>\n');
}

function PopUnder() {
		var Neufenster = window.open("http://a.ligatus.de/?ids=6662", "AnderesFenster", "width=600,height=400");
		Neufenster.blur();
		top.focus();
	}
	
function oeffnefenster (url, fenster, breite, hoehe, watchlist) {
	if (breite == null) {
		breite = 310;
	}
	if (hoehe == null) {
		hoehe	= 490;
	}
	if (watchlist == null) {
		fenster = window.open(url, fenster, "width=" + breite + ",height=" + hoehe +",status=yes,toolbar=no,scrollbars=no,directories=no,resizable=no,location=no");
	} else {
		fenster = window.open(url, fenster, "width=" + breite + ",height=" + hoehe +",status=yes,toolbar=no,scrollbars=yes,directories=no,resizable=yes,location=no");
	}
	fenster.focus();
}
