function getWindowSize() {
	var w = 0;
	var h = 0;
	if (typeof(window.innerWidth) == 'number') {
		// non-IE:
		w = window.innerWidth;
		h = window.innerHeight;
	} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		// IE 6+ in 'standards compliant mode':
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
	} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		// IE 4 compatible:
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}
	size = new Array(w,h);
	return size;
}

function getObjById(id) {
	var ret = '';
	if (document.getElementById) {
		ret = document.getElementById(id);
	}
	else if (document.all)
		ret = document.all[id];
	else if (document.layers)
		ret = document.layers[id];
	return ret;
}

function getOffsetTopById(id) {
	var offset = 0;
	obj = getObjById(id);
	while (obj != null) {
		offset += obj.offsetTop;
		obj = obj.offsetParent;
	}
	return offset;
}

var stop = 0;
function glueBottom() {
	markerOffset = 45;
	bottomOffset = 108;
	pageHeight = getWindowSize()[1];
	contentHeight = getOffsetTopById('vMarker') + markerOffset;
	spacerPos = getOffsetTopById('vSpacer');
	if (pageHeight > contentHeight) {
		offset = pageHeight - spacerPos - bottomOffset;
	} else {
		offset = contentHeight - spacerPos - bottomOffset;
	}
	if (offset > 1) {
		getObjById('vSpacer').height = offset;
		// ugly workaround for FF:
		if (stop == 0) {
			stop = 1;
			glueBottom();
		}
	}
}

window.onload = glueBottom;
window.onresize = glueBottom;
