You basically need to start with a JavaScript that already works the way you want it. If you try to fix a script that doesn't work now, it will take longer to find out what the problem is and fix it.
Magic Slideshow is HTML, XHTML and CSS compliant. It works on iPhones and iPads. It has a lot of popular options: http://www.magictoolbox.com/magicslideshow/
Also use the W3C validator to check that your HTML code is correct:
http://validator.w3.org/
Looking at your code, there is a missing close tag >. You should change this:
Code:
<h1><img id="log" src="logo.jpg">Potrait Photo Slideshow<img id="log" src="logo.jpg"</h1>
To this:
Code:
<h1><img id="log" src="logo.jpg">Potrait Photo Slideshow<img id="log" src="logo.jpg"></h1>
If you don't see the difference, it is the > towards the end of the line.
You also have two <form> tags and only one </form> tag.