var t = 0;
var tmax=-1110;

function init_timer(){
	timer=1;
}
function stop_timer(){
	timer=0;
}

function up()
{
 t += 7;

 with(document.getElementById("calque"))
 {
  if (t > 0)
   t = 0;

  if(style)
   style.top =  t + "px";
  else
   setAttribute("style", "top: " + t + "px");
 }
 if(timer==1)
 {
 setTimeout("up()",40);
 }
}

function down()
{
 t -= 7;

 with(document.getElementById("calque"))
 {
  if(t < -clientHeight)
   t = -clientHeight;

  if(style)
   style.top =  t + "px";
  else
  alert('attribute');
   setAttribute("style", "top: " + t + "px");
 }
 
 if(timer==1)
 {
	 if(t<tmax)
	{
		init_timer();
	}
	else
	{
		 setTimeout("down()",40);
	}

 }
}



/*
timer=0;
y=0;

						
function init_timer(){
	timer=1;
}

function avant(max,calq1,calq2){
	alert('avant max='+max);alert('y='+y);
	maximum=max;
	calque1=calq1;
	calque2=calq2;
if (document.getElementById){
	document.getElementById(calque2).style.top=y;
}
if ((document.all)&&(!document.getElementById)){
	document.all[calque2].style.top=y;
}
if (document.layers){
	document.layers[calque1].layers[calque2].top=y;
}
if(timer==1 && y<maximum){
setTimeout("avant(maximum,calque1,calque2)",40);
y+=7;}					
}

function arriere(max,calq1,calq2){
	alert('arriere max='+max);
	alert('y='+y);
	maximum=max;
	calque1=calq1;
	calque2=calq2;
if (document.getElementById){
	document.getElementById(calque2).style.top=y;
}
if ((document.all)&&(!document.getElementById)){
	document.all[calque2].style.top=y;
}
if (document.layers){
	document.layers[calque1].layers[calque2].top=y;
}
if(timer==1 && y>maximum){
setTimeout("arriere(maximum,calque1,calque2)",40);
y-=7;}
}

function stop_timer(){
	timer=0;
}


*/