﻿function textSize(elt,minusButton,plusButton) {
	/*
	Change the "font-size" of an element which has the class="textSize"
	Available sizes : textNormal, textBig, textBigger.
	*/
    var txt = jQuery(elt);
	if (txt.size() > 0 ) {
        jQuery(minusButton).click(function(){
			lastClass = jQuery(elt).attr('class').split(' ').slice(-1);
			if (lastClass == 'textBig') {
				jQuery(elt).removeClass('textBig');
			} else if (lastClass == 'textBigger') {
				jQuery(elt).removeClass('textBigger').addClass('textBig');
			}
		});

		jQuery(plusButton).click(function(){
			lastClass = jQuery(elt).attr('class').split(' ').slice(-1);
			if (lastClass == 'textNormal' || lastClass == 'textSize') {
				jQuery(elt).removeClass('textNormal').addClass('textBig');
			} else if (lastClass == 'textBig') {
				jQuery(elt).removeClass('textBig').addClass('textBigger');
			}
		});
	}
}

jQuery(document).ready( function() {
	initTextSize = textSize(".textSize",".btFontMinus",".btFontPlus");
});