function getRealLeft(el) 
{
	xPos = el.offsetLeft;
	tempEl = el.offsetParent;
	while (tempEl != null) 
	{
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	return xPos;
}

function getRealTop(el) 
{
	yPos = el.offsetTop;
	tempEl = el.offsetParent;
	while (tempEl != null) 
	{
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
	return yPos;
}
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'img/header/head_1.jpg'
Pic[1] = 'img/header/head_2.jpg'
Pic[2] = 'img/header/head_3.jpg'
Pic[3] = 'img/header/head_4.jpg'
Pic[4] = 'img/header/head_5.jpg'
Pic[5] = 'img/header/head_6.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

function checkForm(f)
{
	for(var i=0; f.length>i; i++)
	{
		if( ( (f[i].type.indexOf('text')>-1) && (f[i].name.indexOf('Vorname')>-1) ) && (!f[i].value))
		{
			alert('Bitte das Feld "' +  f[i].name + '" ausfuellen!')
			f[i].style.backgroundColor='ffffcc';
			f[i].focus();
			return false;   
		}
		else if( ( (f[i].type.indexOf('text')>-1) && (f[i].name.indexOf('Nachname')>-1) ) && (!f[i].value))
		{
			alert('Bitte das Feld "' +  f[i].name + '" ausfuellen!')
			f[i].style.backgroundColor='ffffcc';
			f[i].focus();
			return false;   
		}   
		else if( ( (f[i].type.indexOf('text')>-1) && (f[i].name.indexOf('Emailadresse')>-1) ) && (!f[i].value))
		{
			alert('Bitte das Feld "' +  f[i].name + '" ausfuellen!')
			f[i].style.backgroundColor='ffffcc';
			f[i].focus();
			return false;   
		}
	}

	//Mail näher checken
	m=document.forms[0].Emailadresse;
	if(!m.value.match(/^.+@.+\..{2,4}$/))
	{
		alert('Bitte gueltige Mailadresse angeben')
		m.focus();
		return false;
	}
	return true;
}
