// (c) 2001 - 2009 Netsilik
// Internet : http://www.netsilik.nl
// E-mail   : info (at) netsilik x nl

startList = function() {
	if (document.all && document.getElementById) {
		cssdropdownRoot = document.getElementById('siteNavTree');
		
		for (x = 0; x < cssdropdownRoot.childNodes.length; x++) {
			node = cssdropdownRoot.childNodes[x];
			if (node.nodeName == 'LI') {
				node.onmouseover = function() {
					this.className += ' over';
				}
				node.onmouseout = function() {
					this.className=this.className.replace(' over', '');
				}
			}
		}
	}
}
if (window.attachEvent) {
	window.attachEvent("onload", startList);
} else {
	window.onload=startList;
}

function tooglePageUrlPopUp() {
	if (document.getElementById('pageUrlPopUpDiv').style.display == 'block') {
		document.getElementById('pageUrlPopUpDiv').style.display = 'none';
	} else {
		document.getElementById('pageUrlPopUpDiv').style.display = 'block';
	}
	return false;
}

function enigma(inStr){ //v1.0
	document.location.href = inStr.replace(/[a-zA-Z]/g, function(c){
		return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);
	});
	return false;
};

// *** basic functionality
function addEventHandler(elemntId, type, handler) {
	var elemnt = document.getElementById(elemntId);
	if (document.addEventListener) {
		elemnt.addEventListener(type, handler, false);
		return true;
	} else if (document.attachEvent) {
		return elemnt.attachEvent('on' + type, handler);
	}
	return false;
}
function stopEvent(event) {
	event.cancelBubble = true;
	if (event.stopPropagation) event.stopPropagation();
	if (event.preventDefault) event.preventDefault();
	event.returnValue = false;
	return false;
}
// *** fix javascript deficiencies
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g, '');
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/, '');
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/, '');
}