//scroll----------------------------------------------------------------

function toTop(id){
document.getElementById(id).scrollTop=0
}

defaultStep=1
step=defaultStep
function scrollDivDown(id){
document.getElementById(id).scrollTop+=step
timerDown=setTimeout("scrollDivDown('"+id+"')",10)
}

function scrollDivUp(id){
document.getElementById(id).scrollTop-=step
timerUp=setTimeout("scrollDivUp('"+id+"')",10)
}

function toBottom(id){
document.getElementById(id).scrollTop=document.getElementById(id).scrollHeight
}

// le diaporama --------------------------------------------------------

var old="";

function diapo(id)
{
	if ( id=='' )
	{
		var id='0';
	}

	if ( old )
	{
		document.getElementById('lien'+old).setAttribute('class','');
		document.getElementById('lien'+old).setAttribute('className','');
	}

	document.getElementById('lien'+id).setAttribute('class','selected');
	document.getElementById('lien'+id).setAttribute('className','selected');
	document.getElementById('legende').innerHTML=document.getElementById('legende'+id).innerHTML;
	document.getElementById('titre').innerHTML=document.getElementById('titre'+id).innerHTML;
	document.getElementById('numero').innerHTML=document.getElementById('numero'+id).innerHTML;
	//document.getElementById('liens_fiche').innerHTML=document.getElementById('liens_fiche'+id).innerHTML;
	document.getElementById('diapo').innerHTML=document.getElementById('diapo'+id).innerHTML;

	old=id;
}


// les popups--------------------------------------------------------------

function popup(ici,popupname,height,width)
{
	var topPosition = 0;
	var leftPosition = (screen.width - width) / 2;
	var windowprops = "width=" + width + ",height=" + height + ",top=" + topPosition + ",left=" + leftPosition + ",location=no,menubar=no,toolbar=no,scrollbars=no,resizable=yes,status=no";

	window.open(ici.href,popupname,windowprops);
	return false
}

function blank(ici,popupname){window.open(ici.href,popupname,'location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,status=no'); return false }



// popup images formulaire--------------------------------------------------

function AfficherImage(img){
  Image1= new Image();
  Image1.src=(img);
  Control(img);
}
function Control(img){
  if((Image1.width!=0)&&(Image1.height!=0)){
    VoirImage(img);
  }
  else{
    fonction="Control('"+img+"')";
    intervalle=setTimeout(fonction,20);
  }
}
function VoirImage(img){
  largeur=Image1.width+20;
  hauteur=Image1.height+20;
  proprietes="width="+ largeur +",height="+ hauteur;
  win=window.open(img,"",proprietes);
}
