/*
Object.prototype.nextObject = function() {
	var n = this;
	do n = n.nextSibling;
	while (n && n.nodeType != 1);
	return n;
}
Object.prototype.previousObject = function() {
	var p = this;
	do p = p.previousSibling;
	while (p && p.nodeType != 1);
	return p;
}
*/
Array.prototype.search = function(str, partial, reverse) {
    for (var i = 0; i < this.length; i++) {
        name = this[i];

        if (partial && name.indexOf(str) >= 0 ||
            partial && reverse && str.indexOf(name) >= 0 ||
            !partial && name === str
        ) {
            return i;
        }
    }
    return false;
}
Array.prototype.countElementsByType = function(type) {
	var counter = 0;
	for (var i = 0; i < this.length; i++) {
		if (typeof this[i] == type) {
			counter++;
		}
	}
	return counter;
}
