$(document).ready(function() {
	var overlay_top = 0;
	$('dfn').jHelperTip({
		trigger  : 'hover',
		source   : 'attribute',
		attrName : 'title',
		aC       : '#dfn',
		leftOff  : -100,
		topOff   : 10
	});

	$("a._blank").attr('target', '_blank'); // Ajoute _blank sur les lien

	$("#increase").click(function() {		// Increase Font Size
		var currentFontSize = $('body').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*1.2;
		if(newFontSize > 20) {
			newFontSize = 12;
		}
		pageTracker._trackPageview('/toolbar/increase:'+newFontSize);	// Track Analytics
		$('body').css('font-size', newFontSize);
		return false;
	});
	$("#print").click(function() {
		window.print();
		pageTracker._trackPageview('/toolbar/print');	// Track Analytics
		return false;
	});

	// Ajout auto du flash
	if($('#illustration').attr('class') != '') {
		$('#illustration embed').css('zIndex', 800);
		if($('#illustration').attr('width')) {
			width = $('#illustration').attr('width');
		} else {
			width = 373;
		}
		if($('#illustration').attr('height')) {
			height = $('#illustration').attr('height');
		} else {
			height = 305;
		}

		$('#illustration').flash({
			swf:'/swf/'+$('#illustration').attr('class')+'.swf',
			width:width,
			height:height,
			params:{wmode:'transparent'}});
	}
	$('#partners').flash({
		swf:'/swf/partners.swf',
		width:200,
		height:180});

	// Ajoute le footer à la balise .text
	if($(".text").length > 0) {
		$(".text_header").show();
		$(".text_footer").show();
		$(".text_header").prependTo(".text");
		$(".text_footer").appendTo(".text");
	}
	// On enlève les bordures pour les inoput a cause d'IE
	if($("input[type=checkbox], input[type=radio]").length > 0) {
		$("input[type=checkbox], input[type=radio]").css('border', 'none');
	}
	// Accès clients

	if($("a[rel=#acces-client]").length > 0) {
		$('#acces-client').html('<iframe src="http://extranet.generation-net.org/?f=" width="500" height="150" style="border:none; overflow:hidden;" scrolling="no" />');
		$("a[rel=#acces-client]").overlay({finish:{left:0,top:200}, container:'#wrapper'});
	}
});