var applicationPath = "";
var currSlide = 0;
var slideShowTimeout = 1000;
var slideShowFadeTimeout = 500;

var allImages = new Array();
allImages[0]='home_bg1.jpg';
allImages[1]='home_bg2.jpg';
allImages[2]='home_bg3.jpg';
allImages[3]='home_bg4.jpg';
allImages[4]='home_bg5.jpg';


function resizeContent(){
        if(!document.getElementById("warteck_navigation")){return false;}
        var innerwinheight = window.innerHeight;
        var navigationheight = document.getElementById("warteck_navigation").offsetHeight;
        if(innerwinheight == undefined || innerwinheight == 0){
                innerwinheight = document.documentElement.clientHeight;
        }
        if(innerwinheight-200 > navigationheight ){
                document.getElementById("warteck_content").style.height = innerwinheight-200+"px";
        }else{
                document.getElementById("warteck_content").style.height = navigationheight;
        }
}
function changeSlides(){
    nextSlide();
    setTimeout('changeSlides()',slideShowTimeout);
}
function nextSlide(){
    fadeOut();
}
function fadeOut(){
        opacity('warteck_content_home', 100, 0, slideShowFadeTimeout);
        setTimeout('loadNextImage()',slideShowFadeTimeout);
}
function loadNextImage(){
	if(++currSlide>=allImages.length){
		currSlide = 0;
	}
	document.getElementById('warteck_content_home').style.backgroundImage = "url("+applicationPath+"/docroot/warteck/images/"+allImages[currSlide]+")";
        fadeIn();
}
function fadeIn(){
        opacity('warteck_content_home', 0, 100, slideShowFadeTimeout);
}
function showDetail(foo, w, h){
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    myWindow = window.open(foo,'myWin','width='+w+',height='+h+',top='+wint+',left='+winl+',scrollbars=no,resizable=no');
    myWindow.focus();
}
function setApplicationPath(thepath){
    applicationPath = thepath;
}
function setSlideShowTimeout(slideShowTimeout){
    slideShowTimeout = slideShowTimeout;
}