window.addEvent('domready', function() {
	var fontCookie = Cookie.read('FontSize');
	if(fontCookie == null) {
		fontCookie = Cookie.write('FontSize', 'Small', {duration: 180, path: '/'});
	}
	var myCSS = new Asset.css($('FontResizer').src.replace('font.js', 'style') + Cookie.read('FontSize') + '.css', {id: 'style' + Cookie.read('FontSize')});
	$$('.FontResizer').each(function(img) {
		var Size = '';
		if(img.get('src').contains('3')) {
			Size = 'Large';
		} else if(img.get('src').contains('2')){
			Size = 'Medium';
		} else {
			Size = 'Small';
		}
		if(Cookie.read('FontSize') == Size) {
			img.set('src', img.get('src').replace('_Off.gif', '_On.gif'));
		}
		img.getParent().addEvent('click', function(event) {
			event = new Event(event).stop();
			if($defined(myCSS)){			
				myCSS.destroy();
			}
			fontCookie = Cookie.write('FontSize', Size, {duration: 180, path: '/'});
				myCSS = new Asset.css($('FontResizer').src.replace('font.js', 'style') + Cookie.read('FontSize') + '.css', {id: 'style' + Cookie.read('FontSize')});
			$$('.FontResizer').each(function(icon) {
				icon.set('src', icon.get('src').replace('_On.gif', '_Off.gif'));
			});
			img.set('src', img.get('src').replace('_Off.gif', '_On.gif'));
		});
	});
});