


var clipTop = 0;
var clipWidth = 530;
var clipBottom = 175;
var topper = -52;
var lyrheight = 0;
var time,amount,theTime,theHeight,DHTML;
var cx,cy;

////////////////////////////////////////////////////////////////////////////////////
function init()
{
	  returnCenter();
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('texte');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
	}
	else if (document.getElementById || document.all)
	{
	  
		lyrheight = x.obj.offsetHeight;

		x.style.clip = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
	}

x.style.top = cy + topper;
x.style.left = cx - 185;

}
				
////////////////////////////////////////////////////////////////////////////////////
function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}
				
////////////////////////////////////////////////////////////////////////////////////
function stopScroll()
{
	if (time) clearTimeout(time);
}
				
////////////////////////////////////////////////////////////////////////////////////
function realscroll()
{
	if (!DHTML) return;
	clipTop += amount;
	clipBottom += amount;
	topper -= amount;
	if (clipTop < 0 || clipBottom > lyrheight)
	{
		clipTop -= amount;
		clipBottom -= amount;
		topper += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
		thelayer.style.clip = clipstring;
	  thelayer.style.top = cy+topper;
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop;
		thelayer.style.clip.bottom = clipBottom;
	  thelayer.style.top = cy+topper;
	}
		
	time = setTimeout('realscroll()',theTime);
}

////////////////////////////////////////////////////////////////////////////////////				
function vis(val)
{
	if (!DHTML) return;
	var f = new getObj('texte');
	f.style.visibility = val;
}
				
////////////////////////////////////////////////////////////////////////////////////
function getObj(name)
{
  if (document.getElementById)
  {
	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = document.layers[name];
	this.style = document.layers[name];
  }
}

				
////////////////////////////////////////////////////////////////////////////////////
function returnCenter(){
	  
	var ns4 = (document.layers)? true:false; 	  //NS 4
	var ie4 = (document.all)? true:false;	  //IE 4
	var dom = (document.getElementById)? true:false;	  //DOM
	var xMax, yMax, xOffset, yOffset;;	  

	if (ie4 || dom)
		{
		xMax = document.body.clientWidth;
		yMax = document.body.clientHeight;
		}
	else if (ns4)
		{
		xMax = window.outerWidth;
		yMax = window.outerHeight;
		}
	else
		{
		xMax = 800;
		yMax = 600;
		}

	  cx=xMax/2;
	  cy=yMax/2;
}
				
				