var slideurl=new Array("5","12","24","23","32","3","36","26","27","14","11","31","33","21","30","37","4","6","19","18","9","15","29","34","1","35","20","17","7","2","28","16","25","22","8","10","13");
//var slideurl=new Array()
function zufall() {
	return (Math.random() - Math.random());
}
slideurl.sort(zufall);

var ppath="./img_cont/c/p";
var pcss='';//' class="imgSizeC" ';
var slidewidth=50
var slideheight=50
var divwidth=52
var pause=3
var preloadedimages=new Array()
for (i=0;i<slideurl.length;i++){
	preloadedimages[i]=new Image()
	preloadedimages[i].src=ppath+slideurl[i]+'.jpg'
}
var ns4=document.layers?1:0
var ns6=document.getElementById&&!document.all?1:0 
var ie=document.all?1:0
var imgpreload=new Array()
for (i=0;i<=slideurl.length-1;i++) {
	imgpreload[i]=new Image()
	//imgpreload[i].src=slideurl[i]
	imgpreload[i].src=ppath+slideurl[i]+".jpg"
}

var pos_left=0
var pos_top=0
var speed=20
var step=10
var i_loop=0
var i_image1=0
var i_image2=1
var i_space=""
var all_space=""
var max_space=20
var content=""
var i_slide=0
pause*=1000

function stretchimage() {
	if (i_loop<=divwidth) {
		if (ie) {
			imgcontainer1.innerHTML="<a href='referenz_"+slideurl[i_image1]+".html'><img width='"+i_loop+"' height='"+slideheight+"' src='"+ppath+slideurl[i_image1]+".jpg' border='0'"+pcss+"></a>"
			document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft+i_loop
			
			imgcontainer2.innerHTML="<a href='referenz_"+slideurl[i_image2]+".html'><img width='"+(slidewidth-i_loop)+"' height='"+slideheight+"' src='"+ppath+slideurl[i_image2]+".jpg' border='0'"+pcss+"></a>"
		}
		if (ns6) {
			document.getElementById('imgcontainer1').innerHTML="<a href='referenz_"+slideurl[i_image1]+".html'><img width='"+i_loop+"' height='"+slideheight+"' src='"+ppath+slideurl[i_image1]+".jpg' border='0'"+pcss+"></a>"
			document.getElementById('imgcontainer2').style.left=parseInt(document.getElementById('imgcontainer1').style.left)+i_loop
			
			document.getElementById('imgcontainer2').innerHTML="<a href='referenz_"+slideurl[i_image2]+".html'><img width='"+(slidewidth-i_loop)+"' height='"+slideheight+"' src='"+ppath+slideurl[i_image2]+".jpg' border='0'"+pcss+"></a>"
		}
		i_loop=i_loop+step
		var timer=setTimeout("stretchimage()",speed)
  	}
	else {
		clearTimeout(timer)
		var imgcontent="<a href='referenz_"+slideurl[i_image1]+".html'><img width='"+i_loop+"' height='"+slideheight+"' src='"+ppath+slideurl[i_image1]+".jpg' border='0'"+pcss+"></a>"
		if (ie) {
			imgcontainer1.innerHTML=imgcontent
			document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft+i_loop	
			imgcontainer2.innerHTML=""
		}
		if (ns6) {
			document.getElementById('imgcontainer1').innerHTML=imgcontent
	document.getElementById('imgcontainer2').style.left=parseInt(document.getElementById('imgcontainer1').style.left)+i_loop	
			document.getElementById('imgcontainer2').innerHTML=""
		
		}
		changeimage()
	}
}

function changeimage() {
	i_loop=0
	i_image1++
	if (i_image1>slideurl.length-1) {i_image1=0}
	i_image2=i_image1-1
	if (i_image2>slideurl.length-1) {i_image2=0}
	if (i_image2<0) {i_image2=slideurl.length-1}
	if (ie) {
		document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft
	}
	if (ns6) {
		document.getElementById('imgcontainer2').style.left=parseInt(document.getElementById('imgcontainer2').style.left)
	}
   	var timer=setTimeout("stretchimage()",pause)
}
function simpleslideshow() {
	i_slide++
	if (i_slide>=slideurl.length) {i_slide=0}
	document.slideimage.src=preloadedimages[i_slide].src
	var fadetimer=setTimeout("simpleslideshow()",pause)
}
function simpleslideshowjump() {
	document.location.href="referenz_"+slideurl[i_slide]+".html"
}
function startpslideshow(){
	if (ie || ns6) {
		var slideh=slideheight;//+30
		document.write("<div style=\"position:relative;width:"+divwidth+"px;height:"+slideh+"px;overflow:hidden\">")
		document.write("<div id=\"imgcontainer1\" style=\"position:absolute;width:"+divwidth+"px;height:"+slideh+"px;top:0px;left:0px\"><img src=\""+ppath+slideurl[0]+".jpg\""+pcss+"></div>")
			document.write("<div id=\"imgcontainer2\" style=\"position:absolute;width:"+divwidth+"px;height:"+slideh+"px;top:0px;left:0px\"><img src=\""+ppath+slideurl[1]+".jpg\""+pcss+"></div>")
		document.write("</div>")
		window.onload=stretchimage
	}
	else {
		document.write("<a href=\"javascript:simpleslideshowjump()\"><img name=\"slideimage\" src=\""+ppath+slideurl[0]+".jpg\" border=0"+pcss+"></a>")
		window.onload=simpleslideshow
	}
}

