
function  preloadImages() {
  var d=document; if(d.images){ if(!d.TAB) d.TAB=new Array();
    var i,j=d.TAB.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.TAB[j]=new Image; d.TAB[j++].src=a[i];}}
}

function changeImages(){
//les arguments sont des triplets "name : nom du champ ancienne image" et "nom : nom de l'image nouvelle" et layer
var a = changeImages.arguments;
for (i=0; i<a.length; i=i+2){
		document[a[i]].src = a[i+1];
}
}

function changeContent(what,text) {
//écrit text dans la layer what
    if (document.all){
        document.all[what].innerHTML = text;
	}
}

function ouvrir(url){
window.open(url,'','width=800,height=400,scrollbars=yes,resizable=no,titlebar=no,toolbar=no,location=no');
}

function aggrandir(nom_photo,width,height){
url_photo = 'images/' + nom_photo;
url_page = 'photo_aggrandie.php?url_photo=' + url_photo + '&width=' + width + '&height=' + height;
dim = 'width=' + (parseInt(width) + 20) + ', height=' + (parseInt(height) + 20);
window.open(url_page,'',dim);
}

var nbre_caract = 1;
var deroulit;
function write_texte_partiel(what,text){
//écrit nbre_caract lettres de text dans le layer what
if (nbre_caract < text.length+1){
	var txt_partiel = text.substr(0,nbre_caract);
	changeContent(what,txt_partiel);
	nbre_caract++;
}
if (nbre_caract == text.length+1){
	clearInterval(deroulit);
	nbre_caract = 1;
}
}

function deroule_text(what,text){

clearInterval(deroulit);
strFonction = "write_texte_partiel('" + what + "','" + text + "')";
deroulit = setInterval(strFonction,100);
}

function affiche_titre(what,text){
if (document.all){
	clearInterval(deroulit);
	strFonction = "write_texte_partiel('" + what + "','" + text + "')";
	deroulit = setInterval(strFonction,100);
}
}

function contenuAleatoire(){
for (ic=0; ic<4; ic++){
alea1 = Math.random();
	if (alea1<0.3){
		T ='<br><br><img src="' + RETURN_PATH + 'images/photo'+ Math.round(9-alea1*30) + '.jpg" hspace="5" vspace="5" align="left" width="'+ (100 + Math.round(alea1*500)) + '">';
			document.write(T);
	}
	for (jc=0; jc<12; jc++){
			document.write(" texte de la page " + ETAT_NAV);
		alea2 = Math.random();
		if (alea2<0.1){
				document.write("<br>");
		}
		if (alea2<0.02){
				document.write("<br>");
		}
	}
}
}