// URLs of slides
var slideurl=new Array(
	"start/neu/01.gif",
	"start/neu/02.gif",
	"start/neu/03.gif",
	"start/neu/04.gif",
	"start/neu/05.gif",
	"start/neu/06.gif",
	"start/neu/07.gif",
	"start/neu/01.gif",
	"start/neu/02.gif",
	"start/neu/03.gif",
	"start/neu/04.gif"
);

// comments displayed below the slides
var slidecomment=new Array("")

// links for each slide
var slidelink=new Array("")

// targets of the links. Allowed values: "_parent", "_top", "_blank", "_self"
var slidetarget=new Array("_blank","_blank","_blank","_blank","_blank","_blank")

// the width of the slideshow (pixels)
var scrollerwidth=448

// the height of the slideshow (pixels)
var scrollerheight=112

//Background image; z.B. "background.gif"
var background_image="start/neu/laufband_background.gif"

// width of the transparent zones (pixels)
var translayerszone=0

// font-attributes for the comments
var slidefont="Arial"
var slidefontcolor="blue"
var slidefontsize="1"

// background-color of webpage 
var pagebgcolor="#F6D200"

// do not edit below this line
var translayerswidth=0;
var translayersmax=Math.floor(translayerszone/translayerswidth);  //ist 0 da >var translayerszone=0<
var translayersleftpos=0;
var translayersopacity=60;
var translayersfactor=100/translayersmax;
var translayerswidthall=translayersmax*translayerswidth;
var allpicturewidth=0;
var distancepictopic=0;
var scrollerleft=0;
var scrollertop=0;
var pause=18;
var step=1;
var newstep=step;
var clipleft,clipright,cliptop,clipbottom;
var i_picture=0;
var timer;
var picturecontent="";
var ns4=document.layers?1:0;
var ns6=document.getElementById&&!document.all?1:0 ;
var ie=document.all?1:0;
var browserinfos=navigator.userAgent ;
var opera=browserinfos.match(/Opera/)  ;

var preloadedimages=new Array();			//bildspeicher
for (i=0;i<slideurl.length;i++)
{		//lade bild
	preloadedimages[i]=new Image();		//definition Image
	preloadedimages[i].src=slideurl[i];	//lade bild in ns array
}

function init()
{
		allpicturewidth=document.getElementById('emptypicturediv').offsetWidth; //emptypicturediv
		document.getElementById('picturediv').style.top=scrollertop;
    document.getElementById('picturediv').style.left=0; //scrollerleft+scrollerwidth
		clipleft=0;
		clipright=scrollerwidth;
		cliptop=0;
		clipbottom=scrollerheight;
		document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")";
		document.getElementById('picturediv').style.visibility="visible";
		scrollpicture();
}

function scrollpicture()
{
//	alert(document.getElementById('picturediv').style.left+"-"+clipright+"-"+allpicturewidth);
		if(clipright > (slideurl.length*112))
		{
			var timer=setTimeout("resetposition()",pause);
		}
		else
		{
			document.getElementById('picturediv').style.left=parseInt(document.getElementById('picturediv').style.left)-step;
			clipright = clipright + step;
			document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")";
			var timer=setTimeout("scrollpicture()",pause);
		}
}

function onmsover()
{
	step=0;
}
function onmsout()
{
	step=newstep;
}

function resetposition()
{
	allpicturewidth=document.getElementById('emptypicturediv').offsetWidth;  //emptypicturediv
    document.getElementById('picturediv').style.left= 0; //scrollerleft+scrollerwidth //startposition, nicht sichbar
	clipleft=0;
	clipright=scrollerwidth; //sichtbar
	document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")";
    scrollpicture();
}

picturecontent="";   //rahmen für die bilder
picturecontent+="<table cellpadding=0 cellspacing=0>"; //tabelle + hintergrundbild
picturecontent+="<tr>";   
for (i=0; i < slideurl.length; i++)
{
	picturecontent+="<td>";
	picturecontent+="<img src=\""+slideurl[i]+"\" border=0></a>";
	picturecontent+="</td>";
}
picturecontent+="</tr>";
picturecontent+="<tr>";
for (i=0;i< slideurl.length; i++)
{
	picturecontent+="<td>";
	picturecontent+="<font face=\""+slidefont+"\" color=\""+slidefontcolor+"\" size="+slidefontsize+">";
	picturecontent+=slidecomment[i];
	picturecontent+="</font>";
	picturecontent+="</td>";
}
picturecontent+="</tr>";
picturecontent+="</tr></table>";

if (ie || ns6)
{  //ein layer wird gelegt
	document.write('<div style="background-image: url('+background_image+');position:relative;width:'+scrollerwidth+'px;height:'+scrollerheight+'px;overflow:hidden">')  //sicherbarer layer!
	document.write('<div id="picturediv" style="position:absolute;top:0px;left:0px;height:'+scrollerheight+'px;visibility:hidden">'+picturecontent+'</div>')  //darstellung des Picturecontent im div Tag
	if (ie)
  {
		for (i=0;i<=translayersmax;i++)
    {
		document.write('<span ID="trans'+i+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width:'+translayerswidth+'px;height:'+scrollerheight+'px;background-color:'+pagebgcolor+';filter:alpha(opacity='+translayersopacity+');overflow:hidden"> </span>')
		translayersleftpos+=translayerswidth
		translayersopacity-=translayersfactor
		}
		translayersleftpos=scrollerwidth-translayersleftpos
		for (ii=0;ii<=translayersmax;ii++)
    {
		document.write('<span ID="trans'+ii+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width:'+translayerswidth+'px;height:'+scrollerheight+'px;background-color:'+pagebgcolor+';filter:alpha(opacity='+translayersopacity+');overflow:hidden"> </span>')
		translayersleftpos+=translayerswidth
		translayersopacity+=translayersfactor
		}
	}
	if (ns6)
  {
		for (i=0;i<=translayersmax-1;i++)
    {
  		document.write('<span ID="transleft'+i+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width:'+translayerswidth+'px;height:'+scrollerheight+'px;background-color:'+pagebgcolor+';-moz-opacity:'+translayersopacity/100+';overflow:hidden"> </span>')
  		translayersleftpos+=translayerswidth
  		translayersopacity-=translayersfactor
		  if (translayersopacity<0) {translayersopacity=0.001}
		}
		translayersleftpos=scrollerwidth-translayersleftpos
		translayersopacity=0.001
		for (i=0;i<=translayersmax-1;i++)
    {
  		document.write('<span ID="transright'+i+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width:'+translayerswidth+'px;height:'+scrollerheight+'px;background-color:'+pagebgcolor+';-moz-opacity:'+translayersopacity/100+';"> </span>')
  		translayersleftpos+=translayerswidth
  		translayersopacity+=translayersfactor
		}
	}
	document.write('</div>')
	
    //

	window.onload=init
}