function getPart(id) {
	if(document.getElementById) {
		return document.getElementById(id);
	} else if(document.all) {
		return document.all[id];
	} else if(document.layers) {
		return document.layers[id];
	} else {
		window.alert("Uw browser ondersteunt de gebruikte DHTML techniek niet.\nNeem alstublieft contact op met de maker.");
	}
}
function getBlock(id) {
	var block = this.getPart(id);
	// Add 'block' methods for adjusting position, size and visibility
	if(block && !block.setX) {
		block.setX = blockSetX;
		block.setY = blockSetY;
		block.setWidth = blockSetWidth;
		block.setHeight = blockSetHeight;
		block.getVisibility = blockGetVisibility;
		block.setVisibility = blockSetVisibility;
		block.getOpacity = blockGetOpacity;
		block.setOpacity = blockSetOpacity;
	}
	return block;
}
function blockSetX(newX) {
	if(this.style) {
		this.style.left = newX
	} else {
		this.left = newX;
	}
}
function blockSetY(newY) {
	if(this.style) {
		this.style.top = newY
	} else {
		this.top = newY;
	}
}
function blockSetWidth(newWidth) {
	if(this.style) {
		this.style.width = newWidth
	} else {
		this.width = newWidth;
	}
}
function blockSetHeight(newHeight) {
	if(this.style) {
		this.style.height = newHeight
	} else {
		this.height = newHeight;
	}
}
function blockGetVisibility() {
	var visibilityValue;
	if(this.style) {
		visibilityValue = this.style.visibility;
	} else {
		visibilityValue = this.visibility;
	}
	return visibilityValue != "hidden";
}
function blockSetVisibility(newVisibility) {
	var visibilityValue = newVisibility ? "visible" : "hidden";
	if(this.style) {
		this.style.visibility = visibilityValue;
	} else {
		this.visibility = visibilityValue;
	}
}
function blockGetOpacity() {
	if(!this.blockOpacity) {
		if(this.style.opacity) {
			this.blockOpacity = this.style.opacity;
		} else if(this.style.MozOpacity) {
			this.blockOpacity = this.style.MozOpacity;
		} else if(this.filters && this.filters.alpha && this.filters.alpha.opacity) {
			this.blockOpacity = this.filters.alpha.opacity;
		} else {
			// Assume opacity 100%
			this.blockOpacity = 1;
		}
	}
	return this.blockOpacity;
}
function blockSetOpacity(newOpacity) {
	if(this.style) {
		this.style.opacity = newOpacity;
		if(this.filters && this.filters.alpha) {
			this.filters.alpha.opacity = newOpacity * 100;
		}
	}
	this.blockOpacity = newOpacity;
}
function noDefaultEvent(ev) {
	if(ev.preventDefault) {
		ev.preventDefault();
	}
	ev.returnValue = false;
	return false;
}
function windowWidth() {
	if(window.innerWidth && window.innerWidth > 0) { 
		return window.innerWidth;
	}
	if(document.body.clientWidth && document.body.clientWidth > 0) {
		return document.body.clientWidth;
	}
	return 0;
}
function windowHeight() {
	if(window.innerHeight && window.innerHeight > 0) { 
		return window.innerHeight;
	}
	if(document.body.clientHeight && document.body.clientHeight > 0) {
		return document.body.clientHeight;
	}
	return 0;
}
function clearStatusbar() {
	window.status = "";
	return false;
}
function cleanText(text) {
	var result = text;
	result = result.replace(new RegExp("&nbsp;", "g"), " ");
	result = result.replace(new RegExp("&quot;", "g"), "\"");
	result = result.replace(new RegExp("&eacute;", "gi"), "e");
	result = result.replace(new RegExp("&amp;", "g"), "&");
	result = result.replace(new RegExp("<br>", "g"), "\n");
	result = result.replace(new RegExp("&ordm;", "g"), "");	// graden
	result = result.replace(new RegExp("&plusmn;", "g"), "+/-");
	return result;
}
function isExplorer() {
	return navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0;
}
function isSafari() {
	return navigator.userAgent && navigator.userAgent.indexOf("Safari") >= 0;
}
function isFirefox() {
	return navigator.userAgent && navigator.userAgent.indexOf("Firefox") >= 0;
}

