// ***********************************************************************************************************
// Gestion du scrolling
// ***********************************************************************************************************
var scroll_position = 0;
var scroll_taille = 0;
var scroll_timer = null;

function scroll_init()
{
	if( $( 'mon_scroll' ) == null )
		return;

	scroll_taille = $( 'mon_scroll' ).offsetHeight;
	scroll_position = 0;
	$( 'mon_scroll' ).innerHTML = $( 'mon_scroll' ).innerHTML + $( 'mon_scroll' ).innerHTML;
	scroll_timer = null;
	scroll_start()
}

function scroll_start()
{
	if( scroll_timer == null )
		scroll_timer = setInterval( 'scroll_scroll()', 300 );
}

function scroll_stop()
{
	if( scroll_timer != null )
		clearInterval( scroll_timer );
	scroll_timer = null;
}

function scroll_scroll()
{
	scroll_position = scroll_position-3;
	if( scroll_position < -scroll_taille )
		scroll_position += scroll_taille;
	$( 'mon_scroll' ).style.top = scroll_position + "px";
}

ajouter_evenement( window, 'load', scroll_init );

function cacher_elements_sous_item( item )
{
	item.style.display='block';
	var taille_x = item.clientWidth;
	var taille_y = item.clientHeight;
	item.style.display='none';

	var oIframe = document.createElement("iframe");
	if( String( self.location ).substring( 0,5 ) == "https" )
		oIframe.src = "javascript:'<html><!-- InstanceEnd --></html>';";
	else
		oIframe.src = "about:blank";
	oIframe.className = "innerFixer";
	oIframe.style.width = taille_x +"px";
	oIframe.style.height = taille_y +"px";

	item.appendChild( oIframe );
}

function popup(url,width,height)
{
	window.open( url, "Popup", "width=" + width + ",height=" + height + ", scrollbars=yes, resizable=yes");
}
