マウスを画像に合わせると画像が切り替わる2(複数画像)

画像をリンクにし、onMouseOverでグローバル変数indexに
各画像のインデックス番号を代入し、そのあとで
画像を切り替える関数を呼んでいる。
sample0077.htmlと同じ。
実行結果


ヘッダ部分
<SCRIPT LANGUAGE="JavaScript">
var index = null
function changeImg()	{
	var number = Math.floor(Math.random()*10)
	if(number == 0)	{
		document.images[index].src = "c00.gif"
	} if(number == 1)	{
		document.images[index].src = "c01.gif"
	} if(number == 2)	{
		document.images[index].src = "c02.gif"
	} if(number == 3)	{
		document.images[index].src = "c03.gif"
	} if(number == 4)	{
		document.images[index].src = "c04.gif"
	} if(number == 5)	{
		document.images[index].src = "c05.gif"
	} if(number == 6)	{
		document.images[index].src = "c06.gif"
	} if(number == 7)	{
		document.images[index].src = "c07.gif"
	} if(number == 8)	{
		document.images[index].src = "c08.gif"
	} if(number == 9)	{
		document.images[index].src = "c09.gif"
	}
}
</SCRIPT>

ボディ部分 <A HREF="sample0078.html" onMouseOver="index = 0 ; changeImg()"><IMG SRC="c00.gif" BORDER=0></A> <A HREF="sample0078.html" onMouseOver="index = 1 ; changeImg()"><IMG SRC="c01.gif" BORDER=0></A> <A HREF="sample0078.html" onMouseOver="index = 2 ; changeImg()"><IMG SRC="c02.gif" BORDER=0></A> <A HREF="sample0078.html" onMouseOver="index = 3 ; changeImg()"><IMG SRC="c03.gif" BORDER=0></A> <A HREF="sample0078.html" onMouseOver="index = 4 ; changeImg()"><IMG SRC="c04.gif" BORDER=0></A> <A HREF="sample0078.html" onMouseOver="index = 5 ; changeImg()"><IMG SRC="c05.gif" BORDER=0></A> <A HREF="sample0078.html" onMouseOver="index = 6 ; changeImg()"><IMG SRC="c06.gif" BORDER=0></A> <A HREF="sample0078.html" onMouseOver="index = 7 ; changeImg()"><IMG SRC="c07.gif" BORDER=0></A> <A HREF="sample0078.html" onMouseOver="index = 8 ; changeImg()"><IMG SRC="c08.gif" BORDER=0></A> <A HREF="sample0078.html" onMouseOver="index = 9 ; changeImg()"><IMG SRC="c09.gif" BORDER=0></A>