



// constructor functie nodes ======================= //
var nodes = function () {
	this.id=true;
}

// parentNodeBy ==================================== //
// zoek een parent node die voldoet aan:
//  condition (a=b)
// voorbeeld
// (o,'nodeName=TD')
// o = het huidige object waarin men zich bevind
// zoek naar de eerste parent met de property nodeName=TD
// oftewel: zoek naar de eerste bovenliggende TD
// =================================================== //
nodes.prototype.parentNodeBy  = function (el, condition) {
	if (typeof condition != 'string')
		condition = false;

	while (true) {
		if (typeof el.parentNode == 'undefined')
			return (false);

		if (condition == false)
			return (el.parentNode);

		if (this.check_condition (condition, el.parentNode))
			return (el.parentNode);

		var el = el.parentNode;
	}
	return (false);
}

// check_condition ============================================ //
/*
	zinnigeParentNode = parentNodeBy ('prop!=', thisNode);
*/
// hulpfunctie ================================================ //

nodes.prototype.check_condition = function (condition, el) {
	if (typeof condition != 'string')
		return (false);

	var arr = condition.split ('=', 2);

	if (arr.length == 1)
		arr [1] = '';

	if (typeof arr.length != 'undefined' && arr.length == 2) {
		var negative = arr [0].replace (/\!$/, '');
		if (negative == arr [0]) {
			negative = false;
		} else {
			arr [0] = negative;
			negative = true;
		}
		try {
			if (negative) {
				if (el [arr [0]] != arr [1])
					return (true);
			} else {
				if (el [arr [0]] == arr [1])
					return (true);
			}
		} catch (e) {
		}
	}
	return (false);
}

nodes.prototype.is_node = function (node) {
	if (node != null && typeof node != 'undefined') {
		if (typeof node.nodeType != 'undefined') {
			var nodeType = node.nodeType.toString ();

			if (nodeType != 3 && nodeType != 8) {
				return (true);
			}
		}
	}
	return (false);
}

function Quicktourvergroting (fileName) {
	filename=fileName.replace("/\/","/").split("/");
	popup('/popupimage.php?clientpopup=true&image=import::afbeeldingen::origineel::' + filename[filename.length-1]);
}

/**rotating images for partner logos **/
	function showRotatingImage () {
		var linktag  =  document.getElementById('partnerlogoLink');
		var sfeerbeeld  =  document.getElementById('partnerlogoImg');
		
		if (!sfeerbeeld)
			return false;
	
		sfeerbeeld.src = imgArr[showRotatingImage.nr];
		linktag.href = altArr[showRotatingImage.nr];
		linktag.setAttribute('icon','false');
		showRotatingImage.nr++;
	
		if (showRotatingImage.nr >= imgArr.length)
			showRotatingImage.nr = 0;
	
		window.setTimeout(showRotatingImage,4000)
	}


