/*
/*	jQuery.onfontresize
/*	2009-02-01  •><>
/*
/*	requires jQuery

Usage:

	$(document).bind('fontresize',myHandler);

Optional:

// stop the observer
	$.onFontResize.unwatch();
// start again
	$.onFontResize.watch();
// start with different timeout
	$.onFontResize.watch(1000);

*/

$.onFontResize = {

	Delay : 250,
	Timer: null,
	on : true,
	Box : null,
	H : 0,

	init : function() {
		this.Box = document.createElement('DIV');
		$(this.Box)
		.html('&nbsp;')
		.css({
			position:'absolute',
			top:'-999px',
			left:'-9999px',
			display:'inline',
			lineHeight: 1
			})
		.appendTo('body');
		this.H = $(this.Box).height();
		},

	watch : function(delay) {
		if(!this.Box) this.init();
		this.unwatch();
		if (delay) this.Delay = delay;
		this.on = true;
		this.check();
		},
	unwatch : function() {
		this.on = false;
		if (this.Timer) clearTimeout(this.Timer);
		},

	check : function() {
		var that = $.onFontResize;
		var h = $(that.Box).height();
		if (h!=that.H) {
			that.H = h;
			$(document).triggerHandler('fontresize');
			}
		if (that.on) this.Timer = setTimeout(that.check,that.Delay);
		}

	}

$(function(){
	$.onFontResize.watch();
	});