// A function which navigates the user to a specified page using JavaScript
function go(paginaURL) {
	parent.location.href = paginaURL;
}


function addLoadEvent(func) {
	var oldonload = window.onload;

	if (typeof window.onload != "function") {
		window.onload = func;
	} else {
		window.onload = function () {
			oldonload();
			func();
		}
	}
}

// string manipulations ----------------------------------------------------

function Left(str, n) {
	if (n <= 0) {
		return "";
	} else if (n > String(str).length) {
		return str;
	} else {
		return String(str).substring(0, n);
	}
}


function Right(str, n) {
	if (n <= 0) {
		return "";
	} else if (n > String(str).length) {
		return str;
	} else {
		var iLen = String(str).length;
		return String(str).substring(iLen, iLen - n);
	}
}


function trim(str) {
	return str.replace(/^\s*|\s*$/g,"");
}


/* ================ Automatic Popup's ================ */

	function setPopLinks() {
		var oHyperlinks = $$('a');

		for (var iCnt = 0; iCnt < oHyperlinks.length; iCnt++) {
			if ((oHyperlinks[iCnt].get('class').indexOf('popup') >= 0) || (oHyperlinks[iCnt].get('class').indexOf('popupNoImg') >= 0)) {
				oHyperlinks[iCnt].addEvent('click', function() {
					return pop(this.get('href'));
				});

				if (!oHyperlinks[iCnt].hasClass('noTitle')) {
					oHyperlinks[iCnt].set('title', oHyperlinks[iCnt].get('title') + ' (opent in nieuw venster)');
				}
			}
		}
	}


	function pop(sURL) {
		oNewWindow = window.open(sURL);

		if (window.focus) {
			oNewWindow.focus();
		}

		return false;
	}

// -------------------------------------------------------------------------