// Variables + init
window.onerror = null;
images = new Array(), im = new Array();

// preload les images pour rollovers
function PreLoad(){
    images[1] = "images/logo_trafik_off.jpg";
    images[2] = "images/logo_trafik_on.jpg";
    for (var i = 0; i < images.length; i++){
       im[i] = new Image();
       im[i].src = images[i];
    }
}

// changement image pour rollover
function SwapImage(num, imgname){
     if (im[num]!=null)
	     imgname.src = im[num].src;
}

// Ouverture d'une popup sans scroll
function Popup(url, fenetre, largeur, hauteur, x, y){
	x = (screen.width-largeur)/2;
	y = (screen.height-hauteur)/2;
	fenetre = window.open (url, fenetre,'scrollbars=no,status=no,toolbar=no,resizable=no,copyhistory=no,left='+x+',top='+y+',width='+largeur+',height='+hauteur);
	fenetre.focus();
}

// Diaporama
function diaporama(div, images, num, interval, width, height, texte){
	if (num == -1)
		num = (images.length-1);
	if(document.getElementById){
		document.getElementById(div).innerHTML ='<img src="'+ images[num] + '" width=' + width + ' height=' + height + '><br><img src=images/vide.png height=4><br>' + texte;
		num = num-1;
		width = width;
	}
	setTimeout( function(){ diaporama(div, images, num, interval, width, height, texte) }, interval);
}

