addEventsFlash(window, "load", initFlash);

var boxheight = 80;	// hauteur
var boxwidth = 108;	// largeur
var speed = 50;		// vitesse scolling en ms (1 SEC=1000 MILLISECONDES)..
var pixelstep = 1;	// Pas de déplacement en px
var godown = false;	// flase = de bas en haut
var scrollFlash, elementheight;

function addEventsFlash(oThing, sEvent, pHandler) {	
	if ( typeof oThing.addEventListener != "undefined" ) // DOM2
		oThing.addEventListener( sEvent, pHandler, false );		
	else if ( typeof oThing.attachEvent != "undefined" ) // IE, Opera 	
		oThing.attachEvent( "on" + sEvent, pHandler );
}

function initFlash(){	
	var outer = document.getElementById('outerFlash');	
	var inner = document.getElementById('innerFlash');
	
	document.getElementById('ref').style.display = 'block';
	
	elementheight = getElHeightFlash(inner);
	inner.style.top = (godown? -elementheight : boxheight) + 'px';
	inner.style.visibility = "visible";

	if (document.getElementById('refFlash'))
		document.getElementById('refFlash').style.display = 'block';	

	startFlash();
		
	outer.onmouseover = function() { stopFlash(); }
	outer.onmouseout = function() { startFlash(); }
}

function getElHeightFlash(el){
	if (document.all) return el.style.height ? el.style.height : el.clientHeight;
	else return el.style.height ? parseInt(el.style.height):parseInt(el.offsetHeight);
}
function stopFlash() { window.clearTimeout(scrollFlash); }
function startFlash() { scrollFlash = window.setInterval('scrollFlashBox()',speed); }

function scrollFlashBox() {
	var inner = document.getElementById('innerFlash');
	inner.style.top=parseInt(inner.style.top)+(godown? pixelstep: -pixelstep)+'px';
	if(godown) {
		if(parseInt(inner.style.top)>boxheight)inner.style.top=-elementheight+'px';
	}
	else {
		if(parseInt(inner.style.top)<2-elementheight)inner.style.top=boxheight+'px';
	}
}