function statut(text) {
window.defaultStatus ='Domaine A. Cailbourdin - Tel : 03.86.26.17.73'
 //if(self.name==top.name) { location.href="index.html" }
}

var isMinIE5 = (navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0
var isMinIE6 = (navigator.appVersion.indexOf("6.") >= 0) ? 1 : 0


function getdElement(d,nm) {
  if(nm == '') return null;
  return d.getElementById?d.getElementById(nm):(d.all?d.all(nm):null)
}
function getElement(nm) { return getdElement(document,nm) }

function set800() {
 if (navigator.appName.indexOf('Microsoft')!=-1) { if (screen.availWidth>800) window.resizeTo(800,600)  }
}

function setOn(no){
	setOff(no)
	var item=getElement('mnu'+no)
	if (item) item.className='mnuON'
}
function setOff(no){
 for ( var i=1; i<12; i++){
	var item=getElement('mnu'+i)
	if (item){ if (no!=i) item.className='mnuOFF' }
 }
}

function load() {
	if (document.images) {
		this.length=preload.arguments.length;
		for (var i=0;i<this.length;i++) {
			this[i+1]=new Image();
			this[i+1].src=preload.arguments[i];
		}
	}
}
function preload() {
// Cette fonction charge dans le cache toutes les images passées en paramètre
	var mesImages=new load("COMMUN/images/cadre/puce_tra.gif","COMMUN/images/cadre/coin_hg.gif","COMMUN/images/cadre/coin_hd.gif","COMMUN/images/cadre/coin_bd.gif","COMMUN/images/cadre/coin_bg.gif","COMMUN/images/plateau/picto_choisir.gif","COMMUN/images/plateau/picto_recherche.gif","COMMUN/images/plateau/picto_panier.gif")
}


var nouveau;
function photo(nom, width, height){
 if (nouveau) {	if ( !nouveau.closed ) nouveau.close(); }
 nouveau =window.open('','photo','height='+height+',width='+width+',status=no,toolbar=no,menubar=no,location=no');
 nouveau.document.write('<html><body onLoad="window.focus();" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" onclick="window.close()" scroll="no"><center><img src="'+nom+'" style="cursor:hand;" border="0" alt=""></center></body></html>');
}
function pop(nom, width, height){
 if (nouveau) {	if ( !nouveau.closed ) nouveau.close(); }
 nouveau =window.open(nom,'photo','height='+height+',width='+width+', scrollbars=yes, status=no,toolbar=no,menubar=no,location=no');
}

function stopError() { return true; }
 
window.onerror = stopError;
window.onload=statut;



function poidsTotal(){
 html = '';
 poidsTotalImages = 0;
 poidsFichier = 0;
 hasFileSize = false;
 imagesPassees = new Array();
 imagesCassees = 0;

 if (document.fileSize){
	hasFileSize = true;
	poidsFichier = document.fileSize*1;
 }

 html += '<html><body><table width=100% cellspacing=1>';

//a=0;
 for (i = 0; i < document.images.length; i++){
	j=0; 
	flag=0;
	k = imagesPassees.length;
	while (j <= k)	{
//a++;
		if ( (imagesPassees[j] == document.images[i].src) || (document.images[i].fileSize == "-1")) { 
			flag=1;
		}
		j++;
	}
	if (document.images[i].fileSize == "-1"){
		imagesCassees++;
	}

	if (flag == 0){
		imagesPassees.push(document.images[i].src);
		poidsImageEnCours = parseInt(document.images[i].fileSize);
		poidsTotalImages += poidsImageEnCours;
		html += '<tr><td width=45%><div align=right><font face=Verdana size=1>'
		html += document.images[i].src;
		html += '</font></div></td>';
		html += '<td width=10%><font face=Verdana size=1><b>';
		html += poidsImageEnCours;
		html += ' octets</b></font></td>';
		html += '<td width=45%><img src=' + document.images[i].src + '></td></tr>';
	}
 };
//alert("on a bouclé "+a+" fois, \net on a gardé "+imagesPassees.length+" images sur "+document.images.length+".");

	html += '<tr><td><font face=Verdana size=1><b>Poids total des images: ';
	html += poidsTotalImages;
	html += ' octets pour ';
	html += imagesPassees.length;
	html += ' images</b></font></td><tr>';

	html += '<tr><td><font face=Verdana size=1><b>Poids de la page: ';
	html += poidsFichier;
	html += ' octets';
	html += '</b></font></td><tr>';

	poidsDuTout = poidsFichier+poidsTotalImages;

	html += '<tr><td><font face=Verdana size=1><b>Poids du tout: ';
	html += poidsDuTout;
	html += ' octets';
	html += '</b></font></td><tr>';

	if (imagesCassees > 0)
		{
		html += '<tr><td><font face=Verdana size=1><b>Nota: ';
		html += imagesCassees;
		if (imagesCassees > 1)
			{
			html += ' images n\'ont pas été prises en compte car elles étaient inaccessibles ou absentes.';
			}
		else
			{
			html += ' image n\'a pas été prise en compte car elle était inaccessible ou absente.';
			}
		html += '</b></font></td><tr>';
		}

 html += '</table></body></html>';
 document.write(html);
}

