// now where did that get to?

var Find = {
	_relations: [['Prev','previousSibling'], ['Next', 'nextSibling'], ['Parent', 'parentNode']],
	_aliases:   [['Previous', 'Prev'], ['Ancestor', 'Parent']] // i think aliasing tends to get out of hand but these are reasonable
};

// wrappers
for( var i = 0; i < Find._relations.length; ++i ){
	var j = Find._relations[i];
	Find[j[0]] = i;
	(function(){ 	// how do you circumvent buggy closures?  by using more closures!
		var r = j[1];
		Find[   j[0].toLowerCase()] = function(element, tag){ return Find.relation(element, tag, r); };
	})();
}

for( var i = 0; i < Find._aliases.length; ++i ){
	var a = Find._aliases[i];
	Find[a[0]              ] = Find[a[1]              ];
	Find[a[0].toLowerCase()] = Find[a[1].toLowerCase()];
}

$collect(Find);

Find.sibling  = function(element, tag, where){ return Find.relation(element, tag, Find._props[where || 0]); }

Find.relation = function(element, tag, rel){
	if( !element ) return false;

	// hmm... loop or recursion... will have to run some performance tests
	var tagname = tag.toLowerCase();
	//var last;
	var el = element;

	if( typeof(rel) == 'number' ) rel = Find._props[rel];

	do { /* last = el; */ el = el[rel]; } while( el && el.nodeName.toLowerCase() != tagname /* && el != last */ ); // no infinite loops, please
	return el;
}
