function oneImgLoad(width_anim, height_anim, url) {
// This function load one image (set in URL var in start.htm file) and load the next function
// Cette fonction charge une image (variable URL dans le fichier start.htm) et charge la fonction suivante

    if (width_anim != 0 && height_anim !=0) {
        //animLoad(width_anim, height_anim)
        Showflash()
    } else {
	dimg=new Image();
	dimg.src= ''; // effacer le cache sous IE
	dimg.src= url;
        setTimeout("verif(dimg)",400);
    }

};

var compteur = 3;
function verif(dimg) {
// This function verify the complete image loading, it return size and load the next function
// Cette fonction vérifie le chargement complet de l'image, elle recupère les dimensions et lance la fonction suivante
      if (dimg.complete && dimg.width !=0) {
         width_anim = eval(dimg).width;
         height_anim = eval(dimg).height;
         alert ("3D PHOTOMIX Automatic size detection\n\nThe image '"+ url + "' return the values below\n\nwidth_anim = "+ width_anim + "    ---    height_anim = " + height_anim + "\n\nPlease enter this values in your start.htm file\nto delete this message.");
         animLoad(width_anim, height_anim)
      } else {
      if (compteur >= 1) {
         alert ("The image '"+ url + "'\nis not completely loaded or unavailable\n\nTRY AGAIN ->  "+ compteur);
         compteur--;
      }
      if (compteur == 0) {
         alert ("The image '"+ url + "'\nis unavailable");
         compteur--;
      }
         setTimeout("verif(dimg)",200);
      }
};

function animLoad(width_anim, height_anim) {
// Setup CSS page margin and hide scrollbars
// Réglage des marges de la page et suppression des scrollbars
        document.write("<style id='st0' type='text/css'>");
        document.write("*{background-color:white; margin:0px; padding:0px; border:0px; overflow:hidden;}");
//        document.write("</style>");
// Position and size of animation box (DIV)
// Position et Dimension du cadre de l'animation
//        document.write("<style id='st0' type='text/css'>");
	//document.write("#flash1 {position:absolute; top:0px; left:0px; border:0px; padding:0px; width:"+ width_anim +"px; height:"+ height_anim +"px; overflow:hidden;}");
	document.write("#flash1 {position:absolute; top:0px; left:0px; border:0px; padding:0px; width:144px; height:162px; overflow:hidden;}");
	document.write("</style>");
        Showflash()
};

function Showflash() {
        document.write("<div id='flash1'/>" + "\n"
        + "<object type='application/x-shockwave-flash' data='3dpm.swf' width='1024' height='768' />" + "\n"
        + "<param name='movie' value='3dpm.swf' />" + "\n"
        + "<param name='wmode' value='transparent' />" + "\n"
        + "<param name='quality value='high' />" + "\n"
        + "<p>Image ou texte alternatif</p />" + "\n"
        + "</object />" + "\n"
        + "</div />" + "\n");

};