[js]
<html>
<head>
<script type="text/javascript">
var array = new Array(
"1.jpg",
"2.jpg",
"3.jpg",
"4.jpg",
"5.jpg",
"6_s.jpg",
"7.jpg",
"8.jpg",
"9.jpg"
);
var i = 0;
function left() {
var image = document.getElementById("rbutton");
var dis = document.getElementById("dis");
i--;
if (i<0) i = array.length - 1;
image.src = array[i];
}
function right() {
var image = document.getElementById("rbutton");
i++;
if (i == array.length) i = 0;
image.src = array[i];
}
</script>
</head>
<body>
<br>
<br>
<br>
<table align=center>
<tr>
<td>
<input id='dis' type = 'image' src='s1.jpg' width = '20' height = '20' name = 'left' value = '<' onclick = 'left()' />
</td>
<td>
<script type = 'text/javascript'>
document.write("<img id = 'rbutton' src = '" + array[0] + "' alt = 'Картинка' width = '500' height = '500' />");
</script>
</td>
<td>
<input type = 'image' src='s2.jpg' width = '20' height = '20' name = 'right' value = '>' onclick = 'right()' />
</td>
</tr>
</table>
</body>
[/js]