// JavaScript Document
(function(){
	var zMenu = ('navigation').split(','); // ids of navigation elements to aquire the "this page" class
	var defaultPage = 'index.php'; // define this sites "default" file name
	var classToApply = ('thisPage').split(','); // define class in the same order as the above defined ids
	for(var i=0; i < zMenu.length; i++){
		if (document.getElementById && document.getElementById(zMenu[i])){
			var strLocation = (top.location.pathname.lastIndexOf("/")+1 == top.location.pathname.length) ? top.location.hostname + top.location.pathname+defaultPage : top.location.hostname + top.location.pathname;
			var a = document.getElementById(zMenu[i]).getElementsByTagName("a");
			for (var x=0; x < a.length; x++){
				if (a[x] && a[x].href && a[x].href.lastIndexOf("#")+1!=a[x].href.length){
					if (a[x].href.indexOf(strLocation,0)>0 || a[x].href == top.location.protocol + "//" + top.location.hostname + top.location.pathname){
						a[x].className += " "+classToApply[i];
					}
				}
			}
		}
	}
})();
