if (inCMS()) {
	// fix sitewide menu in edit mode...
	window.onresize = function() {
		document.getElementById("sitewide").style.top = document.getElementById("page").offsetHeight-19+"px";
	}
} else {
	AddToInitArray(function(){
		var tables = document.getElementsByClassName("bgp1", document.getElementById("tekst"));
		for (var i = 0; i < tables.length; i++) {
			if (tables[i].tagName != "TABLE") continue;
			var tds = tables[i].getElementsByTagName("td");
			for (var j = 0; j < tds.length; j++) {
				tds[j].onmouseover = function() {colorColumn(this,1)};
				tds[j].onmouseout = function() {colorColumn(this)};
			}
		}
	});
}

function colorColumn(td, on) {
	var tr = td.parentNode;
	var table = tr.parentNode;
	for (var i = 0; i < tr.cells.length; i++) {
		if (tr.cells[i] == td) break;
	}
	for (var j = 0; j < table.rows.length; j++) {
		table.rows[j].cells[i].style.backgroundColor = on ? '#ffdfb2' : 'white';
	}
}
