Bonjour

Je débute en javascript et je bloque sur la comprehension d'un code.
voici le code parfaitement fonctionnel d'un diaporama aléatoire.

Ma question porte sur la fonction objet(), dont je ne comprends pas le rôle.
Si je la mets en commentaire le diaporama ne fonctionne plus, elle semble donc pas inutile... mais je ne comprends vraiment pas ce qu'elle fait ou pourquoi il faut faire ca.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
  <title>Ma page</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
<script language="JavaScript">
<!--
var nom = new objet ("1", "2", "3", "4", "5", "6");
 
function objet() {
this.length = objet.arguments.length
for (var i = 0; i < this.length; i++) this[i+1] = objet.arguments[i]
}
 
function changer() {
document.image.src = "images2008/"+nom[(parseInt(Math.random()*((nom.length)+1)))]+".jpg";
setTimeout("changer()", 1000);
}
//-->
</script>
 
</head>
<body bgcolor="#000000"  onLoad="changer()">
<div align="center" >&nbsp;<img src="images2008/1.jpg" width="600" name="image" style="border: 5px solid #ffffff"></div> 
 
</body>
</html>
Merci par avance pour vos explications