function init_gifover() {
    $(":img.gifover").each(function() {
    	var srcOut  = $(this).attr("src");
    	var srcOver = srcOut.replace("\.gif","-over\.gif");
    	var img     = document.createElement('img');
    	
    	// preload
    	$(img).attr("src",srcOver);
    	$(this).mouseover(function(){
    		  $(this).attr("src",srcOver);
    	});
    	$(this).mouseout(function(){
    		$(this).ImageSwitch({Type:"FadeIn",NewImage:srcOut, EffectOriginal:true, Speed:400})
    		// $(this).attr("src",srcOut);
    	 });
    });
}

function init_block3() {
	$(".block3").mouseover(function(){ $(this).addClass("overclass"); });
	$(".block3").mouseout( function(){ $(this).removeClass("overclass"); });
	$(".block3 div h1 a").each( function() {
		var clickDest = $(this).attr("href");
		$(this).parent().parent().parent().click( function(){ document.location.href=clickDest; } );
	});
}

var showList     = new Array();
var nbShowRef    = 0;
var idCurrentRef = 0;
var animTimer    = false;
var animStopped  = false;

function init_refAnim() {
	
	function reflinkClick(theRef) {
		animStop();
		if (theRef==false) {
			if ( idCurrentRef<(nbShowRef-1) ) { idCurrentRef++; } else { idCurrentRef=0; }
			theRef = showList[idCurrentRef];
		} else {
			for (i=0; i<nbShowRef; i++) {
				if (theRef.attr("rel")==showList[i].attr("rel")) {
					idCurrentRef = i;
					break;
				}
			}
		}
		var relName = theRef.attr("rel");
		$(".reflink").removeClass("showrl");
		theRef.addClass("showrl");
		$(".refshow").removeClass("show");
		$("#"+relName).addClass("show");
		animStart();
		return false;	
	}
	function actualiseEtatBoutons() {
		if (animTimer) {
			$("#lecture").attr("src","charte/lecture_on.gif");
			$("#pause").attr("src","charte/pause_off.gif");
		} else {
			$("#lecture").attr("src","charte/lecture_off.gif");
			$("#pause").attr("src","charte/pause_on.gif");
		}
	}
	function animStop() {
		if (animTimer) { clearTimeout(animTimer); }
		animTimer = false;
		actualiseEtatBoutons();
	}
	function animStart() {
		animStop();
		if (!animStopped) { animTimer = setTimeout(autoShowRef,6000); }
		actualiseEtatBoutons(); 
	}
	function animStartSpeed() {
		animStop();
		if (!animStopped) { animTimer = setTimeout(autoShowRef,1000); }
		actualiseEtatBoutons(); 
	}
	function autoShowRef() {
		animTimer = false;
		if ( idCurrentRef<(nbShowRef-1) ) { idCurrentRef++; } else { idCurrentRef=0; }
		reflinkClick(showList[idCurrentRef]);
	}
	animStart();

	$(".reflink").mouseover( function(){ reflinkClick($(this));animStop(); } );
	$(".reflink").mouseout( function(){ animStartSpeed(); } );
	$(".reflink").click(function(){ animStopped=true; reflinkClick($(this));animStop(); });
	$(".reflink").each( function(){showList[nbShowRef++] = $(this);} );
	$(".refshow").mouseover( function(){ animStop(); } );
	$(".refshow").mouseout( function(){ animStartSpeed(); } );
	$(".refshow").click( function(){ reflinkClick(false); } );
	
	$("#lecture").mouseover( function(){ animStart(); } );
	$("#pause").mouseover(   function(){ animStop(); } );
	$("#lecture").click(     function(){ animStopped=false; reflinkClick(false); } );
	$("#pause").click(       function(){ animStopped=true;  animStop();          } );

}
function init_formdyn() {
	$(".formdyn").focus(function() {formdynFocused($(this));} );
	$(".formdyn").blur(function() {formdynBlured($(this));} );
	$(".formdyn").each(function() {
		if ( $(this).attr("defaultValue") && ($(this).attr("defaultValue")!=$(this).val()) ) {
			$(this).addClass("filled");
		}
	});
	function formdynFocused(field) {
		field.removeClass("filled");
		field.addClass("filled");
		if (field.attr("defaultValue")) {
			if ( field.val()==field.attr("defaultValue") ) {
				field.val("");
			}
		}
	}
	function formdynBlured(field) {
		field.removeClass("filled");
		if ( field.val()!="" ) {
			field.addClass("filled");
		} else {
			if (field.attr("defaultValue")) {
				field.val( field.attr("defaultValue") );
			}
		}
	}
}

function xiti(tagPage) {
	var Xt_param = 's=419519&p='+tagPage;
	try {
		Xt_r = top.document.referrer;
	} catch(e) {
		Xt_r = document.referrer;
	}
	Xt_h = new Date();
	Xt_i = '<img width="80" height="15" align="top" border="0" alt="" ';
	Xt_i += 'src="http://logv10.xiti.com/bcg.xiti?'+Xt_param;
	Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds();
	if(parseFloat(navigator.appVersion)>=4)
	{Xt_s=screen;Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth;}
	document.write(Xt_i+'&ref='+Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$')+'" title="Internet Audience">');
}