function $(id){return document.getElementById(id);}

// ############  MENU  ############
function MenuHideAllButton() {
	$('abonnement').src='images/bouton_abonnement.gif';
	$('historique').src='images/bouton_historique.gif';
	$('newsletter').src='images/bouton_newsletter.gif';
	$('compte-rendus').src='images/bouton_compte-rendus.gif';
	$('parler-a-un-ami').src='images/bouton_parler-a-un-ami.gif';
}

function ShowThisButton(id) {
	MenuHideAllButton();
	$(id).src = 'images/bouton_'+ id +'2.gif';
}

function let_it_snow(id, width, height, quality, color, wmode, top_snow, left_snow){
	var largeur=(document.body.clientWidth!=undefined)?document.body.clientWidth:window.innerWidth;
	if(left_snow+width>largeur){
		var wrap=largeur-width-18;
	}else{
		var wrap=width;
	}
	document.write('<div id="neige" style="position:absolute; overflow:hidden; top:'+top_snow+'px; left:'+left_snow+'px; width:'+wrap+'px; height:'+height+'px;">');
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+id+'" width="'+width+'" height="'+height+'">'); 
	document.write('<param name="movie" value="http://forum.funbridge.com/forum/img/'+id+'.swf">');
	document.write('<param name="quality" value="'+quality+'">'); 
	document.write('<param name="bgcolor" value="'+color+'">');
	document.write('<param name="wmode" value="'+wmode+'">');
	document.write('<embed name="'+id+'" src="http://forum.funbridge.com/forum/img/'+id+'.swf" quality="'+quality+'" bgcolor="'+color+'" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" wmode="'+wmode+'"></embed>');
	document.write('</object>');
	document.write('</div>');
}

function scroll_Top(acceleration, time){
    acceleration=acceleration || 0.1;
    time=time || 16;
    var dx=0;
    var dy=0;
    var bx=0;
    var by=0;
    var wx=0;
    var wy=0;
    if(document.documentElement){
        dx=document.documentElement.scrollLeft || 0;
        dy=document.documentElement.scrollTop || 0;
    }
    if(document.body){
        bx=document.body.scrollLeft || 0;
        by=document.body.scrollTop || 0;
    }
    var wx=window.scrollX || 0;
    var wy=window.scrollY || 0;
    var x=Math.max(wx, Math.max(bx, dx));
    var y=Math.max(wy, Math.max(by, dy));
    var speed=1+acceleration;
    window.scrollTo(Math.floor(x/speed), Math.floor(y/speed));
    if(x>0 || y>0){
        var invokeFunction="scroll_Top("+acceleration+", "+time+")";
        window.setTimeout(invokeFunction, time);
    }
}