function styleDidYouKnow() {
	var addEvent = function(target, event, func) {
		if (typeof target[event] == 'function') {
			var mFunc = target[event];
			target[event] = function(){mFunc(); func();}
		} else target[event] = func;
	}

	var i = 0;

	var products = document.getElementById('products');
	if (products == null) return;
	
	var didYouKnow = document.getElementById('didyouknow');
	if (didYouKnow == null) return;
	
	var divs = products.getElementsByTagName('table');
	if (divs.length == 0) return;
	
	var active = true;
	var triggered = false;

	function style() {
		var length = divs.length;
		var j = 0;
		
		var width = (products.offsetWidth);
		var amount = Math.floor(width / 168) + 1;
		
		for(var i = 0; i < length; i++) {
			if (typeof divs[i] != 'undefined' && divs[i].className.substr(0,7) == 'product') {
				if (++j == amount) break;
			}
		}
		
		if (j == 0) var element = products.getElementsByTagName('div')[1];
		else if (j == amount) var element = divs[i];
		else var element = divs[i - 1].nextSibling;

		products.insertBefore(didYouKnow, element);
		didYouKnow.style.width = (100 * ((amount - 1) * 168 - 4) / width) + '%';

		setTimeout(function(){
			active = false;
		}, 0)
	}

	didYouKnow.parentNode.removeChild(didYouKnow);
	style();
	
	addEvent(window, 'onresize', function(e) {
		if (!e) e = window.event;
		var target = e.target || e.srcElement;
		if (didYouKnow.parentNode != null && (active == false || target == document)) {
			didYouKnow.parentNode.removeChild(didYouKnow);
			timer = setTimeout(style, 0);
			active = true;
		}
	});
}
addOnload(styleDidYouKnow);