function markLocation(){
	// dom test
	if (!document.getElementById || !document.getElementsByTagName) return;
	
	// store the targets
	var location = window.location.toString();
	var container = document.getElementById('thumbnails');
	if (!container) return;
	var candidates = container.getElementsByTagName('A');
	if (!candidates) return;
	
	// failsafe for css declarations should the js fail
	container.className += ' marked';
	
	// find the match and class the targets
	for (var i=0; i<candidates.length; i++) {
		if (candidates[i].href == location) {
			var mark = candidates[i];
			while (mark.id != container.id) {
				if (mark.tagName == 'LI' || mark.tagName == "A"){
					mark.className += ' selected';
					if (mark.tagName == "A") mark.onclick = function() { return false; };
				}
				mark = mark.parentNode;
			}
		}
	}	
}
markLocation();