var tmp_count = 0;

if(document.layers) 
{
	window.captureEvents(Event.MOUSEMOVE);
	window.onmousemove = koordinaten;
}
else 
{
	document.onmousemove = koordinaten;
}


function showDetails(popup, leftPos, topPos)
{
	var ns4 = document.layers?1:0;
	var dom = document.getElementById?1:0;
	ns4?ref="document.":ref="document.getElementById";


  	if (ns4) 
  	{
  		eval(ref + popup + '.top="' + topPos + '"');
  		eval(ref + popup + '.left="' + leftPos + '"');
  		eval(ref + popup + '.visibility="show"');
  	}
  	else if (dom) 
  	{
  		eval(ref + '("' + popup + '")' + '.style.top="' + topPos + '"');
  		eval(ref + '("' + popup + '")' + '.style.left="' + leftPos + '"');
  		eval(ref + '("' + popup + '")' + '.style.visibility="visible"');
	}	
	else
	{
         	eval(popup+".style.top="+topPos);
         	eval(popup+".style.left="+leftPos);
         	eval(popup+".style.visibility='visible'");
  	} 
}

function hideDetails(popup)
{
	var ns4 = document.layers?1:0;
	var dom = document.getElementById?1:0;
	
	ns4?ref="document.":ref="document.getElementById";

  	if (ns4) 
  	{
  		eval(ref + popup + '.visibility="hide"');
  	}
  	else if (dom) 
  	{
  		eval(ref + '("' + popup + '")' + '.style.visibility="hidden"');
	}
	else
	{
		eval(popup+".style.visibility='hidden'");
	}
}
        
function change_ticker_source(elem, source)
{        
	if(tmp_count < 1)
	{
        	if (source != elem.src)
			elem.src=source;
		
		tmp_count++;
	}
}


function koordinaten(e)
{
	xpos = (document.layers || (document.getElementById && !document.all)) ? e.pageX : document.body.scrollLeft + event.clientX;
	ypos = (document.layers || (document.getElementById && !document.all)) ? e.pageY : document.body.scrollTop + event.clientY;
}


function weiterleitungPopup(popup, element)
{
	topPos = ypos + 20;
	leftPos = xpos - 2;

	showDetails(popup, leftPos, topPos);
}

function showPopup(popup,breite,hoehe,scrollen)
{
	if(breite != 0)
	{
		if(screen.availWidth <= breite)
			myBreite = ',width='+(screen.availWidth-12);
		else
			myBreite = ',width='+breite;
	}
	else
		myBreite = '';
		
	if(hoehe != 0)
	{
		if(screen.availHeight < hoehe)
			myHoehe = ',height='+((screen.availHeight-25)-5);
		else
			myHoehe = ',height='+hoehe;
	}
	else
		myHoehe = '';

	if(scrollen != 0)
		scrollen = ',scrollbars='+scrollen;
	else
		scrollen = '';
		
	var leftPos = (screen.availWidth-breite) / 2;
	var topPos = (screen.availHeight-hoehe) / 2;

	if(topPos < 0)
		topPos = 0;
	if(leftPos < 0)
		leftPos = 0;	
	
		
	popupFenster = window.open(popup,'','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,top=' + topPos + ',left=' + leftPos + scrollen + myBreite + myHoehe);
        popupFenster.focus();
}

	function pruefen()
	{
		tmp_hinweistext = "";
		

		if(document.formular1.email.value == '' || document.formular1.email.value.length < 5)
		{
			tmp_hinweistext = "Bitte Email angeben.\n"+tmp_hinweistext;
			eval("document.formular1.email.focus()");
		}
		
		if(document.formular1.plz.value == '' || document.formular1.plz.value.length < 5)
		{
			tmp_hinweistext = "Bitte PLZ angeben.\n"+tmp_hinweistext;
			eval("document.formular1.plz.focus()");
		}
		
		if(document.formular1.vorname.value == '' || document.formular1.vorname.value.length < 2)
		{
			tmp_hinweistext = "Bitte Vorname angeben.\n"+tmp_hinweistext;
			eval("document.formular1.vorname.focus()");
		}

		if(document.formular1.name.value == '' || document.formular1.name.value.length < 2)
		{
			tmp_hinweistext = "Bitte Name angeben.\n"+tmp_hinweistext;
			eval("document.formular1.name.focus()");
		}			
			
		if(document.formular1.anrede.value == '' )
		{
			tmp_hinweistext = "Bitte Anrede angeben.\n"+tmp_hinweistext;
			eval("document.formular1.anrede.focus()");
		}
		
		if(tmp_hinweistext != '')
		{
			alert(tmp_hinweistext);
			return false;
		}
			
		return true;
	}
	
	
	function senden()
	{
		if(pruefen())
			document.formular1.submit();
	}