var go=1;
var zaehler=100;
var speed=50;
var einblenddauer=10;
var pause=100;
var einschalten=false;
var divs=new Array(157,125,'<table border="0" class="dropdown" cellspacing="2" cellpadding="3"><tr><td><a href="./ueber.php">Qualität</a></td></tr><tr><td><a href="./kapazitaeten.php">Kapazitäten</a></td></tr><tr><td><a href="./regionen.php">Regionen</a></td></tr><tr><td><a href="./leistungen.php">Leistungen</a></td></tr></table>',312,125,'<table border="0" class="dropdown" cellspacing="2" cellpadding="3"><tr><td><a href="./preise.php">Preise</a></td></tr><tr><td><a href="./delis.php">Delis</a></td></tr><tr><td><a href="./express.php">Express</a></td></tr><tr><td><a href="./abholung.php">Abholung</a></td></tr><tr><td><a href="./pakete.php">Paketgr&ouml;&szlig;e</a></td></tr></table>');


function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function initDiv(divnr)
{
if(einschalten==true){
	if (document.getElementById)
	{
		dyndivId = 'fadedivholder1';
		dyndiv = document.getElementById(dyndivId);
		setOpacity(dyndiv, 0);
		var a=divnr*3;
		dyndiv.style.top=divs[(a+1)]+"px";
		dyndiv.style.left=divs[a]+"px";
		dyndiv.innerHTML=divs[(a+2)];
		dyndiv.style.visibility = "visible";
		fadeIn(dyndivId,0,divnr);
		div_stop();
	}
}
}

function fadeIn(objId,opacity,divnr)
{
	if (document.getElementById)
	{
  		obj = document.getElementById(objId);
  		if (opacity < 100)
		{
   			opacity += speed*3;
			if (opacity>100) opacity=100;
   			setOpacity(obj, opacity);
   			window.setTimeout("fadeIn('"+objId+"',"+opacity+","+divnr+")", 70);
  		}
		else eingeblendet_lassen(einblenddauer,divnr);
 	}
}

function fadeOut(objId,opacity,divnr)
{
  window.setTimeout("outfading('"+objId+"',"+opacity+","+divnr+")", 1000);
}

function outfading(objId,opacity,divnr){
 if (document.getElementById)
 {
  	obj = document.getElementById(objId);
  	if (opacity > 0)
	{
   		opacity -= speed*3;
		if (opacity<0) opacity=0;
   		setOpacity(obj, opacity);
   		window.setTimeout("outfading('"+objId+"',"+opacity+","+divnr+")", 70);
  	}
	else ausgeblendet_lassen(pause,divnr);
 }
}

function eingeblendet_lassen(zaehler,divnr)
{
	if (zaehler>0)
	{
   		zaehler -=1;
   		window.setTimeout("eingeblendet_lassen('"+zaehler+"',"+divnr+")", 100);
	}
	else
	{
		if (go==1) fadeOut(dyndivId,100,divnr);
   		else window.setTimeout("eingeblendet_lassen('"+zaehler+"',"+divnr+")", 100);
	}
}

function ausgeblendet_lassen(zaehler,divnr)
{
document.getElementById('fadedivholder1').style.visibility = "hidden";
}

function div_stop() { go=0; }
function div_go() { go=1; }

function setOpacity(obj, opacity) {
 opacity = (opacity == 100)?99.999:opacity; // IE/Win
 obj.style.filter = "alpha(opacity:"+opacity+")"; // Safari<1.2, Konqueror
 obj.style.KHTMLOpacity = opacity/100;  // Older Mozilla and Firefox
 obj.style.MozOpacity = opacity/100; // Safari 1.2, newer Firefox and Mozilla, CSS3
 obj.style.opacity = opacity/100;
}

function check_kontakt(){
 var fehler=false;
 if(document.kontakt.Name.value==""||document.kontakt.Name.value=="Bitte geben Sie einen Namen an"){document.kontakt.Name.value="Bitte geben Sie einen Namen an";document.kontakt.Name.style.backgroundColor='#CC0033';
 fehler=true;}
 if(document.kontakt.StrasseNr.value==""||document.kontakt.StrasseNr.value=="Bitte geben Sie eine Strasse an"){document.kontakt.StrasseNr.value="Bitte geben Sie eine Strasse an";document.kontakt.StrasseNr.style.backgroundColor='#CC0033';
 fehler=true;}
 if(document.kontakt.PLZ.value==""){document.kontakt.PLZ.style.backgroundColor='#CC0033';
 fehler=true;}
 if(document.kontakt.Ort.value==""||document.kontakt.Ort.value=="Bitte geben Sie einen Ort an"){document.kontakt.Ort.value="Bitte geben Sie einen Ort an";document.kontakt.Ort.style.backgroundColor='#CC0033';
 fehler=true;}
 if(document.kontakt.email.value==""||document.kontakt.email.value=="Bitte geben Sie eine Mailadresse an"){document.kontakt.email.value="Bitte geben Sie eine Mailadresse an";document.kontakt.email.style.backgroundColor='#CC0033';
 fehler=true;}
 if(document.kontakt.Text.value==""||document.kontakt.Text.value=="Bitte geben Sie eine Nachricht an"){document.kontakt.Text.value="Bitte geben Sie eine Nachricht an";document.kontakt.Text.style.backgroundColor='#CC0033';
 fehler=true;}

 if(fehler)return false;
 else return true;

}
