
    function calculs() {
        if (document.body) {
	    var larg = (document.body.clientWidth);
	    var haut = (document.body.clientHeight);
	}
	else{
	    var larg = (window.innerWidth);
	    var haut = (window.innerHeight);
	}

	var hautmenu = document.getElementById('leftcolumn').offsetHeight;
	var maxhautmenu = haut-200;
	if ( maxhautmenu < hautmenu )
	{
		document.getElementById('menuscroller').setAttribute('class','show');
		document.getElementById('menuscroller').setAttribute('className','show');
		document.getElementById("innerleft").style.height = maxhautmenu+"px";
	}

	    if (document.getElementById("col502")) {
		document.getElementById("border2").style.marginLeft = "740px";
		document.getElementById("border2").style.height = haut-204+"px";
		document.getElementById("border2").style.borderLeft = "1px solid #ddd";
	    }

	    if (document.getElementById("col2")) {
		document.getElementById("border2").style.marginLeft = "950px";
		document.getElementById("border2").style.height = haut-204+"px";
		document.getElementById("border2").style.borderLeft = "1px solid #ddd";
	    }
	    if (document.getElementById("col302")) {
		document.getElementById("border2").style.marginLeft = "581px";
		document.getElementById("border2").style.height = haut-204+"px";
		document.getElementById("border2").style.borderLeft = "1px solid #ddd";
	    }
	    if (document.getElementById("col303")) {
		document.getElementById("border3").style.marginLeft = "897px";
		document.getElementById("border3").style.height = haut-204+"px";
		document.getElementById("border3").style.borderLeft = "1px solid #ddd";

		// taille des images si 3 colonnes
		var dets = document.getElementsByTagName( 'img' );
		var testdets = /txtimg-[0-9]*-[0-9]*/;

		for( var i=0; i<dets.length; i++ ){

		    var string = dets[i].getAttribute( 'rel' );
		    var maxheight = haut-180;
		    var maxwidth = 301;

		    if( dets[i].getAttribute( 'rel' ) && testdets.test(string) ) {

			array = string.split('-');

			if ((maxwidth/maxheight) <= (array[1]/array[2])) {
			    var width = array[1]/(array[1]/maxwidth);
			    var height = array[2]/(array[1]/maxwidth);
			}
			else if ((maxwidth/maxheight) > (array[1]/array[2])) {
			    var width = array[1]/(array[2]/maxheight);
			    var height = array[2]/(array[2]/maxheight);
			}

			dets[i].style.width = width+"px";
			dets[i].style.height = height+"px";
		    }
		}
	    }

	    //document.getElementById("innerleft").style.height = haut-165+"px";

	    document.getElementById("border1").style.height = haut-204+"px";
	    document.getElementById("border1").style.marginLeft = "265px";



	//document.getElementById("messagejs").innerHTML=hautmenu+" - "+maxhautmenu;
    }



// les popups--------------------------------------------------------------

