var sel = new Array();
var initSize = new Array();
var originalFontSize;
var newFontSize;
function addAllChild(s) {
	$(s).children().each( function(i, e) {
		sel.push($(this));
		addAllChild($(this));
	});
}
function augmenterPolice() {
	multiplierTaillePolice(1.2);
}
function diminuerPolice() {
	multiplierTaillePolice(0.8);
}
function multiplierTaillePolice(x) {
	$(sel).each( function(i) {
		$(this).css('line-height', 'normal');
		var currentFontSize = $(this).css('font-size');
		if (currentFontSize == null) {
			currentFontSize = originalFontSize;
		}
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		if (currentFontSizeNum != undefined) {
			newFontSize = currentFontSizeNum * x;
			$(this).css('font-size', newFontSize);
		}
	});
	$(sel).css('font-size', newFontSize);
	return false;
}
function resetPolice() {
	$(sel).each( function(i) {
		$(this).css('font-size', initSize[i]);
		$(this).css('line-height', 'inherit');
	});
	$(sel).css('font-size', originalFontSize);
}
function initFontResize(selector) {
	var section = new Array(selector);
	section = section.join(',');
	originalFontSize = $(section).css('font-size');
	var selTemp = $(section);
	addAllChild(selTemp);
	$(sel).each( function(i) {
		if ($(this).css('font-size') == null) {
			initSize.push('inherit');
		} else {
			initSize.push($(this).css('font-size'));
		}
	});
	
	// Réinitialiser la taille sur le clic de A=
	$(".resetFont").click( function() {
		resetPolice();
	});
	// Augmenter la taille sur le clic de A+
	$(".increaseFont").click( function() {
		augmenterPolice();
	});
	// Diminuer la taille sur le clic de A-
	$(".decreaseFont").click( function() {
		diminuerPolice();
	});

}

