curPosition = 0;   
curPosition2 = 1;   
sliding = false;   
   
var images = new Array(6);   
   
function changeContent(content){   
   var element = document.getElementById('showBox');   
   //element.style.backgroundColor = content;   
   element.innerHTML = content;   
}   
   
   
function startSliding_l(){   
    //alert('hallo');   
    slidingInterval = setInterval('sliding_left()',100);   
}   
function startSliding_r(){   
       
    slidingInterval = setInterval('sliding_right()',100);   
}   
function sliding_left(anId){   
   if(curPosition2 <= -200 ){   
      stopSliding();   
   }   
   else{       
     speed = -6;   
     curPosition2 += speed;   
     curPosition2 = curPosition2   
	  document.getElementById(anId).style.left = curPosition2 +'px';   
	 }   
}   
function sliding_right(anId){   
    if(curPosition2 >= 0 ){   
      stopSliding();   
   }else{   
      speed = 6;   
      curPosition2 += speed;   
	    document.getElementById(anId).style.left = curPosition2 +'px';   
	 }   
}   
function stopSliding(){   
    clearInterval(slidingInterval);   
    sliding = false;   
    return;   
}   
   
   
function slideTo(section)   
{   
	if (section == 'home') { newPosition = 0;}    
	if (section == 'tour') { newPosition = -868; }    
	if (section == 'vorschau') { newPosition = -1790;}   
	if (section == 'service') { newPosition = -2645;} 
  if (section == 'anmeldung') {newPosition = -3356;}   
	//if (section == 'anmeldung') {newPosition = document.body.clientWidth -4325;}   
	slideInterval = setInterval('slide(newPosition)',10);   
	return;   
}   
   
function slide(newPosition)   
{   
	speed = (newPosition - curPosition)*0.075;   
	if (newPosition < curPosition) // rolling left   
	{   
		if (curPosition + speed - 1 <= newPosition) { clearInterval(slideInterval); sliding = false; return; }   
	} else { // rolling right   
		if (curPosition + speed + 1 >= newPosition) { clearInterval(slideInterval); sliding = false; return; }   
	}   
	curPosition += speed;   
	//alert(curPosition);   
	document.getElementById('free_container').style.left = curPosition +'px';   
}   
   
function openPop(url,nombre,location,menubar,toolbar,status,resizable,scrollbars,top,left,width,height) {   
	var hWndLinkExterno = window.open(url,nombre,"location="+location+",menubar="+menubar+",toolbar="+toolbar+",status="+status+",resizable="+resizable+",scrollbars="+scrollbars+",top="+top+",left="+left+",width="+width+",height="+height+"");   
	if ((document.window != null) && (!hWndLinkExterno.opener))	hWndLinkExterno.opener = document.window;   
}   
   
function center(){   
  element = document.getElementById('mainpage');    
  element.style.left = (document.body.clientWidth/2-515)+'px';   
}   
function cacheBgImage(){   
     
  images[0] = new Image();   
  images[0].src = "home/seite1.jpeg";   
     
  images[1] = new Image();   
  images[1].src = "tour/seite2.jpeg";    
     
  images[2] = new Image();   
  images[2].src = "vorschau/seite3.jpeg";    
     
  images[3] = new Image();   
  images[3].src = "service/seite4.jpeg";    
     
  images[4] = new Image();   
  images[4].src = "anmeldung/seite5.jpeg";    
     
     
  loadBgImage();   
   
}   
function loadBgImage(){   
      
    document.getElementById('home').style.backgroundImage = 'url(' + images[0].src + ')';   
    document.getElementById('home').style.backgroundRepeat = 'no-repeat';   
    document.getElementById('tour').style.backgroundImage = 'url(' + images[1].src + ')';   
    document.getElementById('tour').style.backgroundRepeat = 'no-repeat';   
    document.getElementById('vorschau').style.backgroundImage = 'url(' + images[2].src + ')';   
    document.getElementById('vorschau').style.backgroundRepeat = 'no-repeat';   
    document.getElementById('service').style.backgroundImage = 'url(' + images[3].src + ')';   
    document.getElementById('service').style.backgroundRepeat = 'no-repeat';   
    document.getElementById('anmeldung').style.backgroundImage = 'url(' + images[4].src + ')';   
    document.getElementById('anmeldung').style.backgroundRepeat = 'no-repeat';   
} 
 
function validate(aForm){ 
      
     if((aForm.username.value == null || aForm.username.value == '') && (aForm.password.value == null || aForm.password.value == '') ){ 
        openPop('http://www.echt-live.de/echtLive/allgemeines/anmeldung/index.html','Anmelden','no','no','no','no','no','yes',50,50,480,650); 
     } 
     else{ 
       return true; 
     } 
} 

