/* by Serega T. */

var stEM = {
	delay:	'100',
	styles:	{
				width:		'1em',
				height:		'0',
				display:	'block',
				position:	'absolute',
				left:		'0',
				top:		'0',
				visibility:	'hidden'
			},
	init:	function(f)
			{
				stEM.el = document.getElementsByTagName("body")[0].appendChild(document.createElement('div'));
				for (var i in this.styles) this.el.style[i] = this.styles[i];
				stEM.current = stEM.width();
				stEM.fns = f;
				stEMTimer = setInterval(this.run,this.delay);
			},
	run:	function(f)
			{
				stEM.prev = stEM.current;
				stEM.current = stEM.width();
				if (stEM.current!=stEM.prev) eval( '(' + stEM.fns + ')()' );
			},
	width:	function(){return this.el.offsetWidth || this.el.clientWidth || this.el.innerWidth}
}

/*
stEM.init(function(){		// the all our functions
	alert(stEM.prev + ' / ' + stEM.current);
});
*/