/**
 * Rietveld in het Stedelijk
 */

(function() {
	var parents = ['students', 'videothumbs'];
	for (var x = 0; x < parents.length; x++) {
		if (!document.getElementById(parents[x])) {
			return false;
		}
		var links = document.getElementById(parents[x]).getElementsByTagName('a');
		for (var i = 0, l = links.length; i < l; i++) {
			(function(i) {
				var theOtherPrefix = parents[x] == 'students' ? 'tlink-' : 'llink-';
				var id = links[i].getAttribute('id').substr(6);
				var theOther = document.getElementById(theOtherPrefix+id);
				if (theOther) {
					links[i].onmouseover = links[i].onfocus = function() {
						theOther.className += 'current';
					};
					links[i].onmouseout = links[i].onblur = function() {
						theOther.className = '';
					};
				}
			})(i);
		}
	}
})();