function popup(ici,popupname,height,width)
{

	var width=screen.width*width/100;
	if (height=='') var height=screen.height;
	var topPosition = (screen.height - height) / 2;
	var leftPosition = (screen.width - width) / 2;
	var windowprops = "width=" + width + ",height=" + height + ",top=" + topPosition + ",left=" + leftPosition + ",location=no,menubar=no,toolbar=no,scrollbars=yes,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 }

// Affiche un texte --------------------------------------------------------------

function writediv(id,texte)
{
	document.getElementById('details'+id).innerHTML = texte;
}

function file(fichier)
{
     if(window.XMLHttpRequest) // FIREFOX
          xhr_object = new XMLHttpRequest();
     else if(window.ActiveXObject) // IE
          xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
     else
          return(false);
     xhr_object.open("GET", fichier, false);
     xhr_object.send(null);
     if(xhr_object.readyState == 4) return(xhr_object.responseText);
     else return(false);
}


var oldtxt="";

function showtxt(id,site,url)
{
	if ( oldtxt != '' )
	{
		document.getElementById('txt'+oldtxt).setAttribute('class','hide');
		document.getElementById('txt'+oldtxt).setAttribute('className','hide');
		document.getElementById('spacer'+oldtxt).style.height = 1+"px";
		writediv(oldtxt,'');
	}
	if ( id!=oldtxt )
	{
		if ( document.getElementById('txt'+id).getAttribute('class')=='show'|| document.getElementById('txt'+id).getAttribute('className')=='show' ) {
		    document.getElementById('txt'+id).setAttribute('class','hide');
		    document.getElementById('txt'+id).setAttribute('className','hide');
		    document.getElementById('spacer'+id).style.height = 1+"px";
		    writediv(id,'');
		}
		else if ( document.getElementById('txt'+id).getAttribute('class')=='hide' || document.getElementById('txt'+id).getAttribute('className')=='hide' ) {
		    document.getElementById('txt'+id).setAttribute('class','show');
		    document.getElementById('txt'+id).setAttribute('className','show');
		    document.getElementById('spacer'+id).style.height = 97+"px";
		    var texte = file(site+'/'+url+'?id='+id);
		    writediv(id,texte);
		}
	}

	if ( oldtxt==id ) oldtxt='';
	else oldtxt=id;
}

var oldtxt2="";
function showtxt2(id,site)
{
	if ( oldtxt2 != '' )
	{
		document.getElementById('txt'+oldtxt2).setAttribute('class','hide');
		document.getElementById('txt'+oldtxt2).setAttribute('className','hide');
		document.getElementById('atxt'+oldtxt2).setAttribute('class','show');
		document.getElementById('atxt'+oldtxt2).setAttribute('className','show');
		document.getElementById('htxt'+oldtxt2).setAttribute('class','hide');
		document.getElementById('htxt'+oldtxt2).setAttribute('className','hide');
	}
	if ( id!=oldtxt2 )
	{
		if ( document.getElementById('txt'+id).getAttribute('class')=='show'|| document.getElementById('txt'+id).getAttribute('className')=='show' ) {
		    document.getElementById('txt'+id).setAttribute('class','hide');
		    document.getElementById('txt'+id).setAttribute('className','hide');
		    document.getElementById('atxt'+id).setAttribute('class','show');
		    document.getElementById('atxt'+id).setAttribute('className','show');
		    document.getElementById('htxt'+id).setAttribute('class','hide');
		    document.getElementById('htxt'+id).setAttribute('className','hide');
		}
		else if ( document.getElementById('txt'+id).getAttribute('class')=='hide' || document.getElementById('txt'+id).getAttribute('className')=='hide' ) {
		    document.getElementById('txt'+id).setAttribute('class','show');
		    document.getElementById('txt'+id).setAttribute('className','show');
		    document.getElementById('atxt'+id).setAttribute('class','hide');
		    document.getElementById('atxt'+id).setAttribute('className','hide');
		    document.getElementById('htxt'+id).setAttribute('class','show');
		    document.getElementById('htxt'+id).setAttribute('className','show');
		}
	}

	if ( oldtxt2==id ) oldtxt2='';
	else oldtxt2=id;
}


function details (id,id2,site) {

	    //var oldid="";
	    document.getElementById('diapo'+id).setAttribute('src',site+'/files/medium/'+id2+'.jpg');
}

function showcat(id)
{
		    document.getElementById('cat'+id).setAttribute('class','show');
		    document.getElementById('cat'+id).setAttribute('className','show');
		    document.getElementById('catimg'+id).setAttribute('class','hide');
		    document.getElementById('catimg'+id).setAttribute('className','hide');
}
function hidecat(id)
{
		    document.getElementById('cat'+id).setAttribute('class','hide');
		    document.getElementById('cat'+id).setAttribute('className','hide');
		    document.getElementById('catimg'+id).setAttribute('class','show');
		    document.getElementById('catimg'+id).setAttribute('className','show');
}


// Affiche un menu --------------------------------------------------------------

var oldmenu="";
function showmenu(id)
{
    var lis = document.getElementsByTagName( 'li' );

    for( var i=0; i<lis.length; i++ ){

	if( oldmenu != '' && lis[i].getAttribute( 'name' ) && lis[i].getAttribute( 'name' ) == 'hidden'+oldmenu ) {
	    lis[i].setAttribute('class','hide');
	    lis[i].setAttribute('className','hide');
	    document.getElementById('lien'+oldmenu).setAttribute('class','show');
	    document.getElementById('lien'+oldmenu).setAttribute('className','show');
	}

	if( id!=oldmenu && lis[i].getAttribute( 'name' ) && lis[i].getAttribute( 'name' ) == 'hidden'+id && (lis[i].getAttribute( 'class' ) == 'show' || lis[i].getAttribute( 'className' ) == 'show') ) {
	    lis[i].setAttribute('class','hide');
	    lis[i].setAttribute('className','hide');
	    document.getElementById('lien'+id).setAttribute('class','show');
	    document.getElementById('lien'+id).setAttribute('className','show');
	}

	if( id!=oldmenu && lis[i].getAttribute( 'name' ) && lis[i].getAttribute( 'name' ) == ('hidden'+id) && (lis[i].getAttribute( 'class' ) == 'hide' || lis[i].getAttribute( 'className' ) == 'hide') ) {
	    lis[i].setAttribute('class','show');
	    lis[i].setAttribute('className','show');
	    document.getElementById('lien'+id).setAttribute('class','hide');
	    document.getElementById('lien'+id).setAttribute('className','hide');
	}
    }

	if ( oldmenu==id ) oldmenu='';
	else oldmenu=id;
}




/*=================================================================================================================================================*/

//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
}





