     DOM = (document.getElementById) ? true : false;
     NS4 = (document.layers);
     IE4 = (document.all);
    ver4 = (NS4 || IE4 || DOM);   


var next = new Array(glall.length);
var all_seen = new Array(glall.length);
var timeOuts = new Array(glall.length);
var timeIns = new Array(glall.length);
var jump = glall.length * 3;
everything_seen = false ;

for (i=0; i < glall.length; i++) {
	next[i] = -1;
	all_seen[i] = false;
}

function squeeze(photo,who,h,l,q) {
	var myHeight = 550;
	var th = h;
	var tl = l;

	if (ver4) {
		if (NS4)
			myHeight = innerHeight;
		else
			myHeight = document.body.clientHeight;
		if ((myHeight * q) <= h) {
			var coef = q * myHeight / h;
			th = Math.round(h*coef);
			tl = Math.round(l*coef);
		}
	}

	document.write ('<img src="'+photo+'" border=0 name="'+who+'" width="');
	document.write (tl);
	document.write ('" height="');
	document.write (th);
	document.write ('" onLoad="display_paget(); return true;" ');

	if (typeof(paget) != 'undefined')
	document.write ('ALT="'+paget+'"');

	document.write ('>');
}

function defiauto(i) {
//	window.status=' defilement automatique '+i+","+next[i];
	display_paget();
}

function try_next() {
	if (typeof(nextpage) == typeof("what ?"))
		document.location = nextpage;
}

function display_paget() {
	if (typeof(paget) != 'undefined')
		window.status=paget;
}

function nextnext(i) {
	next[i] += 2;
	if (next[i] >= glall[i].length) {
		next[i] = 1;
		all_seen[i] = true;
		if (jump) {
			jump--;
		} else {
			try_next();
		}
		for (j=0, everything_seen = true ; j < all_seen.length; j++ )
			if (!all_seen[i])
				everything_seen = false;
				
		//if (everything_seen)
		//	document.suite.src = "suite.jpg";
	}
	setTimeout("defiauto("+i+")",222);
}

function manunext(i) {
	if (everything_seen)
		try_next() ;
	loaded_1(i);
	return false;
}

function init(){
	window.status=" a clic on the image bring other angles. ";
	if ( ver4 && (typeof(glall) != typeof(RElkqscoidhcqsdqndjfmsdrnui765379)) )
	for (i=0 ; i < glall.length; i++ ) {
		setTimeout("loaded_1("+i+")",glall[i][0]);
		next[i] = 3;
	}
}
function loaded_1(i) {
	if (null == document.images["silent"+i])
		return;

	if (next[i] >= glall[i].length || 0 > next[i]) next[i] = 3;

	if (7 == Math.round(44*Math.random()) )
		document.images["silent"+i].src = "../images/nop.gif";
	else
		document.images["silent"+i].src = glall[i][next[i]];
//	window.status=' defilement automatique '+i+' '+next[i]+"/"+glall[i][next[i]];
	if (NS4)
		timeIns[i] = setTimeout("test_21("+i+")",22);
	display_paget();
}
function test_21(i) {
	if (null == document.images["im"+i])
		return;
	if (document.images["im"+i].complete)
		loaded_21(i);
	else
		timeIns[i] = setTimeout("test_21("+i+")",22);
}
function loaded_21(i) {
	if (timeIns[i] != null)
		clearTimeout(timeIns[i] );
	display_paget();
	if (next[i] >= 0) {
		if (null == document.images["im"+i])
			return;
//		window.status=' next 21 ready ';
		document.images["im"+i].src = document.images["silent"+i].src ;
		if (timeOuts[i] != null)
			clearTimeout(timeOuts[i] );
		if (glall[i][1+next[i]])
			timeOuts[i] = setTimeout("loaded_1("+i+")",glall[i][1+next[i]]);
		nextnext(i);
	} else {
//		window.status=' bientot defilement automatique ';
	}

}

