document.write('<div style="display:table; height:450px; margin:0 auto"><div style="display:table-cell; text-align:center; vertical-align:middle"><div class="foto1" style="margin:0"><img id="pict" src="1.jpg" /><br /><span id="text"></span></div></div></div>');
document.write('<div style="text-align:center">');
document.write('<button onclick="back();restart()"><img src="/slideshow/prev.gif" /></button>');
document.write('<button onclick="pause()"><img src="/slideshow/pause.gif" /></button>');
document.write('<button onclick="play()"><img src="/slideshow/play.gif" /></button>');
document.write('<select id="speed" onchange="restart()">');
document.write('<option value="10000">10 sec</option>');
document.write('<option value="7500">7,5 sec</option>');
document.write('<option value="5000">5 sec</option></select>');
document.write('<button onclick="next();restart()"><img src="/slideshow/next.gif" /> <img id="preview" src="2.jpg" style="height:20px" /></button>');
document.write('<input id="count" onchange="a=parseInt(value);play();change()" onfocus="pause();value=a" size="4" type="text" />');
document.write('</div>');
a=1;
c=0;
function button(number,style){document.getElementsByTagName("button")[number].style.display=style;}
function change(){document.getElementById("pict").src=a+".jpg";document.getElementById("preview").src=(a<b)?a+1+".jpg":"1.jpg";document.getElementById("count").value=a+"/"+b;if(c!=0){var x=a;while(!c[x])x--;document.getElementById("text").innerHTML=c[x]};}
function back(){(a>1)?a--:a=b;change();}
function restart(){if(document.getElementsByTagName("button")[1].style.display==""){window.clearInterval(slideshow);slideshow=window.setInterval("next()",document.getElementById("speed").value);}}
function pause(){window.clearInterval(slideshow);button(1,"none");button(2,"");}
function play(){slideshow=window.setInterval("next()",document.getElementById("speed").value);button(1,"");button(2,"none");}
function next(){(a<b)?a++:a=1;change();}
window.onload=function(){play();change();};

