/* ::---------------------------------------------------------------
:: +	fontsizer.js
	2010.09.13
	roberto cornice
	cornice@lemm.de

:: +	Font-Sizer

:: +	[c] 2010 by Lemm Werbeagentur GmbH

	------------------------------------------------------------::
	
	
:: +	Aufruf

		jQuery(document).ready(function() {
    		fs			= new fontsizer( selektor, ajaxPath );
		});

*/

function fontsizer(selector, www) 		{
	
	this.selector	= selector;
	this.level		= 0;
	this.www		= www;
	this.resize	= function( size )	{
		if( size == 0 )	{
			return;
		}		
		var me	= this;
		
		$(this.selector).children().each(function(){
			$(this).css(
				"font-size", 
				( parseFloat( $(this).css("font-size") ) + size ) +"px"
			)
		});
		this.level	+= size;		
		this.setCookie();
	}
	this.reset	= function()	{
		var me = this;
		$(this.selector).children().each(function(){
			$(this).css(
				"font-size", 
				( parseFloat( $(this).css("font-size") ) + ( me.level * -1 ) ) +"px"
			)
		});
		this.level	= 0;
		this.setCookie();
	}
	this.setCookie	= function()	{
		$.ajax({
			url: this.www+"ajax/setFontsize.php",
			type: "GET",
			data:  "fontsizeop="+this.level,
			success: function(feedback){
				//eval(feedback);
			}
		});
	}
}
