
//--> Supprimer des cadres exterieur si encadré
if (self != top) 
	top.location.href = self.location.href;

//--> Fonction de préchargement
function load() {
	if (document.images)
	{
		this.length=load.arguments.length;
		for (var i=0;i<this.length;i++)
		{
			this[i+1]=new Image();
			this[i+1].src=load.arguments[i];
		}
	}
}

//--> Cette fonction charge dans le cache toutes les images passées en paramètre via la fonction ci-dessus
function preload() {
	var temp=new load(
	"images/chargement.gif",
	"images/block/trocland_accueil_over.png",
	"images/block/trocland_magasin_over.png",
	"images/block/trocland_boutique_over.png",
	"images/block/trocland_informations_over.png",
	"images/block/trocland_services_over.png",
	"images/block/trocland_contact_over.png",
	"images/block/petit/block_contact_over.png",
	"images/block/petit/block_informations_over.png",
	"images/block/petit/block_services_over.png")
}

//--> Lance la fonction
preload();

//--> Fonction de rollover pour les images
function rollover_tjs(nom,src) {	
	document.images[nom].src=src;
}

//--> Onmouseover pour les messages
function ChangeMessage(def,message,champ){
  message1 = (message == '') ? '<font CLASS="petit">'+def+'</font>' : '<font CLASS="petit">' + message + '</font>';
  if(document.getElementById)
    document.getElementById(champ).innerHTML = message1;
  }

//--> Mettre en Favoris
nav = navigator.appName.substring(0,3);
ver = navigator.appVersion.substring(0,1)
function addFav(urlx,nomx,txt){
 if (nav == "Mic" && ver >= 4) // Si IE Supp ou = V4
 {
	url_site=urlx;
	titre_site = "Bienvenue sur " + nomx;
	document.write('<A onmouseover="AfficheStatus(\'Ajouter aux favoris\');return true;" HREF="JavaScript:" onClick="window.external.AddFavorite(url_site, titre_site);return(false);">' + txt + '</A><BR>')
 }
}

//--> Afficher dans la barre de status
function affichestatus(text){
		window.status = text;
}

//--> Afficher une popup de la taille de l'image
function popup_img(img) {
	titre="TrocLand.fr";
	largeur = 400;
	hauteur = 400;
	var winl = (screen.width - largeur) / 2;
	var wint = (screen.height - hauteur) / 2;
	w=open("",'image','width='+largeur+',height='+hauteur+',top='+wint+',left='+winl+',toolbar=no,scrollbars=no,resizable=no');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+70); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>");
	w.document.write("</HEAD><BODY bgcolor='' onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
	w.document.write("<IMG src='"+img+"' border=0 TITLE='"+img+"'>");
	w.document.write("<br><center><font size='1'><a href='javascript:window.opener.focus; window.close();'>Fermer</a></font></center>");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

//--> Passer d'une image à une autre (pour chargement en cour...)
function bascule(from, to) {
	document.images[from].src = to.src; 
}

//--> Chargement en cour...
var done = 0; 
var time = 0.2; // Seconde avant affichage de l'image finie
time = time * 1000; 
    function Preload_Img() 
    { 
       imgs = document.images; 
  
            for( index = 0; index < imgs.length; index++ ) 
            {     
                if( done >= imgs.length ) 
                { 
                    break; 
                }else if( imgs[ index ].complete ) 
                { 
                    done++; 
                    //loaded[ index ] = true; 
                } 
            } 
             
            if( done >= imgs.length ) 
            { 
               //bascule("ch", fin);
               window.setTimeout( "bascule('ch', fin)", time );
            }else 
            { 
                window.setTimeout( "Preload_Img()", '50' ); 
            } 
      }
// FIBN test chartement image

