var wrapper=document.getElementById("homeshow");wrapper.style.position="absolute";wrapper.style.top="190px";wrapper.style.left="50%";wrapper.style.marginLeft="-250px";wrapper.style.width="500px";wrapper.style.height="350px";wrapper.style.background="#6fb0d8";var current=document.getElementById("current");anzahlBereiche=wrapper.getElementsByTagName("div").length-1;for(i=0;i<=anzahlBereiche;i++){eval("var sector"+i+" = document.getElementById('sector"+i+"');");eval("sector"+i+".style.display='none';")}function switching(a){eval("sector"+current.innerHTML+".style.display='none';");show=a=="next"?(current.innerHTML*1+1)%anzahlBereiche:(current.innerHTML*1-1)%anzahlBereiche;if(show<=0)show=anzahlBereiche;current.innerHTML=show;progress.style.left=91/(anzahlBereiche-1)*(show-1)+4+"%";eval("content.appendChild(sector"+show+");");eval("sector"+show+".style.display='inline';")}function play(){if(isPlay){switching("next");window.setTimeout("play()",7000)}}var progress=document.createElement("div");progress.style.position="absolute";progress.style.left=91/(anzahlBereiche-1)*(current.innerHTML*1-1)+4+"%";progress.style.top="5px";progress.style.width="3px";progress.style.height="10px";progress.style.background="white";var content=document.createElement("div");content.style.position="absolute";content.style.left="20px";content.style.right="20px";content.style.top="20px";content.style.bottom="70px";content.style.background="white";eval("content.appendChild(sector"+current.innerHTML+");");eval("sector"+current.innerHTML+".style.display = 'inline';");var control=document.createElement("div");control.style.position="absolute";control.style.left="20px";control.style.right="20px";control.style.bottom="10px";control.style.height="50px";control.style.background="#6fb0d8";var playBtn=document.createElement("div");playBtn.style.cursor="pointer";playBtn.style.position="absolute";playBtn.style.left="50%";playBtn.style.marginLeft="-35px";playBtn.style.width="70px";playBtn.style.height="50px";playBtn.style.background="url('img/playBtn.jpg')";playBtn.onclick=function(){if(isPlay){isPlay=false;playBtn.style.background="url('img/playBtn.jpg')"}else{isPlay=true;playBtn.style.background="url('img/pauseBtn.jpg')";play()}};var prevBtn=document.createElement("div");prevBtn.style.cursor="pointer";prevBtn.style.position="absolute";prevBtn.style.width="70px";prevBtn.style.height="50px";prevBtn.style.background="url('img/prevBtn.jpg')";prevBtn.onclick=function(){isPlay=false;playBtn.style.background="url('img/playBtn.jpg')";switching("prev")};var nextBtn=document.createElement("div");nextBtn.style.cursor="pointer";nextBtn.style.position="absolute";nextBtn.style.right="0px";nextBtn.style.width="70px";nextBtn.style.height="50px";nextBtn.style.background="url('img/nextBtn.jpg')";nextBtn.onclick=function(){isPlay=false;playBtn.style.background="url('img/playBtn.jpg')";switching("next")};control.appendChild(prevBtn);control.appendChild(playBtn);control.appendChild(nextBtn);wrapper.appendChild(progress);wrapper.appendChild(content);wrapper.appendChild(control);isPlay=true;playBtn.style.background="url('img/pauseBtn.jpg')";window.setTimeout("play()",7000);